Search completed in 1.06 seconds.
4828 results for "sup":
Your results are loading. Please wait...
<sup>: The Superscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sup
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...ed content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes the <sup> element should only be used for typographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. for example, to style the wordmark of a business or product which uses a raised baseline should be done using css (most likely vertical-align) rather than <sup>. this would be done u...
...ypographical reasons—that is, to change the position of the text to comply with typographical conventions or standards, rather than solely for presentation or appearance purposes. for example, to style the wordmark of a business or product which uses a raised baseline should be done using css (most likely vertical-align) rather than <sup>. this would be done using, for example, vertical-align: super or, to shift the baseline up 50%, vertical-align: 50%. ...
...And 9 more matches
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
the mediatracksupportedconstraints dictionary's noisesuppression property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the noisesuppression constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). the noisesuppression constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well. ...
...er be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). the noisesuppression constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well. syntax noisesuppressionsupported = supportedconstraintsdictionary.noisesuppression; value this property is present in the dictionary (and its value is always true) if the user agent supports the noisesuppression constraint (and therefore supports noise suppression on audio tracks). ...
...device supports automatic gain control as well. syntax noisesuppressionsupported = supportedconstraintsdictionary.noisesuppression; value this property is present in the dictionary (and its value is always true) if the user agent supports the noisesuppression constraint (and therefore supports noise suppression on audio tracks). if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whether or not your browser supports the noisesuppression constraint. html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.get...
...ported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whether or not your browser supports the noisesuppression constraint. html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().noisesuppression) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'noisesuppression' in that specification. candidate recommendation initial specification. ...
@supports - CSS: Cascading Style Sheets
Web › CSS › @supports
precedence of operators can be defined with parentheses. ...
...precedence of operators can be defined with parentheses. ...
...precedence of operators can be defined with parentheses. ...
...And 65 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
3c dom, and ecmascript (javascript) standards. it also includes compatibility features which allow it to reasonably handle legacy content which was developed for earlier generations of browsers such as netscape navigator 4 as well as features which provide compatibility with internet explorer 5 and 6. unlike other browsers, gecko is truly cross platform and provides consistent behavior across all supported operating systems. the easiest way to support gecko is to create content which follows web standards. unfortunately, no other browser supports web standards as completely as gecko. this means web developers and authors are forced to continue to support other browsers which do not comply with the standards as fully. fortunately, other browsers such as opera (versions 7 & later) and to a les...
...o is to create content which follows web standards. unfortunately, no other browser supports web standards as completely as gecko. this means web developers and authors are forced to continue to support other browsers which do not comply with the standards as fully. fortunately, other browsers such as opera (versions 7 & later) and to a lesser extent, internet explorer (versions 5.5 & later) also support the standards to a degree. these other browsers appear to be moving towards more complete support for the standards and there is hope that in the future web developers and authors will be able to dispense with browser detection at least with regard to features governed by standards. ...
...browser detection is key to accomplishing this task. browser detection history primer to understand why many common browser detection strategies are inappropriate, we must first look back on how these strategies came into being. ...
...And 42 more matches
TypeScript support in Svelte - Learn web development
ested at all in typescript, you can skip to the next chapter, where we will look at different options for deploying our svelte applications, further resources, and more. ...
... deploying our svelte applications, further resources, and more. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/07-typescript-support or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support remember to run npm install && npm run dev to start your app in development mode. repl unfortunately, typescript support is not yet available in the repl. typescript: optional static typing for javascript typescript is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics. the goal of typescript is to help catch mistakes early t...
...es features such as optional static typing, classes, interfaces, and generics. the goal of typescript is to help catch mistakes early through its type system and make javascript development more efficient. one of the big benefits is enabling ides to provide a richer environment for spotting common errors as you type the code. best of all, javascript code is valid typescript code; typescript is a superset of javascript. you can rename most of your .js files to .ts files and they will just work. our typescript code will be able to run everywhere javascript can run. how is that possible? typescript "transpiles" our code to vainilla javascript. that means that it parses typescript code and produces the equivalent vanilla javascript code for browsers to run. note: if you are curious about how ...
...And 17 more matches
nsISupportsPrimitive
xpcom/ds/nsisupportsprimitives.idlscriptable this interface serves as a base interface for all of the nsisupports* family of interfaces. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description type unsigned short this attribute provides access to the type represented by the nsisupportsprimitive instance. constants constant value description type_id 1 corresponding to nsisupportsid. type_cstring 2 corresponding to nsisupportscstring. type_string 3 corresponding to nsisupportsstring. type_prbool 4 corresponding to nsisupportsprbool. type_pruint8 5 corresponding to nsisupportspruint8. type_pruint16 6 corresponding to nsisupportspruint16. type_pruint32 7 corresponding to nsisupportspruint32. type_pruint64 8 correspondin...
..._id 1 corresponding to nsisupportsid. type_cstring 2 corresponding to nsisupportscstring. type_string 3 corresponding to nsisupportsstring. type_prbool 4 corresponding to nsisupportsprbool. type_pruint8 5 corresponding to nsisupportspruint8. type_pruint16 6 corresponding to nsisupportspruint16. type_pruint32 7 corresponding to nsisupportspruint32. type_pruint64 8 corresponding to nsisupportspruint64. type_prtime 9 corresponding to nsisupportsprtime. type_char 10 corresponding to nsisupportschar. type_print16 11 corresponding to nsisupportsprint16. type_print32 12 corresponding to nsisupportsprint32. type_print64 13 corresponding to nsisupportsprint64. type_float 14 corresponding to nsisupportsfloat. type_double 15 corresponding to nsisupportsdouble. type_void 16 ...
...e_prtime 9 corresponding to nsisupportsprtime. type_char 10 corresponding to nsisupportschar. type_print16 11 corresponding to nsisupportsprint16. type_print32 12 corresponding to nsisupportsprint32. type_print64 13 corresponding to nsisupportsprint64. type_float 14 corresponding to nsisupportsfloat. type_double 15 corresponding to nsisupportsdouble. type_void 16 corresponding to nsisupportsvoid. type_interface_pointer 17 corresponding to nsisupportsinterfacepointer. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
...And 17 more matches
PushManager.supportedContentEncodings - Web APIs
working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...finition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 17 more matches
Supporting older browsers - Learn web development
previous overview: css layout next in this module, we recommend using flexbox and grid as the main layout methods for your designs. however, there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. this will always be the case on the web — as new features are developed, different browsers will prioritise different things. this article explains how to use modern web techniques without locking out users of older technology. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand how to provide support for your layouts on older browsers that might not support the features you want to use. w...
...er than an average number of mobile devices. accessibility and people using assistive technology should always be considered, but for some sites that may be even more critical. in my experience, developers are often very worried about the experience of 1% of users in an old version of internet explorer, while not considering at all the far greater number who have accessibility needs. what is the support for the features you want to use? once you know the browsers that come to your site, you can assess any technology that you want to use against how well it is supported and how easily you can provide an alternative for visitors who do not have that technology available. we are trying to make this easy for you at mdn, by providing browser compatibility information on each page detailing a css...
...and how easily you can provide an alternative for visitors who do not have that technology available. we are trying to make this easy for you at mdn, by providing browser compatibility information on each page detailing a css property. for example, take a look at the page for grid-template-columns. at the bottom of this page is a table, which lists major browsers along with the version they began supporting this property. another popular way to find out about how well a feature is supported is the can i use website. this site lists the majority of web platform features with information about their browser support status. you can view usage statistics by location — useful if you work on a site that has users mostly for a specific area of the world. you can even link your google analytics ...
...And 14 more matches
nsISupportsArray
xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
... xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
... xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
...And 14 more matches
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccardrequest dictionary contains an array of domstrings representing the card networks that the retailer supports (e.g. amex, mastercard). syntax supportednetworks : [value [, ... value]] value an array containing one or more domstrings, which describe the card networks the retailer supports. legal values are defined in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. ...
...ed in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. ...
...d network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. ...
...And 12 more matches
nsIMacDockSupport
method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon. ...
...method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon. ...
...o the dock on mac os x. 1.0 66 introduced gecko 2.0 inherits from: nsimacdocksupport last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) implemented by: @mozilla.org/cookie-monster;1. to create an instance, use: var dock = components.classes["@mozilla.org/widget/macdocksupport;1"] .getservice(components.interfaces.nsimacdocksupport); see working with the mac os x dock for details and examples. method summary void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon. this can be used, for example, to display the number of unread messages in an email client. ...
...And 9 more matches
AT APIs Support
introduction documentation is in progress still. but in the meantime it more up-to-date and contains more details than existed analogues for at-spi and msaa this documentation explains how makers of screen readers, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support gecko-based software. we provide for them the support of these products on windows, linux/unix and os x platforms. accessible gecko gecko is a rendering engine that firefox, seamonkey, netscape and yelp use. gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom. gecko also handles the users keystrokes and mouse clicks. gecko is the core architecture that we are adding acc...
...ix and os x platforms. accessible gecko gecko is a rendering engine that firefox, seamonkey, netscape and yelp use. gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom. gecko also handles the users keystrokes and mouse clicks. gecko is the core architecture that we are adding accessibility to, in order to support basic accessibility in all applications that are based on it. gecko based applications gecko can be used in two ways to create application: embedded clients embedded clients use gecko only in the content window, at the moment for html and generic xml only. they typically use standard windows controls for their user interface -- the area outside of the client content window, plus the conte...
... xul applications xul applications make full use of the gecko architecture, not only for html content, but also for the entire user interface. widgets such as menus, tab panels, tree views and dialogs are provided via an xml language called xul (extensible user-interface language). none of the user interface contains standard os controls. this is done to ensure a common look and feel across all supported platforms, and to allow for different skins (appearances). developing a xul window is not that different from developing a web page, but the elements available to add widgets are more powerful and designed to be similar to desktop widgets. examples of xul applications: firefox - web-browser thunderbird - email client seamonkey - web-browser, advanced e-mail and newsgroup client, irc c...
...And 8 more matches
MediaTrackSupportedConstraints.logicalSurface - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). ...
... example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). ...
... example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). ...
...And 8 more matches
XRSystem: isSessionSupported() - Web APIs
the xrsystem method issessionsupported() returns a promise which resolves to true if the specified webxr session mode is supported by the user's webxr device. otherwise, the promise resolves with false. if the no devices are available or the browser doesn't have permission to use the xr device, the promise is rejected with an appropriate domexception. syntax var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked. this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive virtual experience. ...
... securityerror the document's origin does not have permission to use the xr-spatial-tracking feature policy. ...
...e for which support is to be checked. this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive virtual experience. return value a promise that resolves to true if the specified session mode is supported; otherwise the promise resolves to false. exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings. securityerror the document's origin does not have permission to use the xr-spatial-tracking feature policy. ...
...And 7 more matches
MediaTrackSupportedConstraints.frameRate - Web APIs
the mediatracksupportedconstraints dictionary's framerate property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the framerate constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. the framerate constraint can be used to establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed. checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. see the example to see how this can be used. ...
...an be used to establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed. checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. see the example to see how this can be used. ...
...o establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the request to succeed. checking the value of this property lets you determine if the user agent allows constraining the video track configuration by frame rate. see the example to see how this can be used. ...
...And 5 more matches
MediaTrackSupportedConstraints - Web APIs
the mediatracksupportedconstraints dictionary establishes the list of constrainable properties recognized by the user agent or browser in its implementation of the mediastreamtrack object. an object conforming to mediatracksupportedconstraints is returned by mediadevices.getsupportedconstraints(). because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. ...
... an actual constraint set is described using an object based on the mediatrackconstraints dictionary. to learn more about how constraints work, see capabilities, constraints, and settings. ...
... accepted. an actual constraint set is described using an object based on the mediatrackconstraints dictionary. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. autogaincontrol a boolean whose value is true if the autogaincontrol constraint is supported in the current environment. width a boolean value whose value is true if the width constraint is supported in the current environment. height a boolean value whose value is true if the height constraint is supported in the current environment. aspectratio a boolean value whose value is true if the aspectratio constraint is supported in the current environment. framerate a boolean va...
...And 5 more matches
MediaSource.isTypeSupported() - Web APIs
this may include the codecs parameter to provide added details about the codecs used within the file. return value a boolean which is true if the browser feels that it can probably play media of the specified type. ...
...this may include the codecs parameter to provide added details about the codecs used within the file. return value a boolean which is true if the browser feels that it can probably play media of the specified type. ...
...this may include the codecs parameter to provide added details about the codecs used within the file. return value a boolean which is true if the browser feels that it can probably play media of the specified type. ...
...And 4 more matches
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
...And 4 more matches
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
...And 4 more matches
super - JavaScript
the super keyword is used to access and call functions on an object's parent. the super.prop and super[expr] expressions are valid in any method definition in both classes and object literals. syntax super([arguments]); // calls the parent constructor. super.functiononparent([arguments]); description when used in a constructor, the super keyword appears alone and must be used before the this keyword is used. the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). here super() is called to avoid duplicating the constructor parts' that are common between rectangle and square. class rectangle { constructor(height, width) { this.name = 'rectangle'; this.height = he...
... class rectangle { constructor(height, width) { this.name = 'rectangle'; this.height = height; this.width = width; } sayname() { console.log('hi, i am a ', this.name + '.'); } get area() { return this.height * this.width; } set area(value) { this._area = value; } } class square extends rectangle { constructor(length) { this.height; // referenceerror, super needs to be called first! // here, it calls the parent class's constructor with lengths // provided for the rectangle's width and height super(length, length); // note: in derived classes, super() must be called before you // can use 'this'. leaving this out will cause a reference error. this.name = 'square'; } } super-calling static methods you are also able to ca...
...needs to be called first! ...
...And 4 more matches
CSSSupportsRule - Web APIs
it has no specific methods. ...
...it has no specific methods. ...
...it has no specific methods. ...
...And 3 more matches
MediaTrackSettings.noiseSuppression - Web APIs
this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. ...
...this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. ...
...perty is a boolean value whose value indicates whether or not noise suppression technology is enabled on an audio track. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.noisesuppression property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). noise suppression automatically filters the audio to remove background noise, hum caused by equipment, and the like from the sound before delivering it to your code. this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. ...
...And 3 more matches
Detecting CSS animation support - CSS: Cascading Style Sheets
css animations make it possible to do creative animations of content using nothing but css. however, there are likely to be times when this feature isn't available, and you may wish to handle that case by using javascript code to simulate a similar effect. this article, based on this blog post by chris heilmann, demonstrates a technique for doing this. ...
...o creative animations of content using nothing but css. however, there are likely to be times when this feature isn't available, and you may wish to handle that case by using javascript code to simulate a similar effect. this article, based on this blog post by chris heilmann, demonstrates a technique for doing this. ...
...f( animation === false ) { for( var i = 0; i < domprefixes.length; i++ ) { if( elem.style[ domprefixes[i] + 'animationname' ] !== undefined ) { pfx = domprefixes[ i ]; animationstring = pfx + 'animation'; keyframeprefix = '-' + pfx.tolowercase() + '-'; animation = true; break; } } } for starters we define a few variables. ...
...And 3 more matches
Intl.Collator.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
...for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
...form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
...And 3 more matches
Intl.NumberFormat.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. ...
...for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
...And 3 more matches
String.prototype.sup() - JavaScript
the sup() method creates a <sup> html element that causes a string to be displayed as superscript. syntax str.sup() return value a string containing a <sup> html element. description the sup() method embeds a string in a <sup> tag: "<sup>str</sup>". ...
... the sup() method creates a <sup> html element that causes a string to be displayed as superscript. syntax str.sup() return value a string containing a <sup> html element. description the sup() method embeds a string in a <sup> tag: "<sup>str</sup>". ...
... the sup() method creates a <sup> html element that causes a string to be displayed as superscript. syntax str.sup() return value a string containing a <sup> html element. description the sup() method embeds a string in a <sup> tag: "<sup>str</sup>". ...
...And 3 more matches
Supporting search suggestions in search plugins - Archive of obsolete content
firefox supports search suggestions in opensearch plugins; as the user types in the search bar, firefox queries the url specified by the search plugin to fetch live search suggestions. once the list has been retrieved, it's displayed in a popup box that appears under the search bar, which lets the user select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json". ...
...r select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json". ...
...ch bar, then pauses, firefox inserts "fir" in place of {searchterms} and queries that url: <url type="application/x-suggestions+json" template="http://ff.search.yahoo.com/gossip?output=fxjson&command=fir"/> the results are used to construct the suggestion list box. see creating opensearch plugins for firefox to learn more about how to implement a search plugin. implementing search suggestion support on the server the majority of the work in handling search suggestions is actually implemented on the server side. if you're a web site designer, and want to support search suggestions, you need to implement support for returning the suggestions in javascript object notation (json) given a search term. when the browser wants to fetch possible matches for a search term, it then sends an http ...
...And 2 more matches
Supporting private browsing mode - Archive of obsolete content
firefox 3.5 introduced private browsing mode, in which potentially private information is not recorded. this includes cookies, history information, download information, and so forth. when private browsing mode is enabled, temporary, databases are created to be used for cookies and local storage; these databases are thrown away when private browsing mode is turned off, and the regular databases are re-activated. the temporary cookie and local storage databases start out empty. ...
... the above example, we only save the user's private information if not in private browsing mode. note: private browsing mode may only be detected by chrome code, such as extensions; web content cannot detect whether or not private browsing is in effect. detecting whether private browsing mode is permanent requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) firefox 4 added support for having private browsing mode permanently enabled. the theme looks different in this scenario. to determine whether or not the browser is permanently in private browsing mode, you can look at the privatebrowsingmode attribute on the document root. its value is "permanent" if private browsing is permanently enabled for the session, "temporary" if private browsing is temporarily enabled, or ...
... it will simply always report that private browsing is off, and will never call any registered watcher functions. using the helper the helper described above is very easy to use. simply instantiate the helper, then you can use its inprivatebrowsing flag to detect whether or not private browsing is currently enabled, as shown here: var listener = new privatebrows...
...And 2 more matches
nsISupports proxies
on arbitrary threads, and compiled code can use compiled runnable to achieve the same effect in a much simpler manner. for more information about alternatives, see making cross-thread calls using runnables. the following interface is now obsolete: nsiproxyobjectmanager. about xpcom proxies a proxy, in this context, is a stub object which enables a method of any class which is derived from nsisupports and has a typelib to be called on any in-process thread. the main reason for nsisupports proxies is that javascript and ui are on a single thread. when one is busy, the other is blocked. a good example of this is the old install.js scripts that were used in xpinstall in older mozilla versions. they from the majority of javascript code, which is small and can be quickly run. xpinstall insta...
... product would appear frozen until the script was complete. this is definitely bad. because of this, xpinstall was moved to its own thread. now xpinstall can do its installations while the product renders, but now xpinstall can not access ui elements such as a progress meter or a confirmation dialog. how can a separate non-ui thread act as if it was on the ui thread? herein lays the utility of nsisupports proxies. i believe that other people working on mozilla need similar solutions. in this document, i will try to explain how to use nsisupports proxies. how do i use it? the api has changed in mozilla 1.9, but the prose below hasn't been updated yet. see xpcom/proxy/public/nsiproxyobjectmanager.idl for the updated interface and its documentation. see also . from a users point of view, y...
...9, but the prose below hasn't been updated yet. see xpcom/proxy/public/nsiproxyobjectmanager.idl for the updated interface and its documentation. see also . from a users point of view, you need only to look at the nsiproxyobjectmanager. it has two entry points: ns_imethod getproxyforobject(nsieventqueue *destqueue, const nsiid & iid, nsisupports *object, print32 proxytype, void * *result); ns_imethod getproxy(nsieventqueue *destqueue, const nsiid & cid, nsisupports *aouter, const nsiid & iid, print32 proxytype, void * *result); the two apis are essentially the same. the only...
...And 2 more matches
CSS.supports() - Web APIs
Web › API › CSS › supports
the css.supports() method returns a boolean value indicating if the browser supports a given css feature, or not. syntax css.supports(propertyname, value); css.supports(supportcondition); parameters there are two distinct sets of parameters. the first one allows to test the support of a pair property-value: propertyname a domstring containing the name of the css property to check. value a domstring containing the value of the css property to check. the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check. return value true if the browser supports the rule, otherwise false. ...
...y-value: propertyname a domstring containing the name of the css property to check. value a domstring containing the value of the css property to check. the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check. return value true if the browser supports the rule, otherwise false. ...
... of the css property to check. value a domstring containing the value of the css property to check. the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check. return value true if the browser supports the rule, otherwise false. ...
...And 2 more matches
MediaDevices.getSupportedConstraints() - Web APIs
the getsupportedconstraints() method of the mediadevices interface returns an object based on the mediatracksupportedconstraints dictionary, whose member fields each specify one of the constrainable properties the user agent understands. syntax var supportedconstraints = navigator.mediadevices.getsupportedconstraints(); parameters none. return value a new object based on the mediatracksupportedconstraints dictionary listing the constraints supported by the user agent. because only constraints supported by the user agent are included in the list, each of these boolean properties has the value true. example this example outputs a list of the constraints supported by your browser. ...
... return value a new object based on the mediatracksupportedconstraints dictionary listing the constraints supported by the user agent. because only constraints supported by the user agent are included in the list, each of these boolean properties has the value true. example this example outputs a list of the constraints supported by your browser. ...
...e included in the list, each of these boolean properties has the value true. example this example outputs a list of the constraints supported by your browser. ...
...And 2 more matches
MediaTrackSupportedConstraints.displaySurface - Web APIs
the mediatracksupportedconstraints dictionary's displaysurface property indicates whether or not the displaysurface constraint is supported by the user agent and the device on which the content is being used. the supported constraints list is obtained by calling navigator.mediadevices.getsupportedconstraints(). syntax isdisplaysurfacesupported = supportedconstraints.displaysurface; value a boolean value which is true if the displaysurface constraint is supported by the device and user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). it adds the displaysurface constraint (requesting that only full-screen sharing be allowed) only if it is known to be supported by the browser. capturing is then started by calling getdisp...
...straints object specifying the options for the call to getdisplaymedia(). it adds the displaysurface constraint (requesting that only full-screen sharing be allowed) only if it is known to be supported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem. ...
...ll to getdisplaymedia(). it adds the displaysurface constraint (requesting that only full-screen sharing be allowed) only if it is known to be supported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem. ...
...And 2 more matches
MediaTrackSupportedConstraints.volume - Web APIs
the mediatracksupportedconstraints dictionary's volume property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the volume constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax volumeconstraintsupported = supportedconstraintsdictionary.volume; value this property is present in the dictionary (and its value is always true) if the user agent supports the volume constraint. ...
...er be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax volumeconstraintsupported = supportedconstraintsdictionary.volume; value this property is present in the dictionary (and its value is always true) if the user agent supports the volume constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...supports the volume constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...And 2 more matches
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the intl.displaynames.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale. syntax intl.displaynames.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
...form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
...it". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. ...
...And 2 more matches
Intl.ListFormat.supportedLocalesOf() - JavaScript
the intl.listformat.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale. syntax intl.listformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
...form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
...it". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. ...
...And 2 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
an internationalized domain name (idn) is a domain/host name which uses non-ascii characters. until recently domain names allowed only a subset of 7-bit ascii characters. as the internet has spread to non-english speaking people around the world, it has become increasingly clear that forcing them to use domain names written only in a subset of the latin alphabet is not ideal. many of the european languages use the basic latin alphabet with additional accented characters for writing but they were not able to use them in domain names. ...
...for the past few years, there have been a flurry of ietf activities to standardize the protocols involved in domain names to handle non-ascii characters. in march of 2003, three important rfc's were approved by ietf. (cf. rfc's 3490, 3491, 3492.) these new rfc's now make it possible for domain name servers to register non-ascii domain names and application/client vendors to implement standardized support for handling non-ascii characters in domain names. how idn works when a browser sees a host name such as http://developer.mozilla.org, it passes a request to the dns resolver service (usually built into an os), which in turn sends a request to a nearest domain name server to return an ip address that corresponds to the host name. this ip address is then used to connect to the web server in ...
...ble encoding (ace) schemes proposed but an agreement was reached eventually to standardize on a type of ace called "punycode". this is defined in rfc 3492 (punycode: a bootstring encoding of unicode for internationalized domain names in applications (idna)). the punycode proposal uses only restricted ascii characters and numbers (a-z0-9) and a hyphen (-). it was shown to be language independent, superior in compression, compact in code size, round-trip safe, and superior for encoding chinese/japanese/korean characters. the final step of the process is the affixing of the ace prefix to the output string from the nameprep/stringprep and punycode processing. since the punycode contains only ascii characters, it is possible that an output may, though unlikely, coincide with existing domain name...
... using the right-mouse click menu new > boolean. the name of the preference is: network.idn_testbed. the value should be "true". now access idn sites under the .com and .net top domains. you should succeed in reaching the sample sites. don't forget to set the value of these preferences to "default" once you are finished with testing! caveats and conclusions netscape 7.1/mozilla 1.4 has solid support for internationalized domain names and is the first browser with built-in support for new rfc's for idn established by ietf. this means that there is no longer any need to use a plug-in to process non-ascii domain names. netscape/mozilla's support for idn is not without some bugs. one notable bug is that non-ascii names are not always displayed correctly in some ui areas such as preference p...
nsSupportsWeakReference
« xpcom api reference summary inherit from this c++ class to add canonical support for nsisupportsweakreference. see weak reference for detailed description of weak references. #include "nsweakreference.h" class nssupportsweakreference { ... }; remarks in addition to inheriting from this class, you will need to ensure that your nsisupports::queryinterface implementation exposes nsisupportsweakreference as a supported interface. to use this class, you must link your component or application against the xpcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... ...
...ur nsisupports::queryinterface implementation exposes nsisupportsweakreference as a supported interface. to use this class, you must link your component or application against the xpcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... #include "nsweakreference.h" #include "nsifoo.h" class myfoo : public nsifoo, public nssupportsweakreference { public: ns_decl_isupports ns_decl_nsifoo ... }; ns_impl_isupports2(myfoo, nsifoo, nsisupportsweakreference) ... ...
...n against the xpcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... #include "nsweakreference.h" #include "nsifoo.h" class myfoo : public nsifoo, public nssupportsweakreference { public: ns_decl_isupports ns_decl_nsifoo ... }; ns_impl_isupports2(myfoo, nsifoo, nsisupportsweakreference) ... ...
...ry. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... #include "nsweakreference.h" #include "nsifoo.h" class myfoo : public nsifoo, public nssupportsweakreference { public: ns_decl_isupports ns_decl_nsifoo ... }; ns_impl_isupports2(myfoo, nsifoo, nsisupportsweakreference) ... ...
MediaRecorder.isTypeSupported - Web APIs
if the value is false, the user agent is incapable of recording the specified format. ...
...if the value is false, the user agent is incapable of recording the specified format. ...
...if the value is false, the user agent is incapable of recording the specified format. ...
.... if the value is false, the user agent is incapable of recording the specified format. example var types = ["video/webm", "audio/webm", "video/webm\;codecs=vp8", "video/webm\;codecs=daala", "video/webm\;codecs=h264", "audio/webm\;codecs=opus", "video/mpeg"]; for (var i in types) { console.log( "is " + types[i] + " supported? " + (mediarecorder.istypesupported(types[i]) ? "maybe!" : "nope :(")); } specifications specification status comment mediastream recordingthe definition of 'istypesupported()' in that specification. working draft initial definition. ...
MediaTrackSupportedConstraints.autoGainControl - Web APIs
the mediatracksupportedconstraints dictionary's autogaincontrol property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the autogaincontrol constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). the autogaincontrol constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well; it's typically a feature provided by microphones. synta...
...ts dictionary by calling navigator.mediadevices.getsupportedconstraints(). the autogaincontrol constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well; it's typically a feature provided by microphones. syntax autogainsupported = supportedconstraintsdictionary.autogaincontrol; value this property is present in the dictionary (and its value is always true) if the user agent supports the autogaincontrol constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whethe...
...traintsdictionary.autogaincontrol; value this property is present in the dictionary (and its value is always true) if the user agent supports the autogaincontrol constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whether or not your browser supports the autogaincontrol constraint. ...
...pported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whether or not your browser supports the autogaincontrol constraint. html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().autogaincontrol) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'autogaincontrol' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.cursor - Web APIs
the mediatracksupportedconstraints dictionary's cursor property indicates whether or not the cursor constraint is supported by the user agent and the device on which the content is being used. the supported constraints list is obtained by calling navigator.mediadevices.getsupportedconstraints(). syntax iscursorsupported = supportedconstraints.cursor; value a boolean value which is true if the cursor constraint is supported by the device and user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). it adds the cursor constraint only if it is known to be supported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem...
...nd user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). it adds the cursor constraint only if it is known to be supported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem. ...
...constraints object specifying the options for the call to getdisplaymedia(). it adds the cursor constraint only if it is known to be supported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem. ...
...ported by the browser. capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem. async function capturewithcursor() { let supportedconstraints = navigator.mediadevices.getsupportedconstraints(); let displaymediaoptions = { video: { displaysurface: "browser" }, audio: false; }; if (supportedconstraints.cursor) { displaymediaoptions.video.cursor = "always"; } try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { /* handle the error */ } } specifications specification status comment screen capturethe definition of 'mediatracksupportedconstraints.cursor' in that specification. ...
MediaTrackSupportedConstraints.height - Web APIs
the mediatracksupportedconstraints dictionary's height property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the height constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax heightconstraintsupported = supportedconstraintsdictionary.height; value this property is present in the dictionary (and its value is always true) if the user agent supports the height constraint. ...
...er be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax heightconstraintsupported = supportedconstraintsdictionary.height; value this property is present in the dictionary (and its value is always true) if the user agent supports the height constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
... candidate recommendation initial specification. ...
...resent, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().height) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'height' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.width - Web APIs
the mediatracksupportedconstraints dictionary's width property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the width constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax widthconstraintsupported = supportedconstraintsdictionary.width; value this property is present in the dictionary (and its value is always true) if the user agent supports the width constraint. ...
...never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax widthconstraintsupported = supportedconstraintsdictionary.width; value this property is present in the dictionary (and its value is always true) if the user agent supports the width constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
... candidate recommendation initial specification. ...
...present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().width) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'width' in that specification. candidate recommendation initial specification. ...
PaymentDetailsUpdate - Web APIs
displayitems optional an array of paymentitem objects, each describing one line item for the payment request. ...
... displayitems optional an array of paymentitem objects, each describing one line item for the payment request. ...
...e payment user interface after it has been instantiated. this can be done either by calling the paymentrequestupdateevent.updatewith() method or by using the paymentrequest.show() method's detailspromise parameter to provide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time. properties the paymentdetailsupdate dictionary is based on the paymentdetailsbase dictionary, and inherits its properties, which are included in the list below. displayitems optional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. when calling updat...
... of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due changes. this lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate' in that specification. candidate recommendation initial definition. ...
WebGLRenderingContext.getSupportedExtensions() - Web APIs
] see also the webglrenderingcontext.getextension() method to get a specific extension object. webgl extensions extensions for the webgl api are registered in the webgl extension registry. ...
...] see also the webglrenderingcontext.getextension() method to get a specific extension object. webgl extensions extensions for the webgl api are registered in the webgl extension registry. ...
...] see also the webglrenderingcontext.getextension() method to get a specific extension object. webgl extensions extensions for the webgl api are registered in the webgl extension registry. ...
... recommendation initial definition. ...
Intl.PluralRules.supportedLocalesOf() - JavaScript
the intl.pluralrules.supportedlocalesof() method returns an array containing those of the provided locales that are supported in plural formatting without having to fall back to the runtime's default locale. syntax intl.pluralrules.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. for information about this option, see the intl page. ...
...neral form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examp...
...lural formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof() assuming a runtime that supports indonesian and german but not balinese in plural formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to plural formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the lookup algorith...
...unlikely to be supported. note the specification of the lookup algorithm here — a best fit matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. var locales = ['ban', 'id-u-co-pinyin', 'de-id']; var options = { localematcher: 'lookup' }; console.log(intl.pluralrules.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.supportedlocalesof' in that specification. ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
element notes structure module svg implemented. currentscale and currenttranslate dom attributes are implemented, but there is no pan and zoom user interface. ...
... element notes structure module svg implemented. currentscale and currenttranslate dom attributes are implemented, but there is no pan and zoom user interface. ...
... element notes structure module svg implemented. currentscale and currenttranslate dom attributes are implemented, but there is no pan and zoom user interface. ...
.... feconvolvematrix implemented. fediffuselighting implemented. fedisplacementmap implemented. feflood implemented. fegaussianblur implemented. feimage implemented. document fragments (bug 455986) aren't supported in <svg:feimage>. femerge implemented. femergenode implemented. femorphology implemented. feoffset implemented. fespecularlighting implemented. fetile implemented. feturbulence ...
Extensions support in SeaMonkey 2 - Archive of obsolete content
starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions. these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. the basics to support seamonkey 2 as a target application, you need to add it to the list of target applications in the extension's install.rdf file. the code for that will look something like this: <em:targetapplication> <!-- seamonkey --> <description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open ...
...status bar, like this: <vbox id="browser-bottombox"> <something insertbefore="status-bar" /> </vbox> use the following technique to make your overlay work on both seamonkey 2 and firefox 3: <window id="main-window"> <vbox id="browser-bottombox" insertbefore="status-bar"> <something insertbefore="status-bar" /> </vbox> </window> thunderbird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in vari...
...ssageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places. these are so commonly available that developers often forget that they are not built-ins. seamonkey on the other hand defaults to not support them so they either need to be expanded to their proper forms or matching constants/variables need to be defined in custom code. shorthand expansion cc components.classes ci components.interfaces cr components.results cu components.utils multi-browser compatibility to make an extension compatible with seamonkey as well as fi...
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
k at it side-by-side with the article, or to use it as a basis for your own extension. download the sample updating the install manifest the first step is to revise the extension's install manifest to indicate that it can be installed in thunderbird and sunbird. ...
...after inse...
...after inserting this code, you can successfully install the extension into any (or all) of firefox, thunderbird, and sunbird, but you won't see any effect in thunderbird and sunbird. ...
CSS -moz-bool-pref() @supports function
the -moz-bool-pref() @supports condition is available to gecko chrome and ua stylesheets to check if a boolean preference is enabled. syntax -moz-bool-pref( <string> ) parameters <string> the preference name returns evaluates to true if the preference is enabled, false otherwise. example warning: this will only work when loaded from a gecko chrome stylesheet. html <div id="pref-test"> this will have a green background if the <code>test</code> preference is enabled. ...
...boolean preference is enabled. ...
... <string> the preference name returns evaluates to true if the preference is enabled, false otherwise. ...
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). this property is obsolete and should no longer be used. instead of making the web app or site worry about this, the onus has been transferred to the payment processor. syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports. legal values are defined in basiccardtype enum, and are currently: credit debit prepaid example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which...
...uest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports. legal values are defined in basiccardtype enum, and are currently: credit debit prepaid example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ... }; var options = { ... ...
... of which contains supportednetworks and supportedtypes properties. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ... }; var options = { ... ...
DOMTokenList.supports() - Web APIs
the supports() method of the domtokenlist interface returns true if a given token is in the associated attribute's supported tokens. this method is intended to support feature detection. syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for. returns a boolean indicating whether the token was found. ...
...face returns true if a given token is in the associated attribute's supported tokens. this method is intended to support feature detection. syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for. returns a boolean indicating whether the token was found. ...
... the associated attribute's supported tokens. this method is intended to support feature detection. syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for. returns a boolean indicating whether the token was found. example let iframe = document.getelementbyid('display'); if (iframe.sandbox.supports('an-upcoming-feature')) { // support code for mystery future feature } else { // fallback code } if (iframe.sandbox.supports('allow-scripts')) { // instruct frame to run javascript // // (note: this feature is well-supported; this is just an example!) // } specifications specification status comment credential management level 1 working draft initial definition. ...
MediaTrackConstraints.noiseSuppression - Web APIs
the mediatrackconstraints dictionary's noisesuppression property is a constrainboolean describing the requested or mandatory constraints placed upon the value of the noisesuppression constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.noisesuppression as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. noise suppression is typically provided by microphones, although it can be provided by other input sources as well. ...
...ng the value of mediatracksupportedconstraints.noisesuppression as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. noise suppression is typically provided by microphones, although it can be provided by other input sources as well. syntax var constraintsobject = { noisesuppression: constraint }; constraintsobject.noisesuppression = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with noise suppression enabled or disabled as specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting...
...raint }; constraintsobject.noisesuppression = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with noise suppression enabled or disabled as specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the noise suppression feature; if it can't be met, then the request will result in an error. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'noisesuppression' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.aspectRatio - Web APIs
the mediatracksupportedconstraints dictionary's aspectratio property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the aspectratio constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax aspectconstraintsupported = supportedconstraintsdictionary.aspectratio; value this property is present in the dictionary (and its value is always true) if the user agent supports the aspectratio constraint. ...
...e. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax aspectconstraintsupported = supportedconstraintsdictionary.aspectratio; value this property is present in the dictionary (and its value is always true) if the user agent supports the aspectratio constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...rts the aspectratio constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().aspectratio) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'aspectratio' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.channelCount - Web APIs
the mediatracksupportedconstraints dictionary's channelcount property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the channelcount constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax channelcountconstraintsupported = supportedconstraintsdictionary.channelcount; value this property is present in the dictionary (and its value is always true) if the user agent supports the channelcount constraint. ...
...can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax channelcountconstraintsupported = supportedconstraintsdictionary.channelcount; value this property is present in the dictionary (and its value is always true) if the user agent supports the channelcount constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...ts the channelcount constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().channelcount) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'channelcount' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.deviceId - Web APIs
the mediatracksupportedconstraints dictionary's deviceid property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the deviceid constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax deviceidconstraintsupported = supportedconstraintsdictionary.deviceid; value this property is present in the dictionary (and its value is always true) if the user agent supports the deviceid constraint. ...
...false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax deviceidconstraintsupported = supportedconstraintsdictionary.deviceid; value this property is present in the dictionary (and its value is always true) if the user agent supports the deviceid constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...pports the deviceid constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().deviceid) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'deviceid' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.echoCancellation - Web APIs
the mediatracksupportedconstraints dictionary's echocancellation property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the echocancellation constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax echocancellationconstraintsupported = supportedconstraintsdictionary.echocancellation; value this property is present in the dictionary (and its value is always true) if the user agent supports the echocancellation constraint. ...
...he supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax echocancellationconstraintsupported = supportedconstraintsdictionary.echocancellation; value this property is present in the dictionary (and its value is always true) if the user agent supports the echocancellation constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...he echocancellation constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().echocancellation) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'echocancellation' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.facingMode - Web APIs
the mediatracksupportedconstraints dictionary's facingmode property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the facingmode constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax facingmodeconstraintsupported = supportedconstraintsdictionary.facingmode; value this property is present in the dictionary (and its value is always true) if the user agent supports the facingmode constraint. ...
... you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax facingmodeconstraintsupported = supportedconstraintsdictionary.facingmode; value this property is present in the dictionary (and its value is always true) if the user agent supports the facingmode constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...) if the user agent supports the facingmode constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html <div id="result"> </div> css #result { font: 14px "arial", sans-serif; } javascript let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().facingmode) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'facingmode' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.groupId - Web APIs
the mediatracksupportedconstraints dictionary's groupid property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the groupid constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax groupidconstraintsupported = supportedconstraintsdictionary.groupid; value this property is present in the dictionary (and its value is always true) if the user agent supports the groupid constraint. ...
...be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax groupidconstraintsupported = supportedconstraintsdictionary.groupid; value this property is present in the dictionary (and its value is always true) if the user agent supports the groupid constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...upports the groupid constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().groupid) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'groupid' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.latency - Web APIs
the mediatracksupportedconstraints dictionary's latency property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the latency constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax latencyconstraintsupported = supportedconstraintsdictionary.latency; value this property is present in the dictionary (and its value is always true) if the user agent supports the latency constraint. ...
...be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax latencyconstraintsupported = supportedconstraintsdictionary.latency; value this property is present in the dictionary (and its value is always true) if the user agent supports the latency constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...upports the latency constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().latency) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'latency' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.sampleRate - Web APIs
the mediatracksupportedconstraints dictionary's samplerate property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the samplerate constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax samplerateconstraintsupported = supportedconstraintsdictionary.samplerate; value this property is present in the dictionary (and its value is always true) if the user agent supports the samplerate constraint. ...
... you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax samplerateconstraintsupported = supportedconstraintsdictionary.samplerate; value this property is present in the dictionary (and its value is always true) if the user agent supports the samplerate constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...orts the samplerate constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().samplerate) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'samplerate' in that specification. candidate recommendation initial specification. ...
MediaTrackSupportedConstraints.sampleSize - Web APIs
the mediatracksupportedconstraints dictionary's samplesize property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the samplesize constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax samplesizeconstraintsupported = supportedconstraintsdictionary.samplesize; value this property is present in the dictionary (and its value is always true) if the user agent supports the samplesize constraint. ...
... you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). syntax samplesizeconstraintsupported = supportedconstraintsdictionary.samplesize; value this property is present in the dictionary (and its value is always true) if the user agent supports the samplesize constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. ...
...orts the samplesize constraint. if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().samplesize) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'samplesize' in that specification. candidate recommendation initial specification. ...
Node.isSupported() - Web APIs
Web › API › Node › isSupported
the node.issupported()returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node. syntax boolvalue = element.issupported(feature, version) parameters feature is a domstring containing the name of the feature to test. this is the same name which can be passed to the method hasfeature on domimplementation. possible values defined within the core dom specification are listed on the dom level 2 conformance section. version is a domstring containing the version number of the feature to test. in dom level 2, version 1, this is the string 2.0. if the version is not specified, supporting any version of the feature will cause the method to return true. example <div id="doc"> </div...
... core dom specification are listed on the dom level 2 conformance section. version is a domstring containing the version number of the feature to test. in dom level 2, version 1, this is the string 2.0. if the version is not specified, supporting any version of the feature will cause the method to return true. example <div id="doc"> </div> <script> // get an element and check to see if its supports the dom2 html module. var main = document.getelementbyid('doc'); var output = main.issupported('html', '2.0'); </script> specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.issupported()' in that specification. obsolete no change from document object model (dom) level 2 core specifica...
...pported('html', '2.0'); </script> specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.issupported()' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core specificationthe definition of 'node.issupported()' in that specification. obsolete initial definition. ...
StorageQuota.supportedTypes - Web APIs
obsolete initial definition. ...
... obsolete initial definition. ...
... obsolete initial definition. ...
415 Unsupported Media Type - HTTP
Web › HTTP › Status › 415
the http 415 unsupported media type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. the format problem might be due to the request's indicated content-type or content-encoding, or as a result of inspecting the data directly. ...
... the http 415 unsupported media type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. the format problem might be due to the request's indicated content-type or content-encoding, or as a result of inspecting the data directly. ...
...error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. the format problem might be due to the request's indicated content-type or content-encoding, or as a result of inspecting the data directly. ...
505 HTTP Version Not Supported - HTTP
Web › HTTP › Status › 505
the hypertext transfer protocol (http) 505 http version not supported response status code indicates that the http version used in the request is not supported by the server. ...
... the hypertext transfer protocol (http) 505 http version not supported response status code indicates that the http version used in the request is not supported by the server. ...
... the hypertext transfer protocol (http) 505 http version not supported response status code indicates that the http version used in the request is not supported by the server. ...
Handling media support issues in web content - Web media technologies
and with a variety of capabilities. the availability of choices is good for the user, in that they can choose the format that suits their needs best. there is a drawback, however: because there are so many to choose from, with so many different kinds of licenses and design principles involved, each web browser developer is left to its own devices when deciding which media file types and codecs to support. this places a small, but reasonably easily overcome, burden on the web developer: to properly handle the situation when the user's browser can't handle a particular type of media. this guide covers techniques you can use to develop web content that meets your media needs while providing the most broadly compatible experience possible. topics we will examine fallbacks, baseline media formats...
...s 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. we'll look at both of these scenarios and how to implement them. poster frames for video progressive images images—whether embedded using <img> or <picture>—don't support a concept similar to poster frames. however, there are ways to present an image in low quality while it's still loading. this requires creating your images using progressive formats, such as progressive jpeg or interlaced png. once your image has been converted to progressive form, you can simply use it as usual. <img src="/images/stafff-photo-huge-progressive.jpg" alt="staff photo, ta...
...s it loads—or after it's finished loading—to present it in full quality. note: progressive (or interlaced) images are inherently slightly larger than the non-progressive versions of the same images. whether the interlacing will benefit your users is up to you to determine. specifying multiple sources checking compatibility in javascript htmlmediaelement.canplaytype and mediasource.istypesupported... detecting playback errors adapting presentation with css memory management ...
Supporting per-window private browsing - Archive of obsolete content
"last-pb-context-exited", false); preventing a private session from ending if there are unfinished transactions involving private data, where the transactions will be terminated by the ending of a private session, an add-on can vote to prevent the session from ending (prompting the user is recommended). ...
...pting the user is recommended). to do this, observe the last-pb-context-exiting notification and set the data field of the nsisupportsprbool subject to true. ...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
relationtype optional the value that specifies the relationship status. remarks the synchronous work item is typically the callback function for the asynchronous operation. this function may be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. ...
...clude: debug.ms_async_callback_status_assign_delegate debug.ms_async_callback_status_join debug.ms_async_callback_status_chooseany debug.ms_async_callback_status_cancel debug.ms_async_callback_status_error for more information, see debug constants. note: some debugging tools do not display the information sent to the debugger by this function. requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows phone 8.1). not 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. not supported in windows 8. ...
nsIEditorIMESupport
editor/idl/nsieditorimesupport.idlscriptable please add a summary to this article. ...
... editor/idl/nsieditorimesupport.idlscriptable please add a summary to this article. ...
nsIEditorMailSupport
editor/idl/nsieditormailsupport.idlscriptable provides simple editing actions for the thunderbird mail editor. inherits from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document. nsisupportsarray getembeddedobjects(); parameters none. r...
...hquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document. nsisupportsarray getembeddedobjects(); parameters none. return value an nsisupportsarray containing the img and object tags of the current document. insertascitedquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any), including, if possible, a "cite" attribute. nsidomnode insertascitedquotation( in astring aquotedtext, in astring acitation, in boolean ainserthtml ); parameters aquotedte...
nsISupports
last changed in gecko 1.0 method overview nsrefcnt addref();violates the xpcom interface guidelines void queryinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); nsrefcnt release();violates the xpcom interface guidelines methods violates the xpcom interface guidelines addref() notifies the object that an interface pointer has been duplicated. nsrefcnt addref(); parameters none. return value an integer value that is generally ignored. queryinterface() the queryinterface method provides runtime type discovery. ...
...rameters none. return value an integer value that is generally ignored. remarks the method descriptions above were taken from essential com by don box. the point of those descriptions is to highlight the fact that addref() and release() do not necessarily correspond to incrementing and decrementing a counter, respectively, even though that is how they are usually implemented. on win32 systems, nsisupports is abi-compatible with microsoft com's iunknown interface. ...
nsISupportsPriority
an implementation of this interface is free to define the side-effects of changing the priority of an object. in some cases, changing the priority of an object may be disallowed (resulting in an exception being thrown) or may simply be ignored. ...
...an implementation of this interface is free to define the side-effects of changing the priority of an object. in some cases, changing the priority of an object may be disallowed (resulting in an exception being thrown) or may simply be ignored. ...
nsISupportsVoid
native code only! methods tostring() string tostring(); parameters none. return value a string valued representation of the object. ...
...native code only! methods tostring() string tostring(); parameters none. return value a string valued representation of the object. ...
nsISupportsWeakReference
xpcom/base/nsiweakreference.idlscriptable this interface is a factory interface, which produces appropriate instances of nsiweakreference. weak references in this scheme can only be produced for objects that implement this interface. inherits from: nsisupports last changed in gecko 1.7 method overview nsiweakreference getweakreference(); methods getweakreference() produces an appropriate instance of nsiweakreference. nsiweakreference getweakreference(); parameters none. return value the resulting nsiweakreference instance. remarks the xpcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference. this interface was frozen for gecko 0.9.9. see bug 48726 for details. from gecko 2.0 interfaces are no longe...
...reference. nsiweakreference getweakreference(); parameters none. return value the resulting nsiweakreference instance. remarks the xpcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference. ...
LDAP Support
it is not intended as an introduction to ldap and mozilla products. it assumes you are already familiar with configuring preferences for deployed builds in addition to setting up thunderbird to use an ldap directory. it should be noted that all of this information applies to both thunderbird and the seamonkey application suite. mail compose typedown in mail compose, when typing a partial mail address, a typedown window appears listing possible matches against address books and ldap directories. ...
...see bug #119291 for more details. original document information author(s): scott macgregor copyright information: portions of this content are © 1998–2010 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Document.queryCommandSupported() - Web APIs
the document.querycommandsupported() method reports whether or not the specified editor command is supported by the browser. syntax issupported = document.querycommandsupported(command); parameters command the command for which to determine support. return value returns a boolean which is true if the command is supported and false if the command isn't. ...
...ommand); parameters command the command for which to determine support. return value returns a boolean which is true if the command is supported and false if the command isn't. ...
File and Directory Entries API support in Firefox - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the original file system api was created to let browsers implement support for accessing a sandboxed virtual file system on the user's storage device. work to standardize the specification was abandoned back in 2012, but by that point, google chrome included its own implementation of the api. over time, a number of popular sites and web applications came to use it, often without providing any means of falling back to standard apis or even checking to be sure the api is available before using it. mozi...
...try or filesystemdirectoryentry for files dropped on a drop zone. you can't use the localfilesystem.requestfilesystem() method to get access to a specified local file system. the localfilesystem.resolvelocalfilesystemurl() method isn't implemented. only the asynchronous versions of the interfaces are implemented. any interfaces with names that end in "sync" aren't available. firefox only supports reading from files in the file system. you can't write to them. in particular, the filesystemfileentry.createwriter() method, used to create a filewriter to handle writing to a file, is not implemented and will just treturn an error. firefox doesn't support the "filesystem:" url scheme. ...
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options. syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options. this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. this message can be used to explain to the user why they cannot submit their paymen...
... list. this message can be used to explain to the user why they cannot submit their payment as currently specified—whether that's because the selected products cannot be shipped to their region or because their address is not served by any of the shipping companies you use. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate.error' in that specification. candidate recommendation initial definition. ...
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
for each property in paymentaddress, a property by the same name is found in shippingaddresserrors if and only if a validation error occurred for that property. in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error. ...
... candidate recommendation initial definition. ...
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
currently, this can be: "ldr": low dynamic range. "hdr": high dynamic range. dynamic range refers to ratio between the brightest and darkest parts of the scene. low dynamic ranges are for example jpeg format images which won't exceed 255:1, or crt monitors which won't exceed 100:1. an hdr image stores pixel values that span the whole tonal range of real-world scenes (100,000:1). ...
...dynamic range. dynamic range refers to ratio between the brightest and darkest parts of the scene. low dynamic ranges are for example jpeg format images which won't exceed 255:1, or crt monitors which won't exceed 100:1. an hdr image stores pixel values that span the whole tonal range of real-world scenes (100,000:1). examples var ext = gl.getextension('webgl_compressed_texture_astc'); ext.getsupportedprofiles(); // ["ldr"] specifications specification status comment webgl_compressed_texture_astcthe definition of 'webgl_compressed_texture_astc' in that specification. recommendation initial definition. ...
WAI ARIA Live Regions/API Support - Developer guides
these notes are for developers of screen readers. developers should use the aria live regions developer documentation. firefox 3 contains important improvements to the way the mozilla engine exposes live changes in a document. these features will help screen reader developers improve the quality and performance of live region support, both for pages that are marked up with aria live region markup, and for pages where the author did not add any additional markup. please read the aria spec or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. events fired for web page mutations what changed in document? atk/at-spi event iaccessible2 event object about to be hidden or remov...
... text) text replaced text_changed::delete followed immediately by text_changed::insert ia2_event_text_removed followed immediately by ia2_event_text_inserted * we do not use msaa's create/destroy at the request of screen reader vendors, who avoid those events because they cause crashes on some important system -- show/hide are the equivalent of those events. ...
<msubsup> - MathML
the mathml <msubsup> element is used to attach both a subscript and a superscript, together, to an expression. it uses the following syntax: <msubsup> base subscript superscript </msubsup>. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. subscriptshift the minimum space by which to shift the subscript below the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. superscriptshift the minimum space by which to shift the superscript above the baseline of the expression, as a length value. this at...
...ession, as a length value. this attribute is deprecated and will be removed in the future. superscriptshift the minimum space by which to shift the superscript above the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. examples sample rendering: rendering in your browser: ∫ 0 1 <math displaystyle="true"> <msubsup> <mo> &#x222b;<!--integral --> </mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> </math> specifications specification status comment mathml 3.0the definition of 'msubsup' in that specification. recommendation current specification mathml 2.0the definition of 'msubsup' in that specification. recommendation initial specification ...
<msup> - MathML
Web › MathML › Element › msup
the mathml <msup> element is used to attach a superscript to an expression. it uses the following syntax: <msup> base superscript </msup>. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. superscriptshift the minimum space by which to shift the superscript up from the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...ou can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. superscriptshift the minimum space by which to shift the superscript up from the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. examples sample rendering: rendering in your browser: x 2 <math> <msup> <mi>x</mi> <mn>2</mn> </msup> </math> specifications specification status comment mathml 3.0the definition of 'msup' in that specification. recommendation current specification mathml 2.0the definition of 'msup' in that specification. recommendation initial specification ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svg 2 is the next major version of the svg standard, which is a complete rework of the svg 1.2 draft. version 2 contains a lot of changes regarding the last stable version svg 1.1. those changes are listed below including their support status within mozilla applications. general change notes length attribute and indexed property for list interfaces implementation status unknown <script> element in content model of all elements implementation status unknown initialize(), appenditem(), replaceitem(), and insertitembefore() on list objects making a copy of any list item being inserted that is already in another list implementation status unknown crossorigin attribute for <image> and <script> elements not implemented ye...
...mentation status unknown context-fill and context-stroke paint values implemented (bug 719286 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) and bug 798843 (firefox 26.0 / thunderbird 26.0 / seamonkey 2.23)) child keyword for <paint> values and marker properties implementation status unknown vector-effect property only none and non-scaling-stroke values are supported (bug 528332 (firefox 15 / thunderbird 15 / seamonkey 2.12), bug 1318208) arcs value for stroke-linejoin not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute implemented (bug 879659) svgpaint removed implementation status unknown fill and stroke taking multiple paints implementation status unknown z-in...
xml:base support in old browsers - Archive of obsolete content
note however, that this code is not based on a thorough examination of the specs related to forming base uris and could well have a number of errors. however, it is working in some of the cases tested. ...
suppressonselect - Archive of obsolete content
if set to true, the select event is never fired. ...
suppressOnSelect - Archive of obsolete content
« xul reference suppressonselect type: boolean gets and sets the value of the suppressonselect attribute. ...
ECMAScript 5 support in Mozilla - Archive of obsolete content
ecmascript 5.1, an older version of the standard upon which javascript is based, was approved in june 2011. the javascript runtime used in the latest versions of mozilla projects including both firefox and thunderbird has full support for ecmascript 5.1 features. this article covers the features supported by different versions of mozilla's javascript runtime. supported features added in javascript 1.8.5 (gecko 2, firefox 4 and later) firefox 4 has full ecmascript 5 support including the object.* methods and strict mode. see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. gecko 1.9.1.4 updated the implementation of json.stringi...
Character sets supported by Gecko - Gecko Redirect 1
in gecko-internal apis, it is necessary to use particular (potentially) mixed-case names for the encodings. for encodings that have a compatibility name in the dom standard, except gbk, this is the compatibilty name. for other encodings, including gbk, this is the lower-case name from the encoding standard. ...
Script-supporting element - MDN Web Docs Glossary: Definitions of Web-related terms
in an html document, script-supporting elements are those elements that don't directly contribute to the appearance or layout of the page; instead, they're either scripts or contain information that's only used by scripts. these elements may be important, but do not affect the displayed page unless the page's scripts explicitly cause them to do so. there are only two script-supporting elements: <script> and <template>. technical reference to learn more, see script-supporting elements in kinds of html content. ...
Supported build targets
page moved to the in-tree documentation: https://firefox-source-docs.mozilla.org/build/buildsystem/supported-configurations.html ...
nsIDispatchSupport
js/src/xpconnect/idl/nsidispatchsupport.idlnot scriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void comvariant2jsval(in comvariantptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscripting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscripting(in voidptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval. void comvariant2jsval( in comvariantptr comvar, out jsval val ); parameters comvar the com variant t...
nsISupportsCString
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsChar
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsDouble
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsFloat
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsID
methods tostring() this method returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsInterfacePointer
dataiid nsidptr stores an iid corresponding to the data attribute. methods tostring() returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRBool
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt16
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt32
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRInt64
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRTime
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint16
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint32
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint64
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsPRUint8
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsISupportsString
methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. see bug 166426 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsIWebappsSupport
void installapplication( in wstring title, in wstring uri, in wstring iconuri, in wstring icondata ); parameters title the user-friendly name of the application. uri the uri of the web application. iconuri the uri of icon of the web application. ...
Supporting both TouchEvent and MouseEvent - Web APIs
ideally, a touch-based application does not need to explicitly address mouse input. ...
:-moz-suppressed - CSS: Cascading Style Sheets
the :-moz-suppressed css pseudo-class is a mozilla extension that matches elements representing images that were suppressed because loading images from the specified site has been blocked. note: this selector is mainly intended to be used by theme developers. syntax :-moz-suppressed examples styling elements that have been blocked :-moz-suppressed { background: yellow; padding: 8px; } specifications not part of any standard. ...
Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ - HTTP
to correct this problem on the client side, simply ensure that the credentials flag's value is false when issuing your cors request. if the request is being issued using xmlhttprequest, make sure you're not setting withcredentials to true. if using server-sent events, make sure eventsource.withcredentials is false (it's the default value). if using the fetch api, make sure request.credentials is "omit". ...
Index - Web APIs
Web › API › Index
, start undefined. 121 audioconfiguration api, audio, audioconfiguration, experimental, interface, media capabilities api, reference, video the audioconfiguration dictionary of the media capabilities api defines the audio file being tested when calling mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient. 122 audiocontext api, audio, audiocontext, interface, reference, web audio api, sound the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode. 123 audiocontext() audio, audio context, audio graph, audiocontext, constructor, context, media, m...
...nabled or disabled, for example by changing the track's enabled property. 201 audiotracklist: removetrack event event the removetrack event is fired when a track is removed from an audiotracklist. 202 audioworklet api, audio, audioworklet, experimental, interface, reference, web audio api, worklet the audioworklet interface of the web audio api is used to supply custom audio processing scripts. user-supplied code is run in the audioworkletglobalscope global execution context in a separate web audio rendering thread along with other nodes, allowing for zero-latency audio processing. 203 audioworkletglobalscope api, audioworkletglobalscope, experimental, interface, reference, web audio api the audioworkletglobalscope interface of th...
...in the audioworkletglobalscope global execution context in a separate web audio rendering thread along with other nodes, allowing for zero-latency audio processing. 203 audioworkletglobalscope api, audioworkletglobalscope, experimental, interface, reference, web audio api the audioworkletglobalscope interface of the web audio api represents a global execution context for user-supplied code, which defines custom audioworkletprocessor-derived classes. each baseaudiocontext has a single audioworklet available under the audioworklet property, which runs its code in a single audioworkletglobalscope. 204 audioworkletglobalscope.registerprocessor api, audio, audioworkletglobalscope, audioworkletprocessor, method, reference, web audio api the registerprocesso...
...And 225 more matches
IDBObjectStore - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 164 more matches
Fullscreen API - Web APIs
ts) in full-screen mode, and to exit full-screen mode once it is no longer needed. this makes it possible to present desired content—such as an online game—using the user's entire screen, removing all browser user interface elements and other applications from the screen until full-screen mode is shut off. see the article guide to the fullscreen api for details on how to use the api. note: support for this api varies somewhat across browsers, with many requiring vendor prefixes and/or not implementing the latest specification. see the browser compatibility section below for details on support for this api. you may wish to consider using a library such as fscreen for vendor agnostic access to the fullscreen api. interfaces the fullscreen api has no interfaces of its own. instead, it ...
...reen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's ui elements as well as all other applications from the screen. returns a promise which is resolved once full-screen mode has been activated. properties the document interface provides properties that can be used to determine if full-screen mode is supported and available, and if full-screen mode is currently active, which element is using the screen. documentorshadowroot.fullscreenelement the fullscreenelement property tells you the element that's currently being displayed in full-screen mode on the dom (or shadow dom). if this is null, the document is not in full-screen mode. document.fullscreenenabled the fullscreenenabled property tel...
... being displayed in full-screen mode on the dom (or shadow dom). if this is null, the document is not in full-screen mode. document.fullscreenenabled the fullscreenenabled property tells you whether or not it is possible to engage full-screen mode. this is false if full-screen mode is not available for any reason (such as the "fullscreen" feature not being allowed, or full-screen mode not being supported). event handlers the fullscreen api defines two events which can be used to detect when full-screen mode is turned on and off, as well as when errors occur during the process of changing between full-screen and windowed modes. event handlers for these events are available on the document and element interfaces. note: these event handler properties are not available as html content attr...
...And 114 more matches
Selection API - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 114 more matches
BluetoothCharacteristicProperties - Web APIs
that is true if reliable writes to the characteristic descriptor is permitted. writeread only returns a boolean that is true if the writing to the characteristic with response is permitted. writewithoutresponseread only returns a boolean that is true if the writing to the characteristic without response is permitted. examples the following example shows how tell if a gatt characteristic supports value change notifications. let device = await navigator.bluetooth.requestdevice({ filters: [{services: ['heart_rate']}] }); let gatt = await device.gatt.connect(); let service = await gatt.getprimaryservice('heart_rate'); let characteristic = await service.getcharacteristic('heart_rate_measurement'); if (characteristic.properties.notify) { characteristics.addeventlistener('characterist...
...page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbluetoothcharacteristicproperties experimentalchrome full support 56notes full support 56notes notes chromeos and macos only. full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. ...
...And 106 more matches
IDBIndex - Web APIs
Web › API › IDBIndex
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 99 more matches
Index - Archive of obsolete content
software. or perhaps you're just curious about the history of an obsolete feature or api, and how it worked. 2 .htaccess ( hypertext access ) 301 redirect, cache control, custom error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. 3 2015 mdn fellowship program 2015, archive, fellowship no summary! 4 api api, archive archived documentation about obsolete web standards apis. 5 navigator api, navigator features that used to hang off the navigator interface, but have since been removed. 6 navigator.moznotification api, d...
...ram 2015, archive, fellowship no summary! 4 api api, archive archived documentation about obsolete web standards apis. 5 navigator api, navigator features that used to hang off the navigator interface, but have since been removed. 6 navigator.moznotification api, deprecated, mobile, non-standard, property, reference provides support for creating notification objects, which are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. 7 window: deviceproximity event sensors, events the deviceproximity event is fired when fresh data is available from a proximity sensor. 8 window:...
...ibute to the add-on sdk. 27 modules add-ons, extensions a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface. the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them. unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. we will show how to do each of these things using the built-in components object provided by xulrunner application such as firefox and thunderbird. 28 private properties people have come up with several ways to emulate private p...
...And 94 more matches
Web video codec guide - Web media technologies
k. this guide introduces the video codecs you're most likely to encounter or consider using on the web, summaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video. common codecs the following video codecs are those which are most commonly used on the web. ...
... following video codecs are those which are most commonly used on the web. for each codec, the containers (file types) that can support them are also listed. each codec provides a link to a section below which offers additional details about the codec, including specific capabilities and compatibility issues you may need to be aware of. ...
...dia video 1 (av1) codec is an open format designed by the alliance for open media specifically for internet video. it achieves higher data compression rates than vp9 and h.265/hevc, and as much as 50% higher rates than avc. av1 is fully royalty-free and is designed for use by both the <video> element and by webrtc. av1 currently offers three profiles: main, high, and professional with increasing support for color depths and chroma subsampling. in addition, a series of levels are specified, each defining limits on a range of attributes of the video. these attributes include frame dimensions, image area in pixels, display and decode rates, average and maximum bit rates, and limits on the number of tiles and tile columns used in the encoding/decoding process. for example, level av1 level 2.0 o...
...And 93 more matches
Web audio codec guide - Web media technologies
encode and decode it is handled by an audio codec (coder/decoder). in this article, we look at audio codecs used on the web to compress and decompress audio, what their capabilities and use cases are, and offer guidance when choosing audio codecs to use for your content. additionally, webrtc implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. see codecs used by webrtc for details. for information about the fundamental concepts behind how digital audio works, see the article digital audio concepts. common codecs the list below denotes the codecs most commonly used on the ...
...timal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. see codecs used by webrtc for details. for information about the fundamental concepts behind how digital audio works, see the article digital audio concepts. common codecs the list below denotes the codecs most commonly used on the web and which containers (file types) support them. if all you need to know is which codecs are even possible to use, this is for you. of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well. in addition, browsers may choose to support additional codecs not included on this list. codec name (short) full codec name contai...
... them. if all you need to know is which codecs are even possible to use, this is for you. of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well. in addition, browsers may choose to support additional codecs not included on this list. ...
...And 78 more matches
@font-feature-values - CSS: Cascading Style Sheets
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet@font-feature-valueschrome no support noedge no support nofirefox full support 34 full support 34 full support 24disabled disabled from version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). to change preferences in firefox, visit a...
...nofirefox full support 34 full support 34 full support 24disabled disabled from version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
...And 76 more matches
Implementation Status - Archive of obsolete content
mozilla xforms is not actively maintained any more since about 2010! limitations and extensions the extension has some limitations and custom extension to the xforms 1.1 specification. these can be found on the mozilla xforms specials page. specification chapter index here we give an overview of xforms 1.1 specification chapters and the current status of the mozilla support. ...
...y maintained any more since about 2010! limitations and extensions the extension has some limitations and custom extension to the xforms 1.1 specification. these can be found on the mozilla xforms specials page. specification chapter index here we give an overview of xforms 1.1 specification chapters and the current status of the mozilla support. ...
...re since about 2010! ...
...And 75 more matches
JavaScript modules - JavaScript
anisms for splitting javascript programs up into separate modules that can be imported when needed. node.js has had this ability for a long time, and there are a number of javascript libraries and frameworks that enable module usage (for example, other commonjs and amd-based module systems like requirejs, and more recently webpack and babel). ...
...ke requirejs, and more recently webpack and babel). the good news is that modern browsers have started to support module functionality natively, and this is what this article is all about. this can only be a good thing — browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side processing and extra round trips. ...
...d to support module functionality natively, and this is what this article is all about. this can only be a good thing — browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side processing and extra round trips. ...
...And 75 more matches
Choosing the right approach - Learn web development
you can just use a single .catch() block to handle the errors for the entire chain. async callbacks just aren't very graceful. promise callbacks are always called in the strict order they are placed in the event queue; async callbacks aren't. async callbacks lose full control of how the function will be executed when passed to a third-party library. browser compatibility really good general support, although the exact support for callbacks in apis depends on the particular api. refer to the reference documentation for the api you're using for more specific support info. further information introducing asynchronous javascript, in particular async callbacks settimeout() settimeout() is a method that allows you to run a function after an arbitrary amount of time has passed. usefu...
......
...ime interval constant between executions regardless of how long the code takes to execute, and you won't get errors. ...
...And 74 more matches
BasicCardResponse - Web APIs
examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. ...
...one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
...e payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
...And 66 more matches
BluetoothRemoteGATTDescriptor - Web APIs
805f9b34fb' for theclient characteristic configuration descriptor. bluetoothremotegattdescriptor.valueread only returns the currently cached descriptor value. this value gets updated when the value of the descriptor is read. methods bluetoothremotegattdescriptor.readvalue() returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattdescriptor.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. specifications specification status comment web bluetooththe definition of 'bluetoothremotegattdescriptor' in that specification. draft initial definition. browser compatibility the compat...
...his page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbluetoothremotegattdescriptor experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...And 65 more matches
IDBDatabase - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 65 more matches
Permissions - Web APIs
the permissions interface of the permissions api provides the core permission api functionality, such as methods for querying and revoking permissions methods permissions.query() returns the user permission status for a given api. permissions.request() requests permission to use a given api. this is not currently supported in any browser. permissions.requestall() requests permission to use a given set of apis. this is not currently supported in any browser. permissions.revoke() revokes the permission currently set on a given api. example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showlocalnewswithgeolocation(); } else if (result.state === 'prompt') { showbuttontoenablelocalnews(); } // don't do a...
... if (result.state === 'granted') { showlocalnewswithgeolocation(); } else if (result.state === 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied. }); specification specification status comment permissionsthe definition of 'permissions' in that specification. working draft initial definition. browser support the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpermissionschrome f...
... the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 65 more matches
IDBTransaction - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 61 more matches
Index
Mozilla › Tech › XPCOM › Index
gecko is created. if the component uses only "frozen" xpcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example). the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example). 6 creating a python xpcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom. 7 ...
...to 2.0. 98 xpcom guide add-ons, extensions, guide, landing, mozilla, xpcom these articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like. 99 avoiding leaks in javascript xpcom components add-ons, developing mozilla, extensions, mozilla, needsupdate, obsolete, xpcom, xpcom:language bindings, xpconnect programmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a number of common javascript patterns that cause leaks. 100 ...
...r it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general. 108 resources guide, xpcom this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer. 109 setting up the gecko sdk needsupdate, tutorial, xpcom this chapter provides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial. the following four sections tell the developer how to download and organize the gecko sdk and create a new project in which components like weblock can be created. 110 starting weblock xpcom in this chapter...
...And 59 more matches
MathML Torture Test
its</option> </select> <br/> </p> <table> <tr> <td></td> <th scope="col">as rendered by tex</th> <th scope="col">as rendered by your browser</th></tr> <tr> <td>1</td> <td><img src="https://udn.realityripple.com/samples/45/d5a0dbbca3.png" width="38" height="22" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </math> </td></tr> <tr> <td>2</td> <td><img src="https://udn.realityripple.com/samples/b8/da4a50ea34.png" width="30" height="17" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <!-- ...
... <mn>2</mn><none/> </mmultiscripts> </mrow> </math> </td></tr> <tr> <td>3</td> <td><img src="https://udn.realityripple.com/samples/8a/1d0e6e073c.png" width="58" height="47" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> <mfrac> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </mrow> </math> </td></tr> <tr> <td>4</td> <td><img src="https://udn.realityripple.com/samples/a7/27acbeabcf.png" width="76" height="25" alt="t...
...mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </mrow> </math> </td></tr> <tr> <td>4</td> <td><img src="https://udn.realityripple.com/samples/a7/27acbeabcf.png" width="76" height="25" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> <mfrac> <mn>2</mn> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </msup> </mrow> </math> </td></tr> <tr> <td>5</td> <td><img src="https://udn.realityripple.com/samples/d2/921226dd85.png" width="30" height="42" alt=...
...And 54 more matches
min-width - CSS: Cascading Style Sheets
Web › CSS › min-width
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 50 more matches
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
ment for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and closing tags. ...
...the non-deprecated values are available in ios 5 and later. ...
...lity the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettextareachrome full support yesedge full support 12firefox full support yesnotes full support yesnotes notes before firefox 6, when a <textarea> was focused, the insertion point was placed at the end of the text by default. other major browsers place the ins...
...And 50 more matches
Index
found 353 pages: # page tags and summary 1 network security services jss, nss, needsmigration network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. 2 an overview of nss internals api, intermediate, intro, nss, tools a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowada...
... software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules...
...txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to initialize nss with the required parameters (such as a database), and nss will then transparently manage the database files. most of the time certificates and keys are supposed to be stored in the nss database. therefore, after initial import or creation, the programmer usually doesn't deal with their raw bytes. instead, the programmer will use lookup functions, and nss will provide an access handle that will be subsequently used by the application's code. those handles are reference counted. nss will usually create an in-memory (ram) presentation of certificates, ...
...And 48 more matches
Gecko info for Windows accessibility vendors
this faq explains how makers of windows screen readers, voice dictation packages and magnification software can support gecko-based software. the base of our support for these products is msaa (microsoft active accessibility), external readonly dom support, and the keyboard api/user interface. definitions here are some basic definitions that you'll need for this document to make sense: gecko: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. gecko is the internal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading style sheets (css) and the document object model (dom). microsoft active accessibility (msaa) an api devised by microsoft so that acce...
...if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i recommend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. ...
...dom node, or vice-versa, queryservice() will return null. anything that is focusable or conveys important information about the structure of the document is exposed in the msaa tree of iaccessibles. windows applications based on the gecko layout engine gecko is a rendering engine that mozilla, netscape and other new browsers use. ...
...And 47 more matches
Starting WebLock
m is a good way for objects to pass messages to each other without the objects having explicit knowledge of one another. usually, there is one object notifying a group of observers. for example, an object may be created and have its observe method called at startup, or it may register to be notified prior to xpcom shutdown. the method at the core of this interface is observe: void observe(in nsisupports asubject, in string atopic, in wstring adata); there aren't really any restrictions on what the three parameters (asubject, atopic and adata) may represent. these parameters are defined according to the event being observed. for example, in the case of the xpcom shutdown observation, asubject and adata are not defined, and atopic is defined as the string "xpcom-sh...
... a generic interface for passing messages between two or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is built into xpcom. the implementation of the nsiobserver interface in the weblock component is similar to the implementation for the nsifactory interface. ...
...or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is built into xpcom. the implementation of the nsiobserver interface in the weblock component is similar to the implementation for the nsifactory interface. ...
...And 45 more matches
max-width - CSS: Cascading Style Sheets
Web › CSS › max-width
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 40 more matches
Media container formats (file types) - Web media technologies
as well as their benefits, limitations, and ideal use cases. webrtc does not use a container at all. instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track. see codecs used by webrtc for information about codecs commonly used for making webrtc calls, as well as browser compatibility information around codec support in webrtc. common container formats while there are a vast number of media container formats, the ones listed below are the ones you are most likely to encounter. some support only audio while others support both audio and video. the mime types and extensions for each are listed.the most commonly used containers for media on the web are probably mpeg-4 (mp4), quicktime movie (mov), and the ...
...for example, an ogg file with only an opus audio track is sometimes referred to as an opus file, and might even have the extension .opus. ...
...k encoded using mpeg-1 audio layer iii encoding. these files use the audio/mp3 mime type and the .mp3 extension, even though their containers are just mpeg. index of media container formats (file types) to learn more about a specific container format, find it in this list and click through to the details, which include information about what the container is typically useful for, what codecs it supports, and which browsers support it, among other specifics. codec name (short) full codec name browser compatibility1 3gp third generation partnership firefox for android adts audio data transport stream firefox2 flac free lossless audio codec chrome 56, edge 16, firefox 51, safari 11 mpeg / mpeg-2 moving picture experts...
...And 40 more matches
Guide to the Fullscreen API - Web APIs
ment (checking it prefixed with both moz, ms, or webkit). if it's null, the document is currently in windowed mode, so we need to switch to fullscreen mode. switching to fullscreen mode is done by calling element.requestfullscreen(). if fullscreen mode is already active (fullscreenelement is non-null), we call document.exitfullscreen(). prefixing note: currently, only firefox 64 and chrome 71 supports this unprefixed. for the moment not all browsers are implementing the unprefixed version of the api (for vendor agnostic access to the fullscreen api you can use fscreen). here is the table summarizing the prefixes and name differences between them: standard webkit (safari) / blink (chrome & opera) / edge gecko (firefox) internet explorer document.fullscreen...
...patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 39 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
note: :matches() was renamed to :is() in csswg issue #3258. the :is() css pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list. this is useful for writing large selectors in a more compact form. note that currently browsers support this functionality as :matches(), or through an older, prefixed pseudo-class — :any(), including older versions of chrome, firefox, and safari. :any() works in exactly the same way as :matches()/:is(), except that it requires vendor prefixes and doesn't support complex selectors. /* selects any paragraph inside a header, main or footer element that is being hovered */ :is(header, main, footer) p:hover { color: red; cursor: pointer; } /* the above is equivalen...
...for example, the following css: /* 3-deep (or more)...
... difference between :is() and :where() the diffference between the two is that :is() counts towards the specifi...
...And 38 more matches
MathML Accessibility in Mozilla
this table below provides a list of mathml constructions and how they are read in mozilla applications for various platforms: windows: mathml support is provided by nvda, which actually delegates math reading to the proprietary mathplayer plugin. we started exposing generic accessible objects for mathml in bug 920547 and so these can be retrieved by nvda starting with gecko 27.0 (firefox 27.0 / thunderbird 27.0 / seamonkey 2.24). mozilla and nvda developers essentially do not have control on how mathematical formulas are read, please contact design science for any inquiries. mac: mathml support is provided by voiceover. ...
...ing with gecko 27.0 (firefox 27.0 / thunderbird 27.0 / seamonkey 2.24). mozilla and nvda developers essentially do not have control on how mathematical formulas are read, please contact design science for any inquiries. mac: mathml support is provided by voiceover. in bug 1175269 and bug 1001641, we relied on the webkit's nsaccessibility mathml tree to expose the main constructions. hence basic support is available in gecko 41.0 (firefox 41.0 / thunderbird 41.0 / seamonkey 2.38) and we are still trying to keep in sync with webkit/voiceover. note that voiceover is proprietary so we do not have control on improvements to mathml accessibility in voiceover. linux: mathml support is provided by the development version of orca. we try to keep in sync with webkit/atk/orca developments. at the mom...
...the table gives the output in mode "utterance" and description spoken last. note that this is still very experimental. ...
...And 37 more matches
WebAssembly - JavaScript
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 37 more matches
Image file type and format guide - Web media technologies
in this guide, we'll cover the image file types generally supported by web browsers, and provide insights that will help you select the most appropriate formats to use for your site's imagery. common image file types there are many image file formats in the world. however, the ones listed below are generally recognized as usable on the web, though bmp is generally not recommended as browser support is potentially constrained; it should usually be avoided for web content. abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari...
... in the tables below, the term bits per component refers to the number of bits used to represent each color component. for example, an rgb color depth of 8 indicates that each of the red, green,...
... in the tables below, the term bits per component refers to the number of bits used to represent each color component. ...
...And 37 more matches
WebAssembly
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 37 more matches
max-height - CSS: Cascading Style Sheets
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 36 more matches
IDBFactory - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 35 more matches
IDBKeyRange - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 35 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
introduction when netscape started the mozilla browser, it made the conscious decision to support w3c standards. as a result, mozilla is not fully backwards-compatible with netscape navigator 4.x and microsoft internet explorer legacy code; for example, mozilla does not support <layer> as i will discuss later. browsers, like internet explorer 4, that were built before the conception of w3c standards inherited many quirks. in this article, i will describe mozilla's quirks mode, which provides strong backwards html compatibility with internet explorer and other legacy browsers. i'll also cover nonstandard technologies, such as xmlhttprequest and rich text editing, that mozilla does support because no w3c equivalent existed at the time. they include: html 4.01, xhtml 1.0 and xhtml 1...
...lt 1.0 xml path language: xpath 1.0 resource description framework: rdf simple object access protocol: soap 1.1 ecma-262, revision 3 (javascript 1.5): ecma-262 general cross-browser coding tips even though web standards do exist, different browsers behave differently (in fact, the same browser may behave differently depending on the platform). many browsers, such as internet explorer, also support pre-w3c apis and have never added extensive support for the w3c-compliant ones. before i go into the differences between mozilla and internet explorer, i'll cover some basic ways you can make a web application extensible in order to add new browser support later. since different browsers sometimes use different apis for the same functionality, you can often find multiple if() else() blocks ...
...nt browsers sometimes use different apis for the same functionality, you can often find multiple if() else() blocks throughout the code to differentiate between the browsers. the following code shows blocks designated for internet explorer: . . . ...
...And 34 more matches
FileSystemFlags - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemflags experimentalchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie no support noopera no support nosafari no support ...
...And 34 more matches
URLUtilsReadOnly - Web APIs
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 33 more matches
Codecs used by WebRTC - Web media technologies
et users communicate in real time, using audio and/or video as well as optional data and other information. to communicate, the two devices need to be able to agree upon a mutually-understood codec for each track so they can successfully communicate and present the shared media. ...
...ther codecs that some or all browsers support for webrtc. containerless media webrtc uses bare mediastreamtrack objects for each track being shared from one peer to another, without a container or even a mediastream associated with the tracks. which codecs can be within those tracks is not mandated by the webrtc specification. however, rfc 7742 specifies that all webrtc-compatible browsers must support vp8 and h.264's constrained baseline profile for video, and rfc 7874 specifies that browsers must support at least the opus codec as well as g.711's pcma and pcmu formats. these two rfcs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo cancelation. this guide reviews the codecs that browsers are required to implement as well a...
... while compression is always a necessity when dealing with media on the web, it's of additional importance when videoconferencing in order to ensure that the participants are able to communicate without lag or interruptions. ...
...And 31 more matches
Browser Feature Detection - Archive of obsolete content
this article has generally never been more than a way to show off firefox web compatibility, rather than something truly informative in a broader sense. ...
... this article has generally never been more than a way to show off firefox web compatibility, rather than something truly informative in a broader sense. ...
... this article has generally never been more than a way to show off firefox web compatibility, rather than something truly informative in a broader sense. therefore, given that it's also badly out of date, it's been archived. ...
...And 30 more matches
FileSystemEntry - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystementry experimentalchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: entryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie no support noopera no support nosafari full support ...
...And 29 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
practical tips for developers and how mozilla does it contents this document is for developers working to support msaa in an application in order to make it accessible with 3rd party assistive technologies, as well as for hackers wishing to be involved in mozilla's msaa support specifically. if you're implementing controls/widgets, you should also see the accessible toolkit checklist. if you're interested in more about gecko's msaa implementation, read gecko info for windows accessibility vendors to learn how msaa clients can utilize gecko's msaa support. intro: what is msaa? msaa is the microsoft active accessibility (msaa) api, used on windows operating systems to support assistive technologies for users with disabilities. third party assistive technology, such as screen read...
...ing mode, with a variety of features such as ticker mode where text is streamed on a single line. finally, voice dictation software needs to know what's in the current document or ui in order to implement "say what you see" kinds of features. on microsoft windows, these kinds of assistive technology acquire this necessary information via a combination of hacks, msaa and proprietary doms. msaa is supposed to be the "right way" for accessibility aids to get information, but sometimes the hacks are more effective. for example, screen readers look for screen draws of a vertical blinking line, to determine the location of the caret. without doing this, screen readers would not be able to let the user know where there caret has moved to in most programs, because so many applications do not use the...
...he hacks are more effective. for example, screen readers look for screen draws of a vertical blinking line, to determine the location of the caret. without doing this, screen readers would not be able to let the user know where there caret has moved to in most programs, because so many applications do not use the system caret (gecko does not). this is so commonly done, that no one even bothers to support the msaa caret, after all the hack is general solution works with pretty much all applications. msaa provides information in several different ways: a com interface (iaccessible) that allows applications to expose the tree of data nodes that make up each window in the user interface currently being interacted with and custom interface extensions via interfaces via queryinterface and quer...
...And 29 more matches
position - CSS: Cascading Style Sheets
Web › CSS › position
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 29 more matches
Modularization techniques - Archive of obsolete content
s are c++ pure virtual interfaces. a pure virtual interface is simply a class where every method is defined as pure virtual, that is: virtual int foo(int bar) = 0; pure virtual interfaces provide an easy mechanism for passing function tables between modules that may reside in separate, possibly dynamically loaded, libraries. each interface is assigned a unique interface identifier, or iid. nsisupports the key interface in our model is the nsisupports interface, our equivalent to com's iunknown interface. nsisupports provides two key features, interface interrogation and reference counting. interface interrogation is a simple, uniform mechanism for determining which interfaces a object supports, and for hiding the the mechanics of how the object was implemented. interface interrogation i...
... reference counting is performed using the addref() and release() methods. an objects reference count generally starts at zero. addref() increments that reference count, and release() decrements it. ...
...rally free itself. a successful queryinterface() will call addref() on the requested interface before returning. both addref() and release() return the resulting reference count. the convenience macros ns_addref() and ns_release() are preferred over calling addref and release directly. in debug builds, these macros provide useful reference counting logs. use them wherever possible. /* * the nsisupports interface */ class nsisupports { public: ns_imethod queryinterface(const nsiid &aiid, void **aresult) = 0; ns_imethod_(nsrefcnt) addref(void) = 0; ns_imethod_(nsrefcnt) release(void) = 0; }; the ns_imethod and ns_imethod_(type) macros are basically shorthand for virtual nsresult and virtualtype. on windows they expand to virtual nsresult __stdcal...
...And 28 more matches
PushEvent - Web APIs
Web › API › PushEvent
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpushevent experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. ...
...And 28 more matches
font-variant - CSS: Cascading Style Sheets
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 28 more matches
MSGestureEvent - Web APIs
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 27 more matches
Introduction to SSL - Archive of obsolete content
eb for authenticated and encrypted communication between clients and servers. the ssl protocol ciphers used with ssl the ssl handshake the new internet engineering task force (ietf) standard protocol called transport layer security (tls) is based on ssl. the details of the protocol are available in request for comments (rfc): 2246,the tls protocol version 1.0. some red hat products already support tls. most other red hat products plan to support the protocol in future versions. this document is primarily intended for administrators of red hat server products, but the information it contains may also be useful for developers of applications that support ssl. the document assumes that you are familiar with the basic concepts of public-key cryptography, as summarized in "introduction to ...
...duction to public-key cryptography." the ssl protocol the transmission control protocol/internet protocol (tcp/ip) governs the transport and routing of data over the internet. other protocols, such as the hypertext transport protocol (http), lightweight directory access protocol (ldap), or internet messaging access protocol (imap), run "on top of" tcp/ip in the sense that they all use tcp/ip to support typical application tasks such as displaying web pages or running email servers. the ssl protocol runs above tcp/ip and below higher-level protocols such as http or imap. it uses tcp/ip on behalf of the higher-level protocols, and in the process allows an ssl-enabled server to authenticate itself to an ssl-enabled client, allows the client to authenticate itself to the server, and allows b...
...hake protocol involves using the ssl record protocol to exchange a series of messages between an ssl-enabled server and an ssl-enabled client when they first establish an ssl connection. this exchange of messages is designed to facilitate the following actions: authenticate the server to the client. ...
...And 26 more matches
Handling common JavaScript problems - Learn web development
ie had jscript and also offered vbscript as an option), and while at least javascript and jscript were compatible to some degree (both based on the ecmascript specification), things were often implemented in conflicting, incompatible ways, causing developers many nightmares. such incompatibility problems persisted well into the early 2000s, as old browsers were still being used and still needed supporting. this is one of the main reasons why libraries like jquery came into existence — to abstract away differences in browser implementations (e.g. see the code snippet in how to make an http request) so developers only have to write one simple bit of code (see jquery.ajax()). jquery (or whatever library you are using) will then handle the differences in the background, so you don't have to. ...
...tence — to abstract away differences in browser implementations (e.g. see the code snippet in how to make an http request) so developers only have to write one simple bit of code (see jquery.ajax()). jquery (or whatever library you are using) will then handle the differences in the background, so you don't have to. things have improved significantly since then; modern browsers do a good job of supporting "classic javascript features", and the requirement to use such code has diminished as the requirement to support older browsers has lessened (although bear in mind that they have not gone away altogether). these days, most cross-browser javascript problems are seen: when poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code...
...command installs jshint: npm install -g jshint you can then point these tools at javascript files you want to lint, for example: you can also use these tools with a task runner/build tool such as gulp or webpack to automatically lint your javascript during development. (see using a task runner to automate testing tools in a later article.) see eslint integrations for eslint options; jshint is supported out of the box by grunt, and also has other integrations available, e.g. jshint loader for webpack. note: eslint takes a bit more setup and configuration than jshint, but it is more powerful too. browser developer tools browser developer tools have many useful features for helping to debug javascript. for a start, the javascript console will report errors in your code. make a local co...
...And 25 more matches
Python binding for NSS
nss is an alternative to openssl and used extensively by major software projects. nss is fips-140 certified. nss is built upon nspr because nspr provides an abstraction of common operating system services, particularly in the areas of networking and process management. ...
... and is exposed via the standard python methodology. this documentation is available via the numerous python documentation extraction tools. also see the generated html documentation provided with each release. nss/nspr structs are exposed as python objects. nss/nspr functions which operate on a nss/nspr object (i.e. struct) become methods of that object. nss/nspr objects which are collections support the python iteration protocol. in other words they can be iterated over, indexed by position, or used as slices. nss/nspr objects whose collection elements can be referenced by name support associative indexing. nss/nspr objects which have "get" and "set" api function calls are exposed as python properties. all nss/nspr python objects can print their current value by evaluting the python o...
...the python global interpreter lock (gil) is released prior to calling nss/nspr c functions and reaquired after the nss/nspr c function returns. this allows other python threads to execute during the time a nss/nspr function is progress in another thread. ...
...And 25 more matches
Bytecode Descriptions
expr. emitting the same bytecode for these two expressions would be a bug. per spec, the latter throws a referenceerror if x doesn't exist. format: jof_ic pos stack: val ⇒ (+val) the unary + operator. +val doesn't do any actual math. it just calls tonumber(val). the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always a number. (per spec, unary - supports bigints, but unary + does not.) format: jof_ic neg stack: val ⇒ (-val) the unary - operator. convert val to a numeric value, then push -val. the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always numeric. format: jof_ic bitnot stack: val ⇒ (~val) the bitwise not operator (~). val is converted to an integer, then bitwise negated. the co...
...ormat: jof_elem, jof_checkstrict hasown stack: id, obj ⇒ (obj.hasownproperty(id)) push true if obj has an own property id. note that obj is the top value, like jsop::in. this opcode is not used for normal js. self-hosted code uses it by calling the intrinsic hasown(id, obj). for example, object.prototype.hasownproperty is implemented this way (see js/src/builtin/object.js). ...
...jof_elem, jof_checkstrict hasown stack: id, obj ⇒ (obj.hasownproperty(id)) push true if obj has an own property id. note that obj is the top value, like jsop::in. this opcode is not used for normal js. self-hosted code uses it by calling the intrinsic hasown(id, obj). for example, object.prototype.hasownproperty is implemented this way (see js/src/builtin/object.js). ...
...And 25 more matches
An Overview of XPCOM
ndently of one another. in order to allow interoperability between components within an application, xpcom separates the implementation of a component from the interface, which we discuss in interfaces. ...
...on of these components, services that help the developer write modular cross-platform code, and versioning support, so that components can be replaced or upgraded without breaking or having to recreate the application. using xpcom, developers create components that can be reused in different applications or that can be replaced to change the functionality of existing applications. ...
...() = 0; }; the implementation can then derive from this class and implement the virtual method. clients of this code can then use a factory design pattern to create the object (see factories) and further encapsulate the implementation. in xpcom, clients are shielded from the inner workings of components in this way and rely on the interface to provide access to the needed functionality. ...
...And 25 more matches
nsIMsgFolder
the nsimsgfolder interface is used to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...nd such). ...
...nsimsgwindow msgwindow); void createsubfolder(in astring foldername, in nsimsgwindow msgwindow); nsimsgfolder addsubfolder(in astring foldername); void createstorageifmissing(in nsiurllistener urllistener); void compact(in nsiurllistener alistener, in nsimsgwindow amsgwindow); void compactall(in nsiurllistener alistener, innsimsgwindow amsgwindow,in nsisupportsarray afolderarray, in boolean acompactofflinealso,in nsisupportsarray aofflinefolderarray); void compactallofflinestores(in nsimsgwindow amsgwindow,in nsisupportsarray aofflinefolderarray); void emptytrash(in nsimsgwindow amsgwindow, in nsiurllistener alistener); void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindo...
...And 25 more matches
break-before - CSS: Cascading Style Sheets
of 'break-before' in that specification. working draft initial definition. extends the css 2.1 page-break-before property to handle both page and column breaks. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 25 more matches
CSS3 - Archive of obsolete content
les already became a standard as a w3c recommendation. these should be no more changes. css color module level 3 recommendation since june 7th, 2011 adds the opacity property, and the hsl(), hsla(), rgba() and rgb() functions to create <color> values. it also defines the currentcolor keyword as a valid color. ...
...fines the currentcolor keyword as a valid color. the transparent color is now a real color (thanks to the support for the alpha channel) and is a now an alias for rgba(0,0,0,0.0). it deprecates the system-color keywords that shouldn't be used in a production environment anymore. css namespaces module recommendation since september 29th, 2011 adds the support for the xml namespaces by defining the notion of css qualified name, using the ' | ' syntax and adding the @namespace css at-rule. selectors level 3 recommendation since september 29th, 2011 adds: substring matching attribute selectors, e[attribute^="value"], e[attribute$="value"], e[attribute*="value"] . new pseudo-classes: :target, :enabl...
... only screen and (color) . media queries are not only used in css document but also in some attributes of html elements, like the media attribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media features like hover or pointer. detection of ecmascript support, using the script media features is also proposed. css style attributes recommendation since november 7th, 2013 formally defines the syntax of the content of the html style global attribute. css fonts module level 3 candidate recommendation since september 20th, 2018 amends the css2.1 font matching algorithm to be closer to what is real...
...And 24 more matches
GamepadEvent - Web APIs
; specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification. ...
...t gamepadthe definition of 'gamepadevent' in that specification. ...
...t specification. ...
...And 24 more matches
sslerr.html
re retrieved using the nspr function pr_geterror. in addition to the error codes defined by nspr, pr_geterror retrieves the error codes described in this chapter. ssl error codes sec error codes ssl error codes table 8.1 error codes defined in sslerr.h constant value description ssl_error_export_only_server -12288 "unable to communicate securely. ...
...des defined by nspr, pr_geterror retrieves the error codes described in this chapter. ssl error codes sec error codes ssl error codes table 8.1 error codes defined in sslerr.h constant value description ssl_error_export_only_server -12288 "unable to communicate securely. peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use. the remote system was configured to support only the cipher suites permitted for export use. ssl_error_us_only_server -12287 "unable to communicate securely. peer requires high-grade encryption which is not supported." the remote system was configured to support the cipher suites permitted for domestic use. the local ...
... ssl_error_no_cypher_overlap -12286 "cannot communicate securely with peer: no common encryption algorithm(s)." the local and remote systems share no cipher suites in common. this can be due to a misconfiguration at either end. ...
...And 23 more matches
ByteLengthQueuingStrategy - Web APIs
on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbytelengthqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). to change preferences in firefox, ...
...ox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...And 23 more matches
requiredFeatures - SVG: Scalable Vector Graphics
this provides a way to design svg that gracefully falls back when features aren't available. if the attribute is not present, then its implicit evaluated value is true. ...
...this provides a way to design svg that gracefully falls back when features aren't available. if the attribute is not present, then its implicit evaluated value is true. ...
...ject>, <g>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <use> html, body, svg { height: 100%; } text { fill: white; } <svg viewbox="0 0 250 45" xmlns="http://www.w3.org/2000/svg"> <g> <rect fill="forestgreen" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures not supported</text> </g> </svg> usage notes value <list-of-features> default value true if not defined, false if null or empty string as value animatable no <list-of-features> this is a list o...
...And 23 more matches
Handling common HTML and CSS problems - Learn web development
previous overview: cross browser testing next with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. this includes linting code, handling css prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css ...
...ften developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less performant (generating dom elements is expensive). in other cases, nascent features are not supported consistently across browsers, which can make some features and styles not work for some users. responsive design problems are also common — a site that looks good in a desktop browser might provide a terrible experience on a mobile device, because the content is too small to read, or perhaps the site is slow because of expensive animations. let's go forth and look at how we can reduce cr...
..., in firefox the css inspector will show css declarations that aren't applied crossed out, with a warning triangle. hovering the warning triangle will provide a descriptive error message: other browser devtools have similar features. common cross browser problems now let's move on to look at some of the most common cross browser html and css problems. the main areas we'll look at are lack of support for modern features, and layout issues. older browsers not supporting modern features this is a common problem, especially when you need to support old browsers (such as old ie versions) or you are using features that are implemented using css prefixes. in general, most core html and css functionality (such as basic html elements, css basic colors and text styling) works across most browser...
...And 22 more matches
WebAssembly.Table - JavaScript
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../github.com/mdn/browser-compat-data and send us a pull request. ...
...And 22 more matches
CountQueuingStrategy - Web APIs
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcountqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). to change preferences in firefox, ...
...ox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true). ...
...And 21 more matches
FileReaderSync - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 21 more matches
Capabilities, constraints, and settings - Web APIs
what errors occur, and so forth. the result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. the twin concepts of constraints and capabilities let the browser and web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser. the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's a/v input devices (such as its webcam and microphone...
... settings, and includes an example we call the constraint exerciser. the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's a/v input devices (such as its webcam and microphone). overview the process works like this (using mediastreamtrack as an example): if needed, call mediadevices.getsupportedconstraints() to get the list of supported constraints, which tells you what constrainable properties the browser knows about. this isn't always necessary, since any that aren't known will simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the list. once the script knows whether the property or propert...
...t the list of supported constraints, which tells you what constrainable properties the browser knows about. this isn't always necessary, since any that aren't known will simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the list. once the script knows whether the property or properties it wishes to use are supported, it can then check the capabilities of the api and its implementation by examining the object returned by the track's getcapabilities() method; this object lists each supported constraint and the values or range of values which are supported. finally, the track's applyconstraints() method is called to configure the api as desired by specifying the values or ranges of values it wishes to us...
...And 21 more matches
NavigationPreloadManager - Web APIs
in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rowser-compat-data and send us a pull request. ...
...And 21 more matches
SVGCircleElement - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 21 more matches
WritableStream - Web APIs
eam.close() closes the stream. writablestream.getwriter() returns a new instance of writablestreamdefaultwriter and locks the stream to that instance. while the stream is locked, no other writer can be acquired until this one is released. examples the following example illustrates several features of this interface. it shows the creation of the writablestream with a custom sink and an api-supplied queueing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success o...
...; }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example. backpressure because of how backpressure is supported in the api, its implementation in code may be less than obvious. to see how backpressure is implemented look for three things. the highwatermark property, which is set when creating the counting strategy (line 35), sets the maximum amount of data that the writablestream instance will handle in a single write() operation. in this example, it's the maximum amount of data that can be sent t...
...lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 21 more matches
animation-direction - CSS: Cascading Style Sheets
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 21 more matches
Implementing feature detection - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. ...
... prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. ...
...ity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. the concept of feature detection the idea behind feature detection is that you can run a test to determine whether a feature is supported in the current browser, and then conditionally run code to provide an acceptable experience both in browsers that do support the feature, and browsers that don't. if you don't do this, browsers that don't support the features you are using in your code won't display your sites properly and will just fail, creating a bad user experience. let's recap and look at the example we touched on in ...
...And 20 more matches
sslfnc.html
if you turn this option off, an attempt to establish a connection with a peer that only understands ssl v2 will fail. ssl_enable_tls is a peer of the ssl_enable_ssl2 and ssl_enable_ssl3 options. the ietf standard transport layer security (tls) protocol, rfc 2246, is a modified version of ssl3. it uses the ssl version number 3.1, appearing to be a "minor" revision of ssl 3.0. nss 2.8 supports tls in addition to ssl2 and ssl3. you can think of it as "ssl_enable_ssl3.1". see the description below for more information about this option. ssl_v2_compatible_hello tells the ssl library whether or not to send ssl3 client hello messages in ssl2-compatible format. if set to pr_true, it will; otherwise, it will not. factory setting is on (pr_true). see the description below for...
...sl session. they do not determine which cipher suites are actuallyenabled--that is, turned on and ready to use. to enable or disable a permitted cipher suite, use ssl_cipherprefsetdefault; but bear in mind that ssl_cipherprefsetdefault can't enable any cipher suite that is not explicitly permitted as a result of a call to one of the export policy functions. by default, none of the cipher suites supported by ssl are permitted. the functions nss_setdomesticpolicy, nss_setexportpolicy, and nss_setfrancepolicy permit the use of approved cipher suites for domestic, international, and french versions, respectively, of software products with encryption features. the policy settings permitted by these functions conform with current u.s. export regulations as understood by netscape (for products wit...
...s" as defined by the latest u.s. export regulations) and french import regulations. under some circumstances, you may be required to abide by the terms of an export license that permits more or fewer capabilities than those allowed by these three functions. in such cases, use ssl_cipherpolicyset to explicitly enable those cipher suites you may legally export. for descriptions of cipher suites supported by ssl, see introduction to ssl. applications must call one of the export policy functions before attempting to perform any cryptographic operations: nss_setdomesticpolicy nss_setexportpolicy nss_setfrancepolicy ssl_cipherpolicyset the following function is also described in this section: ssl_cipherpolicyget nss_setdomesticpolicy configures cipher suites to conform with...
...And 20 more matches
NotificationEvent - Web APIs
y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../browser-compat-data and send us a pull request. ...
...And 20 more matches
aspect-ratio - CSS: Cascading Style Sheets
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...heck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 20 more matches
break-after - CSS: Cascading Style Sheets
on of 'break-after' in that specification. working draft initial definition. extends the css 2.1 page-break-after property to handle both page and column breaks. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 20 more matches
CSS property compatibility table for form controls - Learn web development
you may still face strange side effects in certain edge cases. partial while the property works, you may frequently face strange side effects or inconsistencies. you should probably avoid these properties unless you master those side effects first. ...
...you may still face strange side effects in certain edge cases. partial while the property works, you may frequently face strange side effects or inconsistencies. you should probably avoid these properties unless you master those side effects first. ...
...one; appearance: none; /* for internet explorer */ background: none; } compatibility tables global behaviors some behaviors are common to many browsers at a global level: border, background, border-radius, height using one of these properties can partially or fully turn off the native look & feel of widgets on some browsers. be careful when you use them. line-height this property is supported inconsistently across browsers and you should avoid it. text-decoration this property is not supported by opera on form widgets. text-overflow opera, safari, and ie9 do not support this property on form widgets. text-shadow opera does not support text-shadow on form widgets and ie9 does not support it at all. text fields see the text, search, and password input types. pro...
...And 19 more matches
Basics
when you left-click any individual entry, it should toggle between its expanded and unexpanded forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. </p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis"...
... <a class="control" href="javascript:incrementinput('input12', 1);" title="increase input">+</a> <a class="control" href="javascript:incrementinput('input12',-1);" title="decrease input">-</a> <br/> (click these control buttons to see their effects.) </div> <p> each entry of the following matrix represents <math> <msup><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo></mrow><mi>n</mi></msup> </math> for some <i>n</i>. when you left-click any individual entry, it should toggle between its expanded and unexpanded forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. </p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis" columnalign="left left left"> <mtr> <mtd> <maction id="a11" actiontype="toggle"...
... <i>n</i>. when you left-click any individual entry, it should toggle between its expanded and unexpanded forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. ...
...And 19 more matches
Creating the Component Code
registration alternatives a gecko embedding application may provide other ways to register xpcom components. xpinstall, the cross-platform installation technology that mozilla uses to install the browser and other components, is one such alternative. it is described further in packaging weblock. you should consult with the authors of the application you wish to extend to see if there are other supported ways. overview of the weblock module source as we mentioned in the previous section, components have layers. there are three main parts to every xpcom component. from the innermost and moving outward, the first object is the xpcom object. this is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that lis...
...o create an xpcom component. basic structure of the weblock component source weblock1.cpp that defines these classes and the code you need to create a basic component has the following structure: * required includes and constants * weblock: public iweblock * weblockfactory: public nsifactory * weblockmodule: public nsimodule in xpcom, all of these classes also derive from the nsisupports base interface. digging in: required includes and constants let's take a look at the first several lines of code in the component and discuss what they mean in xpcom. the includes and definitions at the top of an xpcom source file can give you an idea about some of the data types and techniques we'll be discussing more in the upcoming chapters. for example, mozilla_strict_api is a variab...
...definitions at the top of an xpcom source file can give you an idea about some of the data types and techniques we'll be discussing more in the upcoming chapters. for example, mozilla_strict_api is a variable that shields you from certain private, non-xpcom headers. for example, including nsicomponentmanager.idl without mozilla_strict_api defined will include the following headers, which are not supported across versions (unfrozen): nscomponentmanagerutils.h nscomponentmanagerobsolete.h these variables are picked up by files that do not specify themselves as mozilla_strict_api. includes and constants in weblock1.cpp #include <stdio.h> // may be defined at the project level // in the makefile #define mozilla_strict_api #include "nsimodule.h" #include "nsifactory.h" #include "nsicom...
...And 19 more matches
customDBHeaders Preference
as going through the creating a custom column guide, i built and used thunderbird-2.0b1 checked-out from cvs with the thunderbird_2_0b1_release tag. there is a high probability that your experience will be different should you use an earlier release. getting started to build upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main view. the data will come from a custom header labeled x-superfluous. setting the preferences although there are various ways to set preferences, i tend to just navigate to the directory where my profile is stored and edit the user.js file with my favorite text editor. in addition to the preference outlined in setting up extension development environment...
... various ways to set preferences, i tend to just navigate to the directory where my profile is stored and edit the user.js file with my favorite text editor. in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.compose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other"); important: please pay careful attention to the case of the mailnews.customdbheaders preference. because comparisons are case-insensitive, all of the custom headers get set to lowercase when the data gets migrated to the m...
...e. because comparisons are case-insensitive, all of the custom headers get set to lowercase when the data gets migrated to the message database. also, it has been brought to my attention that the delimiter has been changed to a space in the latest code. ...
...And 19 more matches
MediaMetadata - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 19 more matches
PasswordCredential - Web APIs
note: this interface is restricted to top-level contexts and cannot be used from an <iframe>. constructor passwordcredential()secure context creates a new passwordcredential object. properties inherits properties from its ancestor, credential. passwordcredential.additionaldata secure context one of a formdata instance, a urlsearchparams instance, or null. ...
... table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 19 more matches
The "codecs" parameter in common media types - Web media technologies
for instance, just describing a video in an mpeg-4 file with the mime type video/mp4 doesn't say anything about what format the actual media within takes. for that reason, the codecs parameter can be added to the mime type describing media content. with it, container-specific information can be provided. ...
... file using the mpeg file type, such as an mp3. video/ogg a video file using the ogg file type. video/mp4 a video file using the mpeg-4 file type. video/quicktime a video file in apple's quicktime format. as noted elsewhere, this format was once commonly used on the web but no longer is, since it required a plugin to use. however, each of these mime types is vague. all of these file types support a variety of codecs, and those codecs may have any number of profiles, levels, and other configuration factors. for this reason, you can add the codecs parameter to the media type. to do so, append a semicolon (;) followed by codecs= and then the string describing the format of the contents of the file. some media types only let you specify the names of the codecs to use, while others allow ...
...ns. you can use the javascript encodeuri() function to encode the parameter list; similarly, you can use decodeuri() to decode a previously encoded parameter list. when the codecs parameter is used, the specified list of codecs must include every codec used for the contents of the file. the list may also contain codecs not present in the file.= codec options by container the containers below support extended codec options in their codecs parameters: 3gp av1 iso bmff mpeg-4 quicktime webm several of the links above go to the same section; that's because those media types are all based on iso base media file format (iso bmff), so they share the same syntax. av1 the syntax of the codecs parameter for av1 is defined the av1 codec iso media file format binding specification, sec...
...And 19 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
b technologies to design and implement anything from a simple text editor to a comprehensive ide - complete with all of the interface widgets that you would find in virtually any major application framework. another benefit of this standards-based approach to ui development is that your application is cross-platform "out of the box". imagine not having to re-write your application 3 times, or not supporting a less popular platform simply because you do not have the resources for parallel development! unlike many other application frameworks, you are not limited to the widget set we provide, nor limited to the "look and feel" of the native os. you can create applications using our framework that either have a native look and feel for each os, or one which is identical on macs, pc's or u...
...s, rss, soap, or other xml-based languages and convert them into a form that you might display in your user interface. the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices. this innovation in browser technology offers small size, speed and industry leading standards support. gecko is the premier cross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and style system, and the code for css-based and html-based layout...
...een designed from the ground up to power a new generation of desktop browsers and browsing devices and to accelerate the growth and development of the next-generation internet. small, fast and standards compliant, gecko is easily embeddable across platforms in browsers, desktop applications and browsing devices and delivers full-functionality browsing to them all. ...
...And 18 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
n used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address). 8 ascii glossary, infrastructure ascii (american standard code for information interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form. since 2007, utf-8 superseded it on the web. 9 atag atag, accessibility, authoring tool accessibility guidelines, glossary atag (authoring tool accessibility guidelines) is a w3c recommendation for building accessible-authoring tools that produce accessible contents. 10 abstraction abstraction, coding, codingscripting, glossary, programming language abstraction in computer prog...
...y, reference the accessibility tree, or accessibility object model (aom), contains accessibility-related information for most html elements. 13 adobe flash adobe, codingscripting, flash, glossary, infrastructure flash is an obsolescent technology developed by adobe for viewing expressive web applications, multimedia content, and streaming media. adobe flash can run from supporting web browsers via a browser plug-in. 14 ajax ajax, codingscripting, glossary, infrastructure, l10n:priority ajax, which initially stood for asynchronous javascript and xml, is a programming practice of building complex, dynamic webpages using a technology known as xmlhttprequest. 15 algorithm codingscripting, glossary an algorithm is a self-containe...
...kernel (based on the android open source project (aosp)) and userspace hardware abstraction layer (hal). 177 google chrome browser, chrome canary, chrome stable, chromium, glossary, webmechanics, google chrome google chrome is a free web browser developed by google. it's based on the chromium open source project. some key differences are described on the chromium wiki. chrome supports its own layout called blink. note that the ios version of chrome uses that platform's webview, not blink. 178 graceful degradation design, glossary, graceful degradation graceful degradation is a design philosophy that centers around trying to build a modern web site/application that will work in the newest browsers, but falls back to an experience that while not as good...
...And 18 more matches
Gecko events
« at apis support page this page offers a list of accessibility-related events supported by gecko. event constants are defined in nsiaccessibleevent interface. event_dom_create an object has been created. is supported: yes event_dom_destroy an object has been destroyed. is supported: yes event_dom_significant_change an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated. ...
...event constants are defined in nsiaccessibleevent interface. event_dom_create an object has been created. is supported: yes event_dom_destroy an object has been destroyed. is supported: yes event_dom_significant_change an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated. ...
...ted: yes event_dom_destroy an object has been destroyed. is supported: yes event_dom_significant_change an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated. ...
...And 18 more matches
Using XPCOM Utilities to Make Things Easier
ucture contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ... }; the important thing to note in the fictitious listing above is that it can support multiple components in a module. modules such as the networking libraries in gecko ("necko") have over 50 components declared in a single nsmodulecomponentinfo array like this. the first entry of the nsmodulecomponentinfo above is the name of the component. though it isn't used that much internally at the present time, this name should be something that meaningfully describes the module. th...
...smodulecomponentinfo structure. #include "nsigenericfactory.h" static const nsmodulecomponentinfo components[] = { { "pretty class name", sample_cid, "@company.com/sample", sampleconstructor } } ns_impl_nsgetmodule(nssamplemodule, components) most of the components in the mozilla browser client use this approach. ...
...most of the components in the mozilla browser client use this approach. common implementation macros every xpcom object implements nsisupports, but writing this implementation over and over is tedious. unless you have very special requirements for managing reference counting or handling interface discovery, theimplementation macros that xpcom provides can be used. instead of implementing the nsisupports yourself, ns_impl_isupports1 can expand to the implementation of addref, release, and queryinterface for any object. ...
...And 18 more matches
WebIDL bindings
at interface's binding go in that namespace. there are various helper objects and utility methods in dom/bindings that are also all in the mozilla::dom namespace and whose headers are all exported into mozilla/dom (placed in $objdir/dist/include by the build process). ...
...ace that's supposed to implement that interface, you need to do the following: if your interface doesn't inherit from any other interfaces, inherit from nswrappercache and hook up the class to the cycle collector so it will trace the wrapper cache properly. note that you may not need to do this if your objects can only be created, never gotten from other objects. if you also inherit from nsisupports, make sure the nsisupports comes before the nswrappercache in your list of parent classes. if your interface does inherit from another interface, just inherit from the c++ type that the other interface corresponds to. if you do need to hook up cycle collection, it will look like this in the common case of also inheriting from nsisupports: // add strong pointers your class holds here. i...
... also inheriting from nsisupports: // add strong pointers your class holds here. if you do, change to using // ns_impl_cycle_collection_wrappercache. ns_impl_cycle_collection_wrappercache_0(myclass) ns_impl_cycle_collecting_addref(myclass) ns_impl_cycle_collecting_release(myclass) ns_interface_map_begin_cycle_collection(myclass) ns_wrappercache_interface_map_entry ns_interface_map_entry(nsisupports) ns_interface_map_end if your class doesn't inherit from a class that implements getparentobject, then add a function of that name that, for a given instance of your class, returns the same object every time (unless you write explicit code that handles your parent object changing by reparenting js wrappers, as nodes do). the idea is that walking the getparentobject chain will eventually g...
...And 18 more matches
AudioBuffer() - Web APIs
buffer(options); parameters inherits parameters from the audionodeoptions dictionary. options options are as follows: length: the size of the audio buffer in sample-frames. to determine the length to use for a specific number of seconds of audio, use numseconds * samplerate. numberofchannels: the number of channels for the buffer. the default is 1, and all user agents are required to support at least 32 channels. samplerate: the sample rate in hz for the buffer. the default is the sample rate of the context used in constructing this object. user agents are required to support sample rates from 8,000 hz to 96,000 hz (but are allowed to go farther outside this range). deprecated parameters context a reference to an audiocontext. this parameter was removed from the spe...
... rangeerror there isn't enough memory available to allocate the buffer. ...
... rangeerror there isn't enough memory available to allocate the buffer. ...
...And 18 more matches
background-size - CSS: Cascading Style Sheets
he compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...heck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 18 more matches
Audio and Video Delivery - Developer guides
ve streams. this article is intended as a starting point for exploring the various delivery mechanisms of web based media and compatibility with popular browsers. the audio and video elements whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. ...
... identify how you want to play/instantiate the media (e.g. ...
...although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. to deliver video and audio, the general workflow is usually something like this: check what format the browser supports via feature detection (usually a choice of two, as stated above). if the browser doesn't support playback of any of the provided formats natively, either present a still image or use a fallback technology to present the video. identify how you want to play/instantiate the media (e.g. a <video> element, or document.createelement('video') perhaps?) deliver the media file to the player. html audio <audio controls preload="auto"> <source src="audiofile.mp3" type="audio/mpeg"> <!-- ...
...And 18 more matches
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
ch presentation versions of xml content. built from the ground up utilizing a wide variety of xml technologies, firefox incorporates within itself all of the mechanisms needed to process both original xml documents and the specialized stylesheets used to style and lay them out for html display, reducing server load with client-side processing. at present, gecko (the layout engine behind firefox) supports two forms of xml stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further information about css, see eric meyer's css pages. our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet. xslt stands for...
...lesheet author to transform a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). ...
...mary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). ...
...And 18 more matches
Developing for Firefox Mobile - Archive of obsolete content
mplements its ui using native android widgets instead of xul. with the add-on sdk you can develop add-ons that run on this new version of firefox mobile as well as on the desktop version of firefox. you can use the same code to target both desktop firefox and firefox mobile, and use jpm-mobile instead of the normal jpm. right now not all modules are fully functional, but we're working on adding support for more modules. the tables at the end of this guide list the modules that are currently supported on firefox mobile. this tutorial explains how to run sdk add-ons on an android device connected via usb to your development machine. we'll use the android debug bridge (adb) to communicate between the add-on sdk and the device. it's possible to use the android emulator to develop add-ons fo...
...e android sdk. make sure the "platform-tools" directory is in your path. then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started. running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules. when you need to run the add-on, first ensure that firefox is not running on the device. then execute jpm-mobile run with some extra options: jpm-mobile run --adb /path/to/adb in the command shell, you should see something like: launching mobile application with intent name org.mozilla.fennec pushing the addon to your device starting: intent { act=android.activity.main cmp=org...
...st way is probably to copy the signed xpi somewhere on the device: adb push my-addon.xpi /mnt/sdcard/ then open firefox mobile and type this into the address bar: file:///mnt/sdcard/my-addon.xpi the browser should open the xpi and ask if you want to install it. ...
...And 17 more matches
Windows Media in Netscape - Archive of obsolete content
windows media player™ as an activex control, and thus developers can now build multimedia experiences that script the windows media player in netscape 7.1, just as they do in internet explorer. netscape 7.1 will work with both the windows media player 6.4 activex control as well as versions 7 through 9. this article explains how to embed the windows media player activex control in web pages to support netscape 7.1, how to control the windows media player activex control using javascript and provides working examples. this article deals uniquely with netscape 7.1 running on the windows operating system. detecting the right browser like internet explorer, netscape 7.1 and later versions can play windows media files using the popular windows media player activex control. this control is widel...
...ol the windows media player activex control using javascript and provides working examples. this article deals uniquely with netscape 7.1 running on the windows operating system. detecting the right browser like internet explorer, netscape 7.1 and later versions can play windows media files using the popular windows media player activex control. ...
...internet explorer, netscape 7.1 and later versions can play windows media files using the popular windows media player activex control. this control is widely used to provide inline media support for web pages that provide sound, video and other media. controls such as windows media player also interact closely with the scripts in a web page. netscape 7.1 is the first netscape gecko™ browser to support the windows media player as an activex control -- previous netscape browsers did not support any activex controls, and thus detecting which versions of netscape support the windows media activex control is an important first step towards building multimedia experiences using html, javascript, and the windows media activex control. the windows media 9 series sdk documentation for netscape brow...
...And 17 more matches
What is CSS? - Learn web development
e for the background-color and border-color properties to be defined in this module. and you'd be right. css specifications all web standards technologies (html, css, javascript, etc.) are defined in giant documents called specifications (or simply "specs"), which are published by standards organizations (such as the w3c, whatwg, ecma, or khronos) and define precisely how those technologies are supposed to behave. css is no different — it is developed by a group within the w3c called the css working group. this group is made of representatives of browser vendors and other companies who have an interest in css. there are also other people, known as invited experts, who act as independent voices; they are not linked to a member organization. new css features are developed, or specified, b...
...w features coming available. however, a key thing about css is that everyone works very hard to never change things in a way that would break old websites. ...
...hat you will find the css specs overwhelming — they are intended for engineers to use to implement support for the features in user agents, not for web developers to read to understand css. many experienced developers would much rather refer to mdn documentation or other tutorials. it is however worth knowing that they exist, understanding the relationship between the css you are using, browser support (see below), and the specs. browser support once css has been specified then it is only useful for us in developing web pages if one or more browsers have implemented it. this means that the code has been written to turn the instruction in our css file into something that can be output to the screen. we'll look at this process more in the lesson how css works. it is unusual for all browsers...
...And 17 more matches
Video and audio content - Learn web development
ity with html fundamentals (as covered in getting started with html) and images in html. objective: to learn how to embed video and audio content into a webpage, and add captions/subtitles to video. video and audio on the web web developers have wanted to use video and audio on the web for a long time, ever since the early 2000s when we started to have bandwidth fast enough to support any kind of video (video files are much larger than text or even images.) in the early days, native web technologies such as html didn't have the ability to embed video and audio on the web, so proprietary (or plugin-based) technologies like flash (and later, silverlight) became popular for handling such content. this kind of technology worked ok, but it had a number of problems, including no...
...de for embedding video/audio in your webpages; if you use that route, you can avoid some of the difficulties we discuss in this article. we'll be discussing this kind of service a bit more in the next article. the <video> element the <video> element allows you to embed a video very easily. a really simple example looks like this: <video src="rabbit320.webm" controls> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.webm">link to the video</a> instead.</p> </video> the features of note are: src in the same way as for the <img> element, the src (source) attribute contains a path to the video you want to embed. it works in exactly the same way. controls users must be able to control video and audio playback (it's especially critical for people who have epile...
...y.) you must either use the controls attribute to include the browser's own control interface, or build your interface using the appropriate javascript api. at a minimum, the interface must include a way to start and stop the media, and to adjust the volume. the paragraph inside the <video> tags this is called fallback content — this will be displayed if the browser accessing the page doesn't support the <video> element, allowing us to provide a fallback for older browsers. this can be anything you like; in this case, we've provided a direct link to the video file, so the user can at least access it some way regardless of what browser they are using. the embedded video will look something like this: you can try the example live here (see also the source code.) using multiple source ...
...And 17 more matches
Accessible Toolkit Checklist
kits wrap the widgets implemented by the os with a consistent api for each platform. since the individual widgets predominately come from the operating system, they already implement standard keyboard commands and follow the operating system's visual theme. also, assistive technologies already understand native widgets so it is only necessary to implement microsoft active accessibility (msaa) api support for custom controls. however, be aware that the wrapping layer will introduce accessibility bugs, and thus you will need to test extensively and fill in the holes. you will also need to provide a way for custom and owner drawn controls to easily accessibility api support, as wxwidgets does. there will be custom and owner drawn controls -- there always are. for example, lists of checkboxes are...
...d owner drawn controls -- there always are. for example, lists of checkboxes are implemented in windows with images of checked and unchecked checkboxes. owner drawn toolkits , like xul and flash's flex ui framework use few or no native widgets. these toolkits need to have accessibility implemented from the ground up, and get nothing for free in terms of keyboard, api or os-theme support. in this case, adding a complete or even a partial accessibility solution is major work, and will require more than one full time person as well as cooperation from windows assistive technology vendors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case remember to generate a unique 32 bit child id for each c...
... the right of the current focus. on mac os x, ctrl+space is used to bring up the context menu. most widgets (like checkboxes) can have a label outside of themselves, which should focus the widget when clicked on, or when its mnemonic is pressed. the system should require these labels to be created/associated with each widget, not as a separate static text with no tie to the widget. the msaa support needs to know what label goes with what widget. msaa support: expose window with role_dialog, unless it's already the standard dialog window class #32770. if you don't, some screen readers won't automatically read the dialog when it receives focus. expose status bars with role_statusbar, unless they already use the standard window class msctls_statusbar32. make sure that parent-child re...
...And 17 more matches
JSS Provider Notes
been moved to http://www.dogtagpki.org/wiki/jss_provider. the mozilla-jss jca provider newsgroup: mozilla.dev.tech.crypto overview this document describes the jca provider shipped with jss. the provider's name is "mozilla-jss". it implements cryptographic operations in native code using the nss libraries. contents signed jar file installing the provider specifying the cryptotoken supported classes what's not supported signed jar file jss 3.2 implements several jce (java cryptography extension) algorithms. these algorithms have at various times been export-controlled by the us government. sun therefore requires that jar files implementing jce algorithms be digitally signed by an approved organization. netscape has this approval and signs the official builds of jss32.j...
... rsa keypair. this will happen on tokena because tokena // was the per-thread default token when rsakpg was created. rsakpg.initialize(1024); keypair rsapair = rsakpg.generatekeypair(); // generate a dsa keypair. this will happen on tokenb because tokenb // was the per-thread default token when dsakpg was created. ...
...l happen on tokenb because tokenb // was the per-thread default token when dsakpg was created. dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules. the current implementation is almost useless. since these problems lie deep in the nss design and implementation, there is no clear timeframe for fixing them. meanwhile, the org.mozilla.jss.crypto.cryptostore class ...
...And 17 more matches
IDBCursorWithValue - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 17 more matches
animation-delay - CSS: Cascading Style Sheets
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 17 more matches
break-inside - CSS: Cascading Style Sheets
definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 17 more matches
font-size-adjust - CSS: Cascading Style Sheets
ially at small sizes, is determined more by the size of lowercase letters than by the size of capital letters. legibility can become an issue when the first-choice font-family is unavailable and its replacement has a significantly different aspect ratio (the ratio of the size of lowercase letters to the size of the font). to use this property in a way that is compatible with browsers that do not support font-size-adjust, it is specified as a number that the font-size property is multiplied by. this means the value specified for the property should generally be the aspect ratio of the first choice font. for example, a style sheet that specifies: font-size: 14px; font-size-adjust: 0.5; ... is really specifying that the lowercase letters of the font should be 7px high (0.5 × 14px). this wi...
...font-size property is multiplied by. this means the value specified for the property should generally be the aspect ratio of the first choice font. for example, a style sheet that specifies: font-size: 14px; font-size-adjust: 0.5; ... is really specifying that the lowercase letters of the font should be 7px high (0.5 × 14px). this will still produce reasonable results in browsers that do not support font-size-adjust, where a 14px font will be used. syntax values none choose the size of the font based only on the font-size property. <number> choose the size of the font so that its lowercase letters (as determined by the x-height of the font) are the specified number times the font-size. the number specified should generally be the aspect ratio (ratio of x-height to font size)...
...<number> choose the size of the font so that its lowercase letters (as determined by the x-height of the font) are the specified number times the font-size. the number specified should generally be the aspect ratio (ratio of x-height to font size) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text). formal definition initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea number formal syntax none | <number> examples adjusting lower-case letter sizes html <p class="times">this text uses the times font (10px), which is hard to ...
...And 17 more matches
Index
match this document, and that's ok. whenever practical, new code and changes should move code closer to the ideal future. and of course, the idea of the future is always evolving in time as things change and we learn more. 6 gc rooting guide spidermonkey no summary! 7 gcintegration developing mozilla, firefox, garbage collection, intermediate, intro, jsapi, needsupdate, spidermonkey, tools, memory the spidermonkey garbage collector (gc) will be changing a lot in the future. this page is intended to explain the changes that are happening, with a focus on how they will affect gecko code that uses jsapi. at a high level, there are three issues to be aware of: 8 getting spidermonkey source code guide, spidermonkey you can get the spid...
..., spidermonkey js::callargs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. 30 js::clonefunctionobject jsapi reference, reference, référence(2), spidermonkey js::clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj. if scopechain is supplied, it uses scopechain as its enclosing scope. if scopechain is omitted, it creates a new function object in cx's global. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. 31 js::compile jsapi reference, reference, référence(2), spidermonkey js::compile compiles a script, srcbuf, chars, bytes,...
...e object it wraps. in these cases the engine calls the jsextendedclass.wrappedobject callback to get the wrapped object. most classes do not implement wrappedobject. 104 jsfun_bound_method jsapi reference, obsolete, spidermonkey this macro exists only for backward compatibility with existing applications. its use is deprecated. future versions of the javascript engine may not support or recognize this macro. 105 jsfun_global_parent jsapi reference, obsolete, spidermonkey no summary! 106 jsfastnative jsapi reference, obsolete, spidermonkey the callback should use the following macros to access the fields of vp: 107 jsfinalizeop jsapi reference, reference, référence(2), spidermonkey the jsfinalizeop is analogo...
...And 16 more matches
nsIXPConnect
js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service. ...
...amelocation(in pruint32 alanguage, in string afilename, in string afunctionname, in print32 alinenumber, in nsistackframe acaller); void debugdump(in short depth); void debugdumpevalinjsstackframe(in pruint32 aframenumber, in string asourcetext); void debugdumpjsstack(in prbool showargs, in prbool showlocals, in prbool showthisprops); void debugdumpobject(in nsisupports acomobj, in short depth); [noscript,notxpcom] prbool definedomquickstubs(in jscontextptr cx, in jsobjectptr proto, in pruint32 flags, in pruint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray); jsval evalinsandboxobject(in astring source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool returnstringonly); native code only! ...
...objectptr aparent, in jsobjectptr awrappedobj); native code only! ...
...And 16 more matches
FileList - Web APIs
Web › API › FileList
an object of this type is returned by the files property of the html <input> element; this lets you access the list of files selected with the <input type="file"> element. it's also used for a list of files dropped into web content when using the drag and drop api; see the datatransfer object for details on this usage. note: prior to gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the filelist would contain only one file. starting with gecko 1.9.2, if the input element's multiple attribute is true, the filelist may contain multiple files. using the file list all <input> element nodes have a files attribute of type filelist on them which allows access to the items in this list. for example, if the html includes the following file input: ...
...lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 16 more matches
FileSystemFlags.create - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...this option has no effect.ie no su...
...And 16 more matches
FileSystemFlags.exclusive - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...'d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...this option has no effect.ie no su...
...And 16 more matches
CSS Scrollbars - CSS: Cascading Style Sheets
y table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. scrollbar-width desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbar-widthchrome no support noedge no support nofirefox full support 64 full support 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). to change preferences in firefox, visit...
...firefox full support 64 full support 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true). ...
...And 16 more matches
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. ...
...utton is provided to clear the control's value. 12-hour 24-hour edge the edge time control is somewhat more elaborate, opening up an hour and minute picker with sliding reels. it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. you can set a default value for the input by including a valid time in the value attribute when creating the <input> elem...
...And 16 more matches
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
... the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
...llowing is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
...And 16 more matches
Gecko Compatibility Handbook - Archive of obsolete content
ntent has been developed for microsoft internet explorer 4 or netscape navigator 4. these browsers were developed before the relevant w3c recommendations for html, css, and the dom existed. these earlier, non-standards based browsers differed in several ways from gecko: these browsers use proprietary (non-standard) html, css, and javascript. ...
...these browsers were developed before the relevant w3c recommendations for html, css, and the dom existed. these earlier, non-standards based browsers differed in several ways from gecko: these browsers use proprietary (non-standard) html, css, and javascript. internet explorer 4 and netscape navigator 4 share support for a large part of the html 3.2 standard and basic javascript. while they support the css 1 standard to some degree, the implementations are not complete and have non-standard features added. neither internet explorer 4 or netscape navigator 4 support the w3 dom. instead, each browser supports its own proprietary api for manipulating the content, style and position of html elements in a web page. in addition, internet explorer 4 and netscape navigator 4 use completely di...
...t explorer for mac and ie for windows, which are very different programs and so may behave quite differently from each other. quick compatibility test if your site uses netscape 4.x and microsoft proprietary technologies, see using web standards in your web pages for a quick tutorial on standards. this compatibility test will be most beneficial to sites using simple code or that have updated to support standards. set up browsers for testing the various gecko-based browsers do not always contain netscape in the user-agent string. thus it's critical to verify that you are properly detecting browsers such as aol for macos. you can either download the various browsers. or, if you are using user-agent detection, you can install an extension in firefox or mozilla which allows you to "spoof" th...
...And 15 more matches
Working with JSON - Learn web development
and a mime type of application/json. json structure as described above, a json is a string whose format very much resembles javascript object literal format. you can include the same basic data types inside json as you can in a standard javascript object — strings, numbers, arrays, booleans, and other object literals. ...
...is a string whose format very much resembles javascript object literal format. you can include the same basic data types inside json as you can in a standard javascript object — strings, numbers, arrays, booleans, and other object literals. ...
..."members": [ { "name": "molecule man", "age": 29, "secretidentity": "dan jukes", "powers": [ "radiation resistance", "turning tiny", "radiation blast" ] }, { "name": "madame uppercut", "age": 39, "secretidentity": "jane wilson", "powers": [ "million tonne punch", "damage resistance", "superhuman reflexes" ] }, { "name": "eternal flame", "age": 1000000, "secretidentity": "unknown", "powers": [ "immortality", "heat immunity", "inferno", "teleportation", "interdimensional travel" ] } ] } if we loaded this object into a javascript program, parsed in a variable called superheroes for example, we ...
...And 15 more matches
Mozilla-JSS JCA Provider notes
the mozilla-jss jca provider newsgroup: mozilla.dev.tech.crypto overview this document describes the jca provider shipped with jss. the provider's name is "mozilla-jss". it implements cryptographic operations in native code using the nss libraries. contents signed jar file installing the provider specifying the cryptotoken supported classes what's not supported signed jar file jss implements several jce (java cryptography extension) algorithms. these algorithms have at various times been export-controlled by the us government. jre therefore requires that jar files implementing jce algorithms be digitally signed by an approved organization. the maintainers of jss, sun, red hat, and mozilla, have this approval and signs the official builds of jss4.jar. at runtime, the jre autom...
.../ generate an rsa keypair. this will happen on tokena because tokena // was the per-thread default token when rsakpg was created. rsakpg.initialize(1024); keypair rsapair = rsakpg.generatekeypair(); // generate a dsa keypair. this will happen on tokenb because tokenb // was the per-thread default token when dsakpg was created. ...
... a dsa keypair. this will happen on tokenb because tokenb // was the per-thread default token when dsakpg was created. ...
...And 15 more matches
FileSystem - Web APIs
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...it's not available for use in file or folder picker panels (such as when you use an <input> eleme...
...And 15 more matches
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 15 more matches
IDBTransaction.error - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 15 more matches
Slottable - Web APIs
Web › API › Slottable
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetslottable experimentalchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences i...
... full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config. no support ? — 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.ie no support noopera full support ...
...And 15 more matches
WebGL best practices - Web APIs
firefox), webgl stops generating descriptive messages, which really hinders debugging. the only errors a well-formed page generates are out_of_memory and context_lost. know your limits (and extensions) the availability of most webgl extensions depends on the client system. ...
...of most webgl extensions depends on the client system. when using webgl extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. ...
... extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. ...
...And 15 more matches
Functions and classes available to Web Workers - Web APIs
yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope no close() yes, on workerglobalscope yes, on workerglobalscope yes, but is a no-op. ...
...yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope no close() yes, on workerglobalscope yes, on workerglobalscope yes, but is a no-op. ...
...balscope yes, on workerglobalscope yes, on workerglobalscope no close() yes, on workerglobalscope yes, on workerglobalscope yes, but is a no-op. ...
...And 15 more matches
Using feature queries - CSS: Cascading Style Sheets
feature queries are created using the css at-rule @supports, and are useful as they give web developers a way to test to see if a browser has support for a certain feature, and then provide css that will only run based on the result of that test. in this guide you will learn how to implement progressive enhancement using feature queries. syntax css feature queries are part of the css conditional rules module, which also contains the media query @media rule; when you use feature queries, you will find they behave in a similar way to media queries. ...
...ueries. syntax css feature queries are part of the css conditional rules module, which also contains the media query @media rule; when you use feature queries, you will find they behave in a similar way to media queries. ...
...ditional rules module, which also contains the media query @media rule; when you use feature queries, you will find they behave in a similar way to media queries. the difference is that with a media query you are testing something about the environment in which the web page is running, whereas with feature queries you are testing browser support for css features. a feature query consists of the @supports rule, followed by the property name and value you would like to test for. you may not test for a bare property name such as display; the rule requires a property name and a value: @supports (property: value) { css rules to apply } if you want to check if a browser supports the row-gap property, for example, you would write the following feature query. it doesn't matter which value you us...
...And 15 more matches
<shape> - CSS: Cascading Style Sheets
Web › CSS › shape
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 15 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
button a push button with no default behavior displaying the value of the value attribute, empty by default. <input type="button" name="button" /> checkbox a check box allowing single values to be selected/deselected. <input type="checkbox" name="checkbox"/> color a control for specifying a color; opening a color picker when active in supporting browsers. <input type="color" name="color"/> html5 date a control for entering a date (year, month, and day, with no time). opens a date picker or numeric wheels for year, month, day when active in supporting browsers. <input type="date" name="date"/> html5 datetime-local a control for entering a date and time, with no time zone. open...
... date a control for entering a date (year, month, and day, with no time). opens a date picker or numeric wheels for year, month, day when active in supporting browsers. <input type="date" name="date"/> html5 datetime-local a control for entering a date and time, with no time zone. opens a date picker or numeric wheels for date- and time-components when active in supporting browsers. <input type="datetime-local" name="datetime-local"/> html5 email a field for editing an email address. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input type="email" name="email"/> html5 file a control that lets the user select a file...
...defined by the src attribute. the alt attribute displays if the image src is missing. <input type="image" name="image" src="" alt="image input"/> month a control for entering a month and year, with no time zone. <input type="month" name="month"/> html5 number a control for entering a number. displays a spinner and adds default validation when supported. displays a numeric keypad in some devices with dynamic keypads. <input type="number" name="number"/> html5 password a single-line text field whose value is obscured. will alert user if site is not secure. <input type="password" name="password"/> radio a radio button, allowing a single value to be selected out of multiple choices with...
...And 15 more matches
Mozilla Crypto FAQ - Archive of obsolete content
note that this document is for your information only and is not intended as legal advice. if you wish to develop and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. ...
...mozilla code base. information in the faq also reflects the new u.s. encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and general pki functionality for use in the mozilla project, and the "bernstein advisory" issued by the bureau of export administration on february 17, 2000. the questions in this faq address mozilla's support for encryption and related security functionality, information important to mozilla contributors relating to encryption functionality in mozilla, and general questions on u.s. regulation of encryption technology. cryptographic functionality in mozilla have all the issues with mozilla and crypto now been resolved? almost. now that the rsa patent is in the public domain, mozilla crypto devel...
... u.s. regulation of encryption technology. cryptographic functionality in mozilla have all the issues with mozilla and crypto now been resolved? almost. now that the rsa patent is in the public domain, mozilla crypto development can proceed with minimal restrictions. in the near future the mozilla code base will include a complete open source cryptographic library, and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc., held a u.s. patent on the rsa public key algorithm. in february 2000 iplanet e-commerce solutions (a sun-netscape...
...And 14 more matches
Mozilla’s UAAG evaluation report
1 candidate recommendation of uaag 1.0. this may be different from the most recent version, check for updates on the user agent working group home page. look to the "techniques" document for real-world implementation examples of each checkpoint. this uaag evaluation report covers nightly builds of the mozilla web browser itself, running on windows 2000, as of february 20, 2002. we are claiming to support html 4, css 2, png, jpg and gif. this evaluation does not cover mailnews or composer. there may be accessibility and customizability features not listed here. a very good resource is the customizing document. when filing mozilla bugs based on uaag requirements, please use bug 24413 as the uaag meta bug. checkpoint information (same scaled used on w3c's uaag implementation reports pages) ...
... scale c: complete implementation vg: very good implementation, almost all requirements satisfied g: good implementation, most important requirements satisfied p: poor implementation, some requirements satisfied and/or difficult for user to access feature ni: not implemented nr: not rated na: not applicable document under construction guideline 1. support input and output device-independence. checkpoint title status notes/plans 1.1 full keyboard access. (p1) vg we have some remaining bugs, and some keyboard usability issues, but in general mozilla now has keyboard equivalents for almost everything. most browsers do not allow the user to select text with the keyboard alone. we intend to do this with a caret ...
...ve some remaining bugs, and some keyboard usability issues, but in general mozilla now has keyboard equivalents for almost everything. most browsers do not allow the user to select text with the keyboard alone. we intend to do this with a caret browsing feature. 1.2 activate event handlers. (p1) p onmouseover, onmousedown, onmouseup, onmousemove, onclick, ondbclick: no keyboard support onfocus and onblur: cannot be activated with pointer 1.3 provide text messages. (p1) c status line and alert boxes used to convey messages and alerts guideline 2. ensure user access to all content. checkpoint title status notes/plans checkpoint title status notes/plans 2.1 render content according to specification. (p...
...And 14 more matches
IDBObjectStore.name - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 14 more matches
PaymentRequest.canMakePayment() - Web APIs
you can call this before calling show() to provide a streamlined user experience when the user's browser can't handle any of the payment methods you accept. ...
...could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even provide instructions for paying by mail or by phone). syntax paymentrequest.canmakepayment() .then( canpay => { ... }) .catch( error => { ... }) canpay = await paymentrequest.canmakepayment(); returns a promise to a boolean that resolves to true if the user agent supports any of the payment methods supplied when instantiating the request using the paymentrequest constructor. if the payment can't be processed, the promise receives a value of false. note: if you call this too often, the browser may reject the returned promise with a domexception. parameters none examples in the following example, is excerpted from a demo that asynchronously builds a paym...
...ously builds a paymentrequest object for both apple pay and credit cards. it wraps the call to canmakepayment() in feature detection, and calls an appropriate callback depending on the resolution of the promise. ...
...And 14 more matches
Using the Payment Request API - Web APIs
r preferred payment systems and platforms to merchants that they want to pay for goods and services. this article is a guide to making use of the payment request api, with examples and suggested best practices. the basics of making a payment this section details the basics of using the payment request api to make a payment. note: the code snippets from this section are from our feature detect support demo. creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor. this takes two mandatory parameters and one option parameter: methoddata — an object containing information concerning the payment provider, such as what payment methods are supported, etc. details — an object conta...
...nt provider, such as what payment methods are supported, etc. details — an object containing information concerning the specific payment, such as the total payment amount, tax, shipping cost, etc. options (optional) — an object containing addtional options related to the payment. ...
... options (optional) — an object containing addtional options related to the payment. ...
...And 14 more matches
PushManager.hasPermission() - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethaspermission experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. ...
...And 14 more matches
:scope - CSS: Cascading Style Sheets
Web › CSS › :scope
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:scopechrome full support 27edge full support 79firefox full support 32notes full support 32notes notes firefox 55 removes support for <style scoped> but not for the :scope pseudo-class, which is still supported. <style scoped> made it possible to explicit...
... full support 32notes notes firefox 55 removes support for <style scoped> but not for the :scope pseudo-class, which is still supported. <style scoped> made it possible to explicitly set up element scopes, but ongoing discussions about the design of this feature as well as lack of other implementations resulted in the decision to remove it. no support 20 — 32disabled disabled from version 20 until version 32 (exclusive): this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
...ions about the design of this feature as well as lack of other implementations resulted in the decision to remove it. no support 20 — 32disabled disabled from version 20 until version 32 (exclusive): this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true). ...
...And 14 more matches
box-direction - CSS: Cascading Style Sheets
e on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ntribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...romeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbox-direction deprecatednon-standardchrome full support 1prefixed full support 1prefixed prefixed implemented with the vendor prefix: -webkit-edge full support 12prefixed full support 12prefixed prefixed implemented with the vendor prefix: -webkit-firefox full support 1prefixed full support 1prefixed prefixed implemented with the vendor prefix: -moz- full support ...
...And 14 more matches
WebAssembly.Module - JavaScript
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 14 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types. this article lists these types along with their syntax and d...
... a parent html document using the tag: 6 namespaces crash course svg, xml as an xml dialect, svg is namespaced. it is important to understand the concept of namespaces and how they are used if you plan to author svg content. versions of svg viewers prior to the release of firefox 1.5 unfortunately paid scant attention to namespaces, but they are essential to multi-xml dialect supporting user agents such as gecko-based browsers which must be very strict. take some time to understand namespaces now and it will save you all sorts of headaches in the future. 7 example svg, xml in this example, we use xhtml, svg, javascript, and the dom to animate a swarm of "motes". these motes are governed by two simple principles. first, each mote tries to move towards ...
...ote tries to move away from the average mote position. combined, we get this very natural-looking behavior. 8 other resources reference, svg here is a list of additional resources on svg: 9 project svg no summary! 10 replaced element svg this page was auto-generated because a user created a sub-page to this page. 11 svg 1.1 support in firefox firefox, svg you can find some basic examples of svg syntax and usage in the w3c svg test suite. 12 svg 2 support in mozilla firefox, svg svg 2 is the next major version of the svg standard, which is a complete rework of the svg 1.2 draft. 13 svg attribute reference drawing, landing, needshelp, overview, responsive design, svg, svg attr...
...And 14 more matches
Localization - Archive of obsolete content
see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
... you'd add two files to the "locale" directory: my-addon/ data lib locale/ en-us.properties fr.properties "en-us.properties" contains this: hello_id= hello! "fr.properties" contains this: hello_id= bonjour !
...And 13 more matches
XML in Mozilla - Archive of obsolete content
dtds and other external entities mozilla does not load external entities from the web. ...
...dtds and other external entities mozilla does not load external entities from the web. ...
...dtds and other external entities mozilla does not load external entities from the web. ...
...And 13 more matches
Gecko FAQ - Gecko Redirect 1
gecko is used in multiple browsers, including mozilla firefox, seamonkey, and others. gecko is continuously under development at mozilla.org. gecko has been known previously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute. for more information see the wikipedia article on gecko. ...
...nts the browser's content area, which is the blank area inside the browser window's chrome. formally, a layout engine defines the placement policy for a document and places content on a page. gecko's core is a very fast layout engine. gecko also offers the ability to parse various document types (html, xml, svg, etc), advanced rendering capabilities including compositing and transformations, and support for embedded javascript and plugins. gecko is so fast and so powerful that it's being used to create the user interface of some applications ("chrome") as well. in other words, gecko will not only be displaying the document's content, but it will also be painting the scrollbars, toolbars, and menus on the screen as well. for more information see xul. how is a layout engine like gecko differ...
...wsers, as well as others, powering all of the individual components. gecko technologies will also power the display of the mozilla.com portal site, speedily delivering more exciting content and services. gecko's architecture will serve mozilla well into the future, enabling faster time to market, more innovation, less costly development, easier distribution and updating, and better cross platform support. how can other companies and organizations use gecko? because gecko is small, lightweight, and open source, other companies and organizations can easily reuse it. many hardware vendors are creating devices with network access and wish to include web browsing functionality. likewise, many software developers want to include web browsing capability in their applications, but don't want to ind...
...And 13 more matches
FileSystemDirectoryEntry - Web APIs
on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryentry experimentalchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryentryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie no support noopera full support yesprefixed full support...
...And 13 more matches
PushRegistrationManager - Web APIs
methods pushregistrationmanager.register() returns a promise that resolves to a pushregistration with details of a new registration. pushregistrationmanager.unregister() returns a promise that resolves to a pushregistration with details of the unregistered registration. pushregistrationmanager.getregistration() returns a promise that resolves the pushregistration associated with the current webapp. ...
...s page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 13 more matches
Using the Resource Timing API - Web APIs
and responseend). this example also calculates the time from the start of the fetch and request start phases (fetchstart and requeststart, respectively), until the response has ended (responseend). this timing data provides a detailed profile of the resource loading phases and this data can be used to help identify performance bottlenecks. ...
...t phases (fetchstart and requeststart, respectively), until the response has ended (responseend). this timing data provides a detailed profile of the resource loading phases and this data can be used to help identify performance bottlenecks. ...
...y returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings. decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings. the following example demonstrates using these three properties. ...
...And 13 more matches
ScreenOrientation - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 13 more matches
Screen Orientation API - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 13 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
in spring of 2017, we saw for the first time a major specification like grid being shipped into browsers almost simultaneously, and we now have css grid layout support in the public versions of firefox, chrome, opera, safari and edge. however, while evergreen browsers mean that many of us are going to see the majority of users having grid layout support very quickly, there are also old or non-supporting browsers to contend with. in this guide we will walk through a variety of strategies for support. the supporting browsers other than in internet explorer, css grid layout is unprefixed in safari, chrome, opera, firefox and edge. support for all the properties and values detailed in these guides is interoperable across browsers. this means that if you write some grid layout code in f...
...d-column-align the ie version has additional properties not required in the new specification of -ms-grid-column-span and -ms-grid-row-span. this version does not include auto-placement capability, or grid template areas. some simple grid layouts could be implemented for ie10, through to edge 15, using the -ms properties. as these properties are vendor prefixed, they will not effect any browser supporting the up to date and unprefixed specification. autoprefixer grid layout support the popular tool autoprefixer has been updated to support the -ms- grid version. by default, grid prefixes are disabled, but you can enable it with grid: true option. autoprefixer({ grid: 'autoplace' }) grid prefixes are disabled by default because some properties can’t be prefixed. is it safe to use css g...
...r nothing way. you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method. overwriting of legacy methods with grid layout works surprisingly well, due to the way grid interacts with these other methods. floats we have typically used floats to create multiple column layouts. if you have floated an item, which is also a grid item in a supporting browser, the float will no longer apply to the item. the fact is that a grid item takes precedence. in the example below, i have a simple media object. in a non-supporting browser, i use float, however i have also defined the container as a grid container, in order to use the alignment properties that are implemented in css grids. the float no longer applies, and i can use the css box ali...
...And 13 more matches
HTTP Index - HTTP
Web › HTTP › Index
urls guide, http, url a recurring question among website owners is whether to choose non-www or www urls. this page provides some advice on what's best. 6 data urls base64, guide, http, intermediate, url data urls, urls prefixed with the data: scheme, allow content creators to embed small files inline in documents. 7 evolution of http guide, http, needsupdate, needsupdate(http/3) http (hypertext transfer protocol) is the underlying protocol of the world wide web. http has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the internet, now carrying images, videos in high resolution and 3d. 8 identifying resources on the web domain, http, path, scheme, syntax, uri, u...
...vely enhance itself based on the availability of features rather than by targeting specific browsers. 13 compression in http guide, http, compression compression is an important way to increase the performance of a web site. for some documents, size reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. 14 configuring servers for ogg media audio, http, media, ogg, video this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. 15 connection management in http/1.x connection management, guide, http, networking, performance, webmechanics connection manage...
...uests. 29 reason: cors request not http cors, corsrequestnothttp, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting cors requests may only use the https url scheme, but the url specified by the request is of a different type. this often occurs if the url specifies a local file, using a file:/// url. ...
...And 13 more matches
WebAssembly.Memory - JavaScript
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 13 more matches
platform/xpcom - Archive of obsolete content
ement and register xpcom services if all you need to do is use xpcom objects that someone else has implemented, then you don't need to use this module. you can just use require("chrome") to get direct access to the components object, and access xpcom objects from there. implementing xpcom interfaces this module exports a class called unknown which implements the fundamental xpcom interface nsisupports. by subclassing unknown, either using standard javascript inheritance or using the sdk's heritage module, you can provide your own implementations of xpcom interfaces. "unknown" is named after the "iunknown" interface in com. for example, the add-on below implements the nsiobserver interface to listen for and log all topic notifications: var { class } = require('sdk/core/heritage'); var {...
...if you don't specify a class id, then the factory will generate one. either way, it will be accessible as the value of the factory's id property. xpcom users can look up the factory using the class id ...
...however, the components.classes object commonly used to look up factories by contract id will not be updated at run time. to access the replacement factory you ...
...And 12 more matches
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
ss's internal certificate database? if so, is there a way to get the certificate from an external token into nss's internal certificate database? nss searches all the installed pkcs #11 modules when looking for certificates. once you've installed the module, the module's certificates simply appear in the list of certificates displayed in the certificate window. what version of pkcs #11 does nss support? nss requires at least pkcs #11 version 2.0, but can support some features of later versions of nss, including nss 2.20. nss does not use all the features of later versions of pkcs #11. what are the expectations in terms of session manipulation? will nss potentially open more than one session at a time? read-only sessions, read/write sessions, serial, parallel? nss typically holds one sess...
...he pkcs #11 functions that make sense for your token. nss continues to evolve, and periodically enhances it's functionality by using a more complete list of pkcs #11 functions. you should have implementations for all the functions specified in the version of the pkcs #11 spec your token implements. if you do not actually do the operation specified by that function, you can return ckr_function_not_supported. will nss get the user's ca certificate via pkcs #11 and push it into the ca certificate database or is the ca certificate database expected to obtain the ca certificate by some other means? pkcs #11 certificates that have private keys associated with them are are loaded into the temporary database (in memory) and marked as user certificates. all other certificates in the module are loade...
...e these cases as we find them. what are "generic crypto svcs" (the first item listed when you click the view/edit button for the nss internal pkcs #11 module under security devices under options/security in firefox)? generic crypto svcs are the services that nss uses to do its basic cryptography (rsa encryption with public keys, hashing, aes, des, rc4, rc2, and so on).other pkcs #11 modules can supply implementations of these functions, and nss uses those versions under certain conditions. however, these are not the services nss calls to get to other pkcs #11 modules, which show up separately under cryptographic modules. our plugin provides several slots with different capabilities. for example, one does all the hashing/symmetric operations, while another does only asymmetric rsa operation...
...And 12 more matches
nsIDOMWindowUtils
dom/interfaces/base/nsidomwindowutils.idlscriptable this interface is a dom utility interface that provides useful dom methods and attributes. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 49.0 (firefox 49.0 / thunderbird 49.0 / seamonkey 2.46) implemented by: window. to get this interface, use: var domwindowutils = window.windowutils; method overview void activatenativemenuitemat(in astring indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring val...
... void removesheet(in nsiuri sheeturi, in unsigned long type); void resumetimeouts(); ...
...read only. exceptions thrown ns_error_not_available there is no current inner window ...
...And 12 more matches
nsITransferable
widget/nsitransferable.idlscriptable a container for typed data that can be transferred from one place or owner to another, possibly involving format conversion. these objects are used during drag-and-drop operations. inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) implemented by: @mozilla.org/widget/transferable;1. to create an instance, use: var transferable = components.classes["@mozilla.org/widget/transferable;1"] .createinstance(components.interfaces.nsitransferable); it's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor. method overview ...
...mozilla.org/widget/transferable;1"] .createinstance(components.interfaces.nsitransferable); it's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor. ...
...ateinstance(components.interfaces.nsitransferable); it's important to note that a flavor, which specifies a type of data the transferable supports, is represented by a null-terminated string indicating the mime type of the format supported by the flavor. ...
...And 12 more matches
nsIWebNavigationInfo
docshell/base/nsiwebnavigationinfo.idlscriptable exposes a way to get information on the capabilities of gecko web navigation objects. ...
... introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/webnavigation-info;1 as a service: var webnavigationinfo = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavigationinfo); method overview unsigned long istypesupported(in acstring atype, in nsiwebnavigation awebnav); constants support type constants constant value description unsupported 0 returned by istypesupported() to indicate lack of support for a type. ...
...this is not the value returned for "xpcom plug-ins". ...
...And 12 more matches
BiquadFilterNode() - Web APIs
y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d us a pull request. ...
...And 12 more matches
FileSystemDirectoryReader - Web APIs
ge is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...reroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryreader deprecatednon-standardchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryreaderedge full support ≤18alternate name full support ≤18alternate name alternate name uses the non-standard name: webkitdirectoryreaderfirefox full support 50ie no support noopera full support yesprefixe...
...And 12 more matches
HTMLImageElement.x - Web APIs
mpatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 12 more matches
HTMLImageElement.y - Web APIs
mpatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 12 more matches
IDBFactory.cmp() - Web APIs
Web › API › IDBFactory › cmp
example var a = 1; var b = 2; var result = window.indexeddb.cmp(a, b); console.log( "comparison results: " + result ); specifications specification status comment indexed database api 2.0the definition of 'cmp()' in that specification. recommendation indexed database api draftthe definition of 'cmp()' in that spe...
...tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 12 more matches
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 12 more matches
:host() - CSS: Cascading Style Sheets
Web › CSS › :host()
ons specification status comment css scoping module level 1the definition of ':host()' in that specification. working draft initial definition. ...
... scoping module level 1the definition of ':host()' in that specification. working draft initial definition. browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:host()chrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences i...
... full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). ...
...And 12 more matches
image-set() - CSS: Cascading Style Sheets
Web › CSS › image-set
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...quest. ...
...And 12 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
h a date and a time, including the year, month, and day as well as the time in hours and minutes. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop and most modern versions of mobile browsers having usable implementations. in other browsers, these degrade gracefully to simple <input type="text"> controls. the control is intended to simply represent a local date and time, not necessarily the user's local date and time. in other words, an implementation should allow any valid combinati...
...user's local date and time. in other words, an implementation should allow any valid combination of year, month, day, hour, and minute - even if such a combination is invalid in the user's local time zone (such as times within a daylight saving time spring-forward transition gap). some mobile browsers (particularly on ios) do not currently implement this correctly. because of the limited browser support for datetime-local, and the variations in how the inputs work, it may currently still be best to use a framework or library to present these, or to use a custom input of your own. another option is to use separate date and time inputs, each of which is more widely supported than datetime-local. some browsers may resort to a text-only input element that validates that the results are legitima...
...clicking the down arrow on the right hand side brings up a date picker to allow you to choose a date; you have to enter the time manually. ...
...And 12 more matches
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
ally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. values include user and environment. 39 html attribute: crossorigin advanced, attribute, cors, html, needscontent, reference, security the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data. depending on the element, the attribute can be a cors settings attribute. 40 html attribute: max attribute, attributes, constraint validation, html, reference the max attribute defines the maximum value that is acceptable...
...alidation, forms, required the boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control. 47 html attribute: rel attribute, attributes, constraint validation, link, form, rel the rel attribute defines the relationship between a linked resource and the current document. valid on <link>, <a>, <area>, and <form>, the supported values depend on the element on which the attribute is found. 48 html attribute: required attribute, attributes, constraint validation, forms, required the boolean required attribute 49 html attribute: size attribute, html, input, reference, select the size attribute defines the width of the <input> and the height of the <select> element. for the in...
... the input or a special date picker interface. 123 <input type="datetime"> element, html, html forms, input, input element, input type, obsolete, reference, datetime the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone. this feature has been removed from whatwg html, and is no longer supported in browsers. 124 <input type="datetime-local"> date, date and time, element, form input, html, html forms, input, input element, input type, reference, time, datetime-local <input> elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes. ...
...And 12 more matches
WebAssembly.Instance - JavaScript
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 12 more matches
SVG fonts - SVG: Scalable Vector Graphics
« previousnext » when svg was specified, support for web fonts was not widespread in browsers. since accessing the correct font file is however crucial for rendering text correctly, a font description technology was added to svg to provide this ability. it was not meant for compatibility with other formats like postscript or otf, but rather as a simple means of embedding glyph information into svg when rendered. svg fonts are currently supported only in safari and android browser. internet explorer hasn't considered implementing this, the functionality has been removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff. ...
...ng glyph information into svg when rendered. svg fonts are currently supported only in safari and android browser. internet explorer hasn't considered implementing this, the functionality has been removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff. other tools however like the adobe svg viewer plugin, batik and parts of inkscape support svg font embedding. the base for defining an svg font is the <font> element. defining a font there are some ingredients required for embedding a font in svg. let's show an example declaration (the one from the specification), and explain the details. ...
...ols however like the adobe svg viewer plugin, batik and parts of inkscape support svg font embedding. the base for defining an svg font is the <font> element. defining a font there are some ingredients required for embedding a font in svg. let's show an example declaration (the one from the specification), and explain the details. ...
...And 12 more matches
Enhanced Extension Installation - Archive of obsolete content
e directory's extensions folder. this boolean relationship itself is not stored directly in the datasource. rather, if the system needs to know where an item is located, it checks to see if the item is a member of the the appropriate type container (urn:mozilla:extension:root or urn:mozilla:theme:root) in each of the two datasources. this is clumsy. item type the extension system in firefox 1.0 supports only two item types, extensions and themes. this is a by-product of the fact that there are physical per-type containers in the datasource. sections of ui that display installed items are rooted on these containers. tracking item type item type is tracked for the most part by containment in one or other of the two containers. in situations where an item is not yet a member of one of the co...
...that something has changed on the next restart. a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system. if the item is not compatible, the extension system asks the appropriate update service (either the one specified by the item, or the default one) if there is remote compatibility information that supercedes the compatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is immediately installed fully, rather than awaiting the next restart, since themes d...
...s the compatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is immediately installed fully, rather than awaiting the next restart, since themes do not supply xpcom components, preferences defaults etc. for extensions, on the next startup, the startup system notices the presence of the .autoreg file and starts the extension manager with a "dirty" flag, telling it to finish any install operations that may be pending. the extension manager loads the xml/rdf datasources (this is allowable and necessary because a major change has happened) and gets a ...
...And 11 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
statustext deprecated, xul attributes, xul reference no summary! 351 stringbundle.src xul attributes, xul reference no summary! 352 style xul attributes, xul reference no summary! 353 subject xul attributes, xul reference no summary! 354 substate xul attributes, xul reference no summary! 355 suppressonselect xul attributes, xul reference no summary! 356 tab.selected xul, xul attributes, xul reference no summary! 357 tabindex xul attributes, xul reference no summary! 358 tabmodalpromptshowing xul, xul methods, xul reference no summary! 359 tabs.onselect xul attributes, xul reference no summary! ...
... of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one. 434 how to quit a xul application xul, xulrunner script can attempt to quit a xul application, or force the application to quit, using the nsiappstartup interface. 435 how to implement a custom xul query processor component xul supports templating to create a block of content from a datasource query. the xul template guide has lots of detailed information on using xul templates. xul provides template query processors for rdf, xml and sql (mozstorage). the templating system also supports building custom query processors. custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface ...
... xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component. 436 index found 1218 pages: 437 international characters in xul javascript firefox, gecko, guide, internationalization, javascript, mozilla, xpcom, xul gecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascript files loaded from xul files. 438 introduction to xul guide, xul mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui description. in fact, most of mozilla's windows (and dialogs) will...
...And 11 more matches
Server-side web frameworks - Learn web development
e now; we'll be working you through the code in our framework-specific modules. overview server-side web frameworks (a.k.a. "web application frameworks") are software frameworks that make it easier to write, maintain and scale web applications. they provide tools and libraries that simplify common web development tasks, including routing urls to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. html, json, xml), and improving security against web attacks. the next section provides a bit more detail about how web frameworks can ease web application development. we then explain some of the criteria you can use for choosing a web framework, and then list some of your options. what can a web framework do for you? web framewo...
...s'), ('u10', 'under 10s'), ('u11', 'under 11s'), ... #list our other teams ) team_level = models.charfield(max_length=3,choices=team_levels,default='u11') the django model provides a simple query api for searching the database. this can match against a number of fields at a time using different criteria (e.g. exact, case-insensitive, greater than, etc.), and can support complex statements (for example, you can specify a search on u11 teams that have a team name that starts with "fr" or ends with "al"). the second code snippet shows a view function (resource handler) for displaying all of our u09 teams. in this case we specify that we want to filter for all records where the team_level field has exactly the text 'u09' (note below how this criteria is passed...
...f document. web frameworks often provide a mechanism to make it easy to generate other formats from stored data, including json and xml. for example, the django template system allows you to specify variables using a "double-handlebars" syntax (e.g. {{ variable_name }}), which will be replaced by values passed in from the view function when a page is rendered. the template system also provides support for expressions (with syntax: {% expression %}), which allow templates to perform simple operations like iterating list values passed into the template. note: many other templating systems use a similar syntax, e.g.: jinja2 (python), handlebars (javascript), moustache (javascript), etc. the code snippet below shows how this works. continuing the "youngest team" example from the previous s...
...And 11 more matches
Experimental features in Firefox
imental features, you need to download firefox nightly or firefox developer edition. which you need is described alongside each feature's description below. editor's note: when adding features to these tables, please try to include a link to the relevant bug or bugs using the bug macro: {{bug(bug-number)}}. html element: <dialog> the html <dialog> element and its associated dom apis provide support for html-based modal dialog boxes. the current implementation is a little inelegant but is basically functional. see bug 840640 for more details. release channel version added enabled by default? nightly 53 yes developer edition 53 no beta 53 no release 53 no preference name dom.dialog_element.enabled ...
...hey are focused using a mouse or other pointing device. see bug 1617600 for more details. release channel version added enabled by default? nightly 75 no developer edition 75 no beta 75 no release 75 no preference name layout.css.focus-visible.enabled single numbers as aspect ratio in media queries support for using a single <number> as a <ratio> when specifying the aspect ratio for a media query. see bug 1565562 for more details. release channel version added enabled by default? nightly 70 no developer edition 70 no beta 70 no release 70 no preference name layout.css.aspect-ratio-number.enabled p...
...kdrop-filter property applies filter effects to the area behind an element. see bug 1178765 for more details. release channel version added enabled by default? nightly 70 no developer edition 70 no beta 70 no release 70 no preference name layout.css.backdrop-filter.enabled grid: masonry layout adds support for a masonry style layout based on grid layout where one axis has a masonry layout while having normal grid layout on the other. this allows to create gallery style layouts like on pinterest. see bug 1607954 for more details. release channel version added enabled by default? nightly 77 no developer edition 77 no beta 77 no ...
...And 11 more matches
XPCOM primitive
table below. primitives are rarely useful. the main use case is to store primitive values in a data structure that can only store xpcom objects, such as nsiarray. also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...are rarely useful. the main use case is to store primitive values in a data structure that can only store xpcom objects, such as nsiarray. also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...e that can only store xpcom objects, such as nsiarray. also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...And 11 more matches
Using the clipboard
t version. the transferring object will hold the clipboard contents until the application has decided what it needs. this allows the clipboard to be used by another application right away. let's break down the steps needed to copy data to the clipboard. first, we need to create an xpcom object to wrap what we want to copy. we'll assume that we want to copy some text. ...
...terface nsisupportsstring which can be used to represent strings (specifically, unicode strings). the following boilerplate utility functions will be used in all later code examples. // import the services module for future use, if we're not in // a browser window where it's already loaded. components.utils.import('resource://gre/modules/services.jsm'); // create a constructor for the built-in supports-string class. ...
... can be used to represent strings (specifically, unicode strings). the following boilerplate utility functions will be used in all later code examples. // import the services module for future use, if we're not in // a browser window where it's already loaded. components.utils.import('resource://gre/modules/services.jsm'); // create a constructor for the built-in supports-string class. ...
...And 11 more matches
GestureEvent - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBFactory.deleteDatabase() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBFactory.open() - Web APIs
Web › API › IDBFactory › open
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.keyPath - Web APIs
Web › API › IDBIndex › keyPath
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.multiEntry - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.objectStore - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.openCursor() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.openKeyCursor() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...se check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBIndex.unique - Web APIs
Web › API › IDBIndex › unique
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.add() - Web APIs
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.autoIncrement - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...se check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.clear() - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.count() - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.createIndex() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.delete() - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.deleteIndex() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.get() - Web APIs
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.index() - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.indexNames - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.keyPath - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.openCursor() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.put() - Web APIs
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBObjectStore.transaction - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBOpenDBRequest.onblocked - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
atibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBVersionChangeEvent.newVersion - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
IDBVersionChangeEvent.oldVersion - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 more matches
KeyboardEvent.getModifierState() - Web APIs
ko? ...
...fn key on mac keyboard doesn't cause this active. "fnlock" not...
...d level 3 shift key (or level 5 shift key ) pressed ⌄ option key pressed not supported "capslock" during led for ⇪ caps lock turned on not supported while capslock is locked "control" either ctrl key or altgr key pressed ctrl key pressed control key pressed menu key pressed. ctrl key, control key or menu key pressed. "fn" not supported function key is pressed, but we're not sure what key makes the modifier state active. fn key on mac keyboard doesn't cause this active. ...
...And 11 more matches
Window.showModalDialog() - Web APIs
ble in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 11 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 superscript or subscript. the glyphs are positioned relative to the baseline of the font, which remains unchanged. these glyphs are typically used in <sub> and <sup> elements. /* keyword values */ font-variant-position: normal; font-variant-position: sub; font-variant-position: super; /* global values */ font-variant-position: inherit; font-variant-position: initial; font-variant-position: unset; when the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs. these alternate glyphs share the same em-box and t...
...dered using a fallback method, synthesizing these glyphs. these alternate glyphs share the same em-box and the same baseline as the rest of the font. they are merely graphically enhanced, and have no effect on the line-height and other box characteristics. syntax the font-variant-position property is specified as one of the keyword values listed below. values normal deactivates alternate superscript and subscript glyphs. sub activates subscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. super activates superscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. ...
...glyphs. super activates superscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. formal definition initial valuenormalapplies toall elements. ...
...And 11 more matches
Authoring MathML - MathML
our demos and mathml references for more details. using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> content mathml is not supported by browsers. it's recommended to convert your content mathml markup into presentation mathml before publishing it, for example with the help of the ctop.xsl stylesheet. tools mentioned on this page generates presentation mathml. fallback for browsers without mathml support unfortunately, some browsers are not able to render mathml equations or only have a limited support. hence you will ...
...tead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). there is also a similar script to display a warning at the top of the page for browsers without good mathml support and let the users choose between one of the fallback above: <script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script> if you don't want to use this link to github but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of mathml support. for example the following function verifies the mathml ...
...port and let the users choose between one of the fallback above: <script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script> if you don't want to use this link to github but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of mathml support. ...
...And 11 more matches
Features restricted to secure contexts - Web security
this reference lists the web platform features available only in secure contexts — see secure contexts for a definition and more details. current features available only in secure contexts this section lists all the apis available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. ...
...texts — see secure contexts for a definition and more details. current features available only in secure contexts this section lists all the apis available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. note: only the browsers that actually support secure contexts are listed in this document. see here for information on secure contexts support. ...
...s this section lists all the apis available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. note: only the browsers that actually support secure contexts are listed in this document. see here for information on secure contexts support. ...
...And 11 more matches
cfx - Archive of obsolete content
cfx is no longer supported as of firefox 44 and no longer accepted for add-on submission. jpm should now be used instead. for information on how to migrate from cfx to jpm see this guide. enables you to test, run, and package add-ons. cfx is is no longer supported as of firefox 44 and no longer accepted for add-on submission, jpm should now be used instead. cfx usage is: cfx [options] command [command-specific options] "options" are global options applicable to the tool itself or to all commands (for example --help). cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of output "command-specific options" are documented alongside the commands. ...
... cfx run launch an instance of firefox with your add-on installed. ...
... main.md lib main.js package.json readme.md tests test-main.js cfx run this command is used to run the add-on. called with no options it looks for a file called package.json in the current directory, loads the corresponding add-on, and runs it under the version of firefox it finds in the platform's default install path. supported options you can point cfx run at a different package.json file using the --pkgdir option, and pass arguments to your add-on using the --static-args option. you can specify a different version of the host application using the --binary option, passing in the path to the application binary to run. the path may be specified as a full path or may be relative to the current directory. but note...
...And 10 more matches
Index - Learn web development
nter, showing how they can help us solve such problems. 55 making asynchronous programming easier with async and await beginner, codingscripting, guide, javascript, learn, promises, async, asynchronous, await more recent additions to the javascript language are async functions and the await keyword, part of the so-called ecmascript 2017 javascript edition (see ecmascript next support in mozilla). these features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. they make async code look more like old-school synchronous code, so they're well worth learning. this article gives you what you need to know. 56 client-side web apis api, articles, beginner, codingscripting, dom, graphics, javascript...
... the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements. there are a large number of these, and they often serve quite specific purposes. once you know how to use them, you can look at the list to see if there is something which works for the task you are trying to achieve. once again the relevant mdn page for each selector is helpful in explaining browser support. 111 test your skills: selectors beginner, css the aim of this task is to help you check your understanding of selectors in css. 112 test your skills: the box model beginner, css the aim of this task is to help you check your understanding of the css box model. 113 type, class, and id selectors beginner, css, class, learn, selectors, id...
..., sizing, viewport units this lesson has given you a rundown of some key issues that you might run into when sizing things on the web. when you move onto css layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the concepts here before moving on. 124 styling tables article, beginner, css, codingscripting, guide, needsupdate, styling, tables with styling tables now behind us, we need something else to occupy our time. the next article explores debugging css — how to solve problems such as layouts not looking like they should, or properties not applying when you think they should. this includes information on using browser devtools to find solutions to your problems. 125 test your skills: images...
...And 10 more matches
NSS_3.12_release_notes.html
note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases. we missed the deadline to enable that feature in firefox 3. distribution information the cvs tag for the nss 3.12 release is nss_3_12_rtm. nss 3.12 requires nspr 4.7.1. see the documenta...
...uleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camellia nss_camellia_cbc camellia_block_size new macros for rsa (see blapit.h): rsa_max_modulus_bits rsa_max_exponent_bits new macros in certt.h: x.509 v3 ku_encipher_only cert_max_serial_number_bytes cert_max_dn_bytes pkix cert_rev_m_do_not_test_using_this_method cert_rev_m_test_using_this_method cert_rev_m_allow_network_fetching cert_rev_m_forbid_network_fetchi...
...t.h) sec_oid_pkcs12_key_usage changed to sec_oid_bogus_key_usage sec_oid_ansix962_ecdsa_signature_with_sha1_digest changed to sec_oid_ansix962_ecdsa_sha1_signature note: sec_oid_ansix962_ecdsa_signature_with_sha1_digest is also kept for compatibility reasons. ...
...And 10 more matches
Finishing the Component
faces and functions are part of the gecko sdk. the rule of thumb is that interfaces outside of the sdk are considered "experimental" or unfrozen. see the following sidebar for information about how frozen and unfrozen interfaces can affect your component development, and for technical details about how interface changes beneath your code can cause havoc. ...
...ng unfrozen interfaces suppose that you need to use the interface nsifoo that isn't frozen. you build your component using this interface, and it works great with the version of gecko that you have tested against. however, some point in the future, the nsifoo interface requires a major change, and methods are reordered, some are added, others are removed. moreover, since this interface was never supposed to be used by clients other than gecko or mozilla, the maintainers of the interface don't know that it's being used, and don't change the iid of the interface. when your component runs in a version of gecko in which this interface is updated, your method calls will be routed through a different v-table than the one the component expected, most likely resulting in a crash. below, the compone...
... interface; the first entry in the v-table is in fact isprime(). when this method call is made, the code execution treats the isprime method as testa. needless to say, this is a bad thing. furthermore, there is no way easy way to realize this error at runtime. gecko developers could change the interface's iid, and some do. this can prevent many errors like this. but unfrozen interfaces are not supported in any formal way, and relying upon a different iid for any change in the interface is not a good idea either. when using frozen interfaces, you are guaranteed compatibility with future versions of gecko. the only trouble occurs when the compiler itself changes its v-table layout, which can happen when the compiler changes its abi. for example, in 2002 the gnu compiler collection (gcc), ve...
...And 10 more matches
AddressErrors - Web APIs
rs dictionary is used by the payment request api to to report validation errors in a physical address (typically a billing address or a shipping address). any members which is present indicates that a validation error occurred for the member of the same name in an address described using paymentaddress. addresserrors is the type of the object returned by shippingaddresserrors in the paymentdetailsupdate passed into paymentrequestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. see the examples below to see how this works. properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated. the contents of the string provide a hum...
...of the example above (except of course that it's not connected to an actual payment handler, so no payments are actually processed). in the example, we're handling a donation to an organization that will be sending a "thank you" gift to the donor, so it requests shipping information along with allowing the donation payment itself. ...
...tually processed). in the example, we're handling a donation to an organization that will be sending a "thank you" gift to the donor, so it requests shipping information along with allowing the donation payment itself. javascript payment request data first, we declare the variables supportedhandlers, which is compatible with paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object. ...
...And 10 more matches
readValue() - Web APIs
otherwise it throws an error. syntax bluetoothremotegattdescriptor.readvalue().then(function(value[]) { ... }) returns a promise that resolves to an arraybuffer. specifications specification status comment web bluetooththe definition of 'readvalue()' in that specification. draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...And 10 more matches
Event.initEvent() - Web APIs
Web › API › Event › initEvent
ent('click', true, false); // listen for the event. elem.addeventlistener('click', function (e) { // e.target matches elem }, false); elem.dispatchevent(event); specifications specification status comment domthe definition of 'event.initevent()' in that specification. living standard from document object model (dom) level 2 events specification, deprecated it, superseded by event constructors. document object model (dom) level 2 events specificationthe definition of 'event.initevent()' in that specification. obsolete initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and s...
...mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
FederatedCredential - Web APIs
the federatedcredential interface of the the credential management api provides information about credentials from a federated identity provider. a federated identity provider is an entity that a website trusts to correctly authenticate a user, and that provides an api for that purpose. openid connect is an example of a federated identity provider framework. in browsers that support it, an instance of this interface may be passed in the credential member of the init object for global fetch. constructor federatedcredential() creates a new federatedcredential object. properties inherits properties from its ancestor, credential. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol ...
...table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
IDBVersionChangeRequest - Web APIs
his page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...net exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbversionchangerequest deprecatednon-standardchrome no support 12 — 23prefixed no support 12 — 23prefixed prefixed implemented with the vendor prefix: webkitedge ? ...
...And 10 more matches
PaymentRequest.onshippingoptionchange - Web APIs
ed by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated option is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. ...
...ts are excerpted for clarity. ...
...ar shippingoption = { id: '', label: '', amount: { currency: 'usd', value: '0.00' }, selected: true }; // shipping to us is supported if (addr.country === 'us') { shippingoption.id = 'us'; shippingoption.label = 'standard shipping in us'; shippingoption.amount.value = '0.00'; details.total.amount.value = '55.00'; // shipping to jp is supported } else if (addr.country === 'jp') { shippingoption.id = 'jp'; shippingoption.label = 'international shipping'; shippingoption.amount.value = '10.00'; details.total.amount.value = '65.00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details.shippingoptions = []; return promise.resolve...
...And 10 more matches
PhotoCapabilities - Web APIs
capabilities object is retrieved by calling imagecapture.getphotocapabilities(). properties photocapabilities.redeyereduction read only returns one of "never", "always", or "controllable". the "controllable" value means the device's read-eye reduction is controllable by the user. photocapabilities.imageheight read only returns a mediasettingsrange object indicating the image height range supported by the user agent. photocapabilities.imagewidth read only returns a mediasettingsrange object indicating the image width range supported by the user agent. photocapabilities.filllightmode read only returns an array of available fill light options. options may include auto, off, or flash. example the following example, extracted from chrome's image capture / photo resolution sample,...
...y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
PushEvent.PushEvent() - Web APIs
e on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...o contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpushevent() constructor experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. ...
...And 10 more matches
PushEvent.data - Web APIs
Web › API › PushEvent › data
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdata experimentalchrome full support 57edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable service workers preference. ...
...And 10 more matches
StorageManager.persist() - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
Window.event - Web APIs
Web › API › Window › event
the read-only window property event returns the event which is currently being handled by the site's code. outside the context of an event handler, the value is always undefined. you should avoid using this property in new code, and should instead use the event passed into the event handler function. this property is not universally supported and even when supported introduces potential fragility to your code. note: this property can be fragile, in that there may be situations in which the returned event is not the expected value. in addition, window.event is not accurate for events dispatched within shadow trees. specifications specification status comment domthe definition of 'window.event' in that specification. living standard initial definition. ...
...ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
Web applications and ARIA FAQ - Accessibility
provides additional structural information, helping authors identify landmarks, regions, and grids on their pages. aria enables dynamic, javascript-driven applications and widgets to interoperate with a variety of desktop-based assistive technologies. for more information about how to create accessible widgets with aria, see the overview of accessible web applications and widgets. where is aria supported? aria is a relatively new specification, but support for it is growing. a wide variety of commonly-used browsers, assistive technologies, javascript toolkits, and applications now support aria. however, many users may still be using older versions of these technologies. you may want to consider implementing aria using progressive enhancement techniques—such as adding aria using javascrip...
...for it is growing. a wide variety of commonly-used browsers, assistive technologies, javascript toolkits, and applications now support aria. however, many users may still be using older versions of these technologies. you may want to consider implementing aria using progressive enhancement techniques—such as adding aria using javascript, not directly to your markup—in order to more gracefully support older browsers and assistive technologies. ...
... technologies, javascript toolkits, and applications now support aria. however, many users may still be using older versions of these technologies. you may want to consider implementing aria using progressive enhancement techniques—such as adding aria using javascript, not directly to your markup—in order to more gracefully support older browsers and assistive technologies. browsers aria is supported in the following browsers: browser minimum version notes firefox 3.0+ works with nvda, jaws 10+, and orca chrome latest screen reader support still experimental as of chrome 15 safari 4+ safari 5 support is much improved. ...
...And 10 more matches
quotes - CSS: Cascading Style Sheets
Web › CSS › quotes
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
ruby-position - CSS: Cascading Style Sheets
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
Live streaming web audio and video - Developer guides
media will start playing more quickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for serving adaptive streams; let's take a look at the options. http for now, http is by far the most commonly supported protocol used to transfer media on demand or live. rtmp real time messaging protocol (rtmp) is a proprietary protocol developed by macromedia (now adobe) and supported by the adobe flash plugin. rtmp comes in various flavours including rtmpe (encrypted), rtmps (secure over ssl/tls) and rtmpt (encapsulated within http requests). rtsp real time streaming protocol (rtsp) controls media se...
...vours including rtmpe (encrypted), rtmps (secure over ssl/tls) and rtmpt (encapsulated within http requests). rtsp real time streaming protocol (rtsp) controls media sessions between endpoints and is often used together with real-time transport protocol (rtp) and with real-time control protocol (rtcp) for media stream delivery. using rtp with rtcp allows for adaptive streaming. ...
...pt (encapsulated within http requests). rtsp real time streaming protocol (rtsp) controls media sessions between endpoints and is often used together with real-time transport protocol (rtp) and with real-time control protocol (rtcp) for media stream delivery. using rtp with rtcp allows for adaptive streaming. this is not yet supported natively in most browsers, but be aware that firefox os 1.3 supports rtsp. ...
...And 10 more matches
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
e value is in the format "yyyy-mm", where yyyy is the four-digit year and mm is the month number. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...epository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop — and most modern mobile browser versions — having usable implementations. in browsers that don't support month inputs, the control degrades gracefully to a simple <input type="text">, although there may be automatic validation of the entered text to ensure it's formatted as expected. for those of you using a browser that doesn't support month, the screenshot below shows what it looks like in chrome and opera. clicking the down arrow on the right hand side brings up a date picker that lets you s...
... idl attributes value methods select(), stepdown(), stepup(). value a domstring representing the value of the month and year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). ...
...And 10 more matches
WebAssembly.CompileError - JavaScript
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
WebAssembly.Global - JavaScript
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
WebAssembly.LinkError - JavaScript
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
WebAssembly.RuntimeError - JavaScript
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 10 more matches
XUL Migration Guide - Archive of obsolete content
this guide aims to help you migrate a xul-based add-on to the sdk. first we'll outline how to decide whether your add-on is a good candidate for migration via a comparison of the benefits and limitations of the sdk versus xul development. ...
... this guide aims to help you migrate a xul-based add-on to the sdk. first we'll outline how to decide whether your add-on is a good candidate for migration via a comparison of the benefits and limitations of the sdk versus xul development. ...
... if your add-on needs a lot of help from third party packages, low-level apis, or xpcom, then the cost of migrating is high, and may not be worth it at this point. ...
...And 9 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
e. for more information about the role of cas, see "how ca certificates are used to establish trust". authentication confirms an identity authentication is the process of confirming an identity. in the context of network interactions, authentication involves the confident identification of one party by another party. authentication over networks can take many forms. certificates are one way of supporting authentication. network interactions typically take place between a client, such as browser software running on a personal computer, and a server, such as the software and hardware used to host a web site. client authentication refers to the confident identification of a client by a server (that is, identification of the person assumed to be using the client software). server authenticati...
...a client by a server (that is, identification of the person assumed to be using the client software). server authentication refers to the confident identification of a server by a client (that is, identification of the organization assumed to be responsible for the server at a particular network address). client and server authentication are not the only forms of authentication that certificates support. for example, the digital signature on an email message, combined with the certificate that identifies the sender, provide strong evidence that the person identified by that certificate did indeed send that message. similarly, a digital signature on an html form, combined with a certificate that identifies the signer, can provide evidence, after the fact, that the person identified by that ce...
...s of server authentication via ssl. the user has requested a resource controlled by the server. the server requires client authentication before permitting access to the requested resource. these are the steps shown in figure 4: in response to an authentication request from the server, the client displays a dialog box requesting the user's name and password for that server. the user must supply a name and password separately for each new server the user wishes to use during a work session. the client sends the name and password across the network, either in the clear or over an encrypted ssl connection. the server looks up the name and password in its local password database and, if they match, accepts them as evidence authenticating the user's identity. the server determines whet...
...And 9 more matches
Client-side form validation - Learn web development
try out the new behavior in the example below: note: you can find this example live on github as fruit-validation.html (see also the source code.) try submitting the form without a value. note how the invalid input gets focus, a default error message ("please fill out this field") appears, and the form is prevented from being sent. the presence of the required attribute on any element that supports this attribute means the element matches the :required pseudoclass whether it has a value or not. if the <input> has no value, the input will match the :invalid pseudoclass. note: for good user experience, indicate to the user when form fields are required. it isn't only good user experience, it is required by wcag accessibility guidelines. also, only require users to input data you actual...
...ashed red; } input:valid { border: 2px solid black; } this gives us the following update — try it out: note: you can find this example live on github as fruit-pattern.html (see also the source code.) in this example, the <input> element accepts one of four possible values: the strings "banana", "banana", "cherry", or "cherry". regular expressions are case-sensitive, but we've made it support capitalized as well as lower-case versions using an extra "aa" pattern nested inside square brackets. at this point, try changing the value inside the pattern attribute to equal some of the examples you saw earlier, and look at how that affects the values you can enter to make the input value valid. try writing some of your own, and see how it goes. make them fruit-related where possible so ...
...t will match the :invalid pseudoclass. note: some <input> element types don't need a pattern attribute to be validated against a regular expression. specifying the email type, for example, validates the inputs value against a well-formed email address pattern or a pattern matching a comma-separated list of email addresses if it has the multiple attribute. note: the <textarea> element doesn't support the pattern attribute. constraining the length of your entries you can constrain the character length of all text fields created by <input> or <textarea> by using the minlength and maxlength attributes. a field is invalid if it has a value and that value has fewer characters than the minlength value or more than the maxlength value. browsers often don't let the user type a longer value th...
...And 9 more matches
Introduction to client-side frameworks - Learn web development
here are many frameworks out there, but currently the "big four" are considered to be the following. ember ember was initially released in december 2011 as a continuation of work that started in the sproutcore project. it is an older framework that has less users than more modern alternatives such as react and vue, but it still enjoys a fair amount of popularity due to its stability, community support, and some clever coding principles. start learning ember angular angular is an open-source web application framework led by the angular team at google and by a community of individuals and corporations. it is a complete rewrite from the same team that built angularjs. angular was officially released on the 14th of september 2016. angular is a component-based framework which uses declarati...
...of individuals and corporations. it is a complete rewrite from the same team that built angularjs. angular was officially released on the 14th of september 2016. angular is a component-based framework which uses declarative html templates. at build time, transparently to developers, the framework's compiler translates the templates to optimized javascript instructions. angular uses typescript, a superset of javascript that we’ll look at in a little more detail in the next chapter. vue evan you first released vue in 2014, after working on and learning from the original angularjs project. vue is the youngest of the big four, but has enjoyed a recent uptick in popularity. vue, like angularjs, extends html with some of its own code. apart from that, it mainly relies on modern, standard java...
...– by dealing with the dom interactions for you, behind the scenes. this abstraction is great for your experience as a developer, but it isn't free. in order to translate what you write into dom changes, frameworks have to run their own code, which in turn makes your final piece of software larger and more computationally expensive to operate. some extra code is inevitable, and a framework that supports tree-shaking (removal of any code that isn't actually used in the app during the build process) will allow you to keep your applications small, but this is still a factor you need to keep in mind when considering your app's performance, especially on more network/storage-constrained devices, like mobile phones. the abstraction of frameworks affects not only your javascript, but your relatio...
...And 9 more matches
Accessibility Features in Firefox
in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. ...
...in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. ...
...xplorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and app reader. we are also optimistic that the the makers of magic and lunar/supernova will add firefox support in the coming year. mozilla has support for dragon naturally speaking. some users of the professional version are happily playing with dragon and firefox. we are optimistic that nuance will work to improve access to the user int...
...And 9 more matches
Mozilla accessibility architecture
this page is maintained by aaron leventhal and by the mozilla accessibility community. feedback and constructive suggestions are encouraged. 1. intro this document is for people who wish to understand the architecture of mozilla's accessibility api module, which provides support for platform accessibility apis. accessibility apis are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need information about document content and ui controls, as well as important events like changes of focus. mozilla supports two accessibility apis: microsoft active accessibility (msaa) on windows and accessibility tool kit (atk) on linux and unix. we do not currently support the carbon accessibility model for apple's os x. please note, the documentatio...
...if you're interested in linux or unix accessibility, check out mozilla's atk project page. readers of this document should be familiar with interfaces, the w3c dom, xul and the concept of a layout object tree. 2. ...
...the code in a cross platform manner, and then deal with the platform differences on a consistent manner. the shared code makes itself available to the toolkit-specific code via generic xpcom interfaces that return information about objects we want to expose. all focusable nodes, tables and text have accessibility interfaces. we call these objects "accessible nodes". ...
...And 9 more matches
A bird's-eye view of the Mozilla framework
urpose the purpose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework. it examines what happens when the user performs a simple user interface (ui) action such as clicking a link in the contents panel of the help viewer window shown below. the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the individual applications themselves. prerequisites this article assumes you have access to mozilla sources and are familiar with the directory structure of the source tree. the code samples in the article are based on mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9a1) gecko/20051104 seamonkey/1.1a from a new source tree c...
...liar with the javascript and c++ programming languages, object-oriented programming (oop) terminology and design concepts, the microsoft® component object model (com), and the corba omg interface definition language (idl). organization this article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key mozilla architectural components work together to support a simplehelp viewer ui action. framework layers at a high level, you can think of the mozilla framework as consisting of a suite of applications, each of which is organized into three basic layers depicted in figure 1. figure 1. user interface (ui) widgets and services the x window system toolkit defines the termwidget as a pre-defined object that encapsulates both the command actio...
...connect. xpconnect also provides a required layer for xpcom components written in a scripting language. let’s consider a resource description framework (rdf) example, where rdf is a framework for describing and interchangingmetadata, that is, information about information. in this example, we’re interested in the rdf sub-graph underlying thecontents panel widget within thehelp viewer window. suppose the client already has an nsirdfdatasource object representing a sub-graph of an rdf graph and calls nsirdfdatasource.gettarget(resource, nc_link, true) to obtain an nsirdfnode representing a specific node in the graph, in this case a link to ahelp viewer document page. the client is completely unaware of which c++ class (or other language) actually implements nsirdfnode; it only interacts wi...
...And 9 more matches
Mozilla Web Developer FAQ
block. if the table cells that contain only an image are marked with <td class="imgcell">, the required css rule is: .imgcell img, .imgcell a { display: block; } longer explanation… why are there still gaps even between text rows in tables when the layout engine is in the standards mode or in the almost standards mode? in the standards mode and in the almost standards mode mozilla does not suppress the default margins of the first and last child element in table cells. therefore, the default margins for paragraphs apply even with markup such as <td><p>foo</p></td>. often the content of a cell in a table of tabular data does not constitute a paragraph. in that case, the easy solution is not to mark the contents of the cell as a paragraph. when the paragraph markup is called for but th...
...he block box itself. a block is centered by setting its margin-left and margin-right to auto and its width to a value that makes the block narrower than its containing block. it is also possible, although not very likely, that you are seeing a bug. javascript doesn’t work! why? some proprietary document objects such as document.all and document.layers are not part of the w3c dom and are not supported in mozilla. (there is partial undetectable support for document.all, though, in newer versions of mozilla. however, that functionality only exists for compatibility with sites authored specifically for ie. you should not rely on mozilla’s document.all support on new pages.) the method document.getelementbyid() can be used instead. in the standards mode mozilla does not generate implicit ...
...uthors to misuse the attribute. when the alternative text is shown in a tooltip, some authors write bad alt texts, because they intend the text as auxiliary tooltip text and not as a replacement for the image. (‘bad’ in the sense that the textual alternative is less useful for people who don’t see the image.) when the alternative text is shown in a tooltip, other authors don’t want to supply textual alternatives at all, because they don’t want tooltips to appear. (again, making things harder for people who don’t see the image.) there is another attribute that mozilla shows as a tooltip: title. in fact, the html 4.01 specification suggests that the title attribute may be displayed as a tooltip. however, this particular display method is not required and some other browsers sh...
...And 9 more matches
NSS FAQ
Mozilla › Projects › NSS › FAQ
general questions what is network security services (nss) nss is set of libraries, apis, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications. it provides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products. for an overview of nss, see overview of nss. for detailed information on the open-source nss project, see nss project page. what can i do with nss? is nss appropriate for my application? if you want add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to do so. because nss provides...
...d hat, and other products. for an overview of nss, see overview of nss. for detailed information on the open-source nss project, see nss project page. what can i do with nss? is nss appropriate for my application? if you want add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to do so. because nss provides complete support for all versions of ssl and tls, it is particularly well-suited for applications that need to communicate with the many clients and servers that already support the ssl protocol. the pkcs #11 interface included in nss means that your application can use hardware accelerators on the server and smart cards for two-factor authentication. how does nss compare to openssl? openssl is an open s...
...te with the many clients and servers that already support the ssl protocol. the pkcs #11 interface included in nss means that your application can use hardware accelerators on the server and smart cards for two-factor authentication. how does nss compare to openssl? openssl is an open source project that implements server-side ssl, tls, and a general-purpose cryptography library. it does not support pkcs #11. it is based on the ssleay library developed by eric a. young and tim j. hudson. openssl is widely used in apache servers and is licensed under an apache-style licence. nss supports both server and client applications as well as pkcs #11 and s/mime. to permit its use in as many contexts as possible, nss is licensed under the mozilla public license, version 2. how does nss compare ...
...And 9 more matches
NSS 3.14 release notes
the nss license has changed to mpl 2.0. previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license. ...
... the nss license has changed to mpl 2.0. previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license. ...
... the nss license has changed to mpl 2.0. previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license. ...
...And 9 more matches
PKCS11 Implement
implementing pkcs #11 for nss note: this document was originally for the netscape security library that came with netscape communicator 4.0. this note will be removed once the document is updated for the current version of nss. this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. function-specific information organized in the same categories as the pkcs #11 specification. functions for different kinds of tokens. summarizes the support nss expects from different kinds of tokens. installation. installing modules and informing the user of changes in the cryptographic modules se...
...how nss calls pkcs #11 functions this section is organized according to the categories used in pkcs #11: cryptographic token interface standard, version 2.0. to understand this section, you should be familiar with the standard specification. ...
...in the single c_initialize parameter preserved. c_finalize the nss calls c_finalize on shutdown and whenever it unloads a module. c_getfunctionlist the nss calls c_getfunctionlist on startup or when it loads a new module. the function list returned should include all the pkcs 2.0 function calls. if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported. c_getinfo the nss calls c_getinfo on startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed when the user views the information. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of ...
...And 9 more matches
nsIDragService
add-ons should use the standard datatransfer drag and drop api instead. the only exception is getcurrentsession(), since there's currently no way to check for a drag in progress using standard dom methods or properties. ...
... enddragsession( in prbool adonedrag ) ; void dragmoved(in long ax, in long ay); native code only! void firedrageventatsource(in unsigned long amsg); obsolete since gecko 43 void firedrageventatsource(in mozilla::eventmessage aeventmessage); native code only! ...
...g); obsolete since gecko 43 void firedrageventatsource(in mozilla::eventmessage aeventmessage); native code only! ...
...And 9 more matches
nsIXULTemplateQueryProcessor
ultemplatequeryprocessor.idlscriptable a query processor takes a template query and generates results for it given a datasource and a reference point. there is a one-to-one relationship between a template builder and a query processor. the template builder creates the query processor, and there is no other means to retrieve it. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) a query processor takes a template query and generates results for it given a datasource and a reference point. there is a one-to-one relationship between a template builder and a query processor. the template builder creates the query processor, and there is no other means to retrieve it. a template query is the contents inside a <query> element within...
...re is no other means to retrieve it. a template query is the contents inside a <query> element within the template. the actual syntax is opaque to the template builder and defined by a query processor. the query is expected to consist of either text or dom nodes that, when executed by a call to the generateresults() method, will allow the generation of a list of results. the template builder will supply two variables, the reference variable and the member variable to further indicate what part of the datasource is to be examined in addition to the query itself. the reference is always a placeholder for the starting point and the member is always a placeholder for the end points (the results). the reference point is important when generating output recursively, as the query will be the same fo...
...compilequery() for each query in the template to compile the queries. when results need to be generated, the builder will call generateresults(). the initializeforbuilding(), compilequery() and addbinding() methods may not be called after generateresults() has been called until the builder indicates that the generated output is being removed by calling the done() method. currently, the datasource supplied to the methods will always be an nsirdfdatasource or a dom node, and will always be the same one in between calls to initializeforbuilding() and done(). method overview void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorth...
...And 9 more matches
AudioParam.cancelAndHoldAtTime() - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
characteristic - Web APIs
lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcharacteristic experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...le-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). ...
...And 9 more matches
uuid - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetuuid experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...le-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). ...
...And 9 more matches
value - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...le-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). ...
...And 9 more matches
writeValue() - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwritevalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change...
...port 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. ...
...le-experimental-web-platform-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). ...
...And 9 more matches
EventTarget.addEventListener() - Web APIs
addeventlistener() works by adding a function or an object that implements eventlistener to the list of event listeners for the specified event type on the eventtarget on which it's called. ...
...event that has occurred, and it returns nothing. for example, an event handler callback that can be used to handle both fullscreenchange and fullscreenerror might look like this: function eventhandler(event) { if (event.type == 'fullscreenchange') { /* handle a full screen toggle */ } else /* fullscreenerror */ { /* handle a full screen toggle error */ } } safely detecting option support in older versions of the dom specification, the third parameter of addeventlistener() was a boolean value indicating whether or not to use capture. over time, it became clear that more options were needed. rather than adding more parameters to the function (complicating things enormously when dealing with optional values), the third parameter was changed to an object that can contain various...
...tions to configure the process of removing the event listener. because older browsers (as well as some not-too-old browsers) still assume the third parameter is a boolean, you need to build your code to handle this scenario intelligently. you can do this by using feature detection for each of the options you're interested in. ...
...And 9 more matches
FileSystemFileEntry - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemfileentrychrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: fileentryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie no support noopera no support nosafari full support ...
...And 9 more matches
HTMLImageElement.decoding - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
HTMLImageElement.src - Web APIs
pecifying the url of the desired image. this can be set either within the html itself using the src content attribute, or programmatically by setting the element's src property. if you use the srcset content attribute to provide multiple image options for different display pixel densities, the url specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset. as an equivalent for specifying an image in srcset with the size multiplier 1x; that is, the image specified by src is used on low-density screens (such as typical 72 dpi or 96 dpi displays). additionally, if you use src along with both sizes (or the corresponding sizes content attribute) and srcset in order to choose an image based on the viewport size, the src attribute is only u...
...ing an image in srcset with the size multiplier 1x; that is, the image specified by src is used on low-density screens (such as typical 72 dpi or 96 dpi displays). additionally, if you use src along with both sizes (or the corresponding sizes content attribute) and srcset in order to choose an image based on the viewport size, the src attribute is only used as a fallback for browsers that don't support sizes and srcset; otherwise, it's not used at all. examples specifying a single image html <img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg" width="160" alt="slices of grapefruit, looking yummy."> result using src with an image set when using a set of images with the srcset property, the src serves as either a fallback for older browsers, or as the 1x size...
...th an image set when using a set of images with the srcset property, the src serves as either a fallback for older browsers, or as the 1x size of the image. html result specifying a fallback for viewport-based selection when using viewport-bases selection of an image from a srcset by also specifying the sizes property, the src property serves as the fallback to be used on browsers that don't support viewport-based selection. browsers that do support viewport-based selection will ignore src in this situation. html result specifications specification status comment html living standardthe definition of 'htmlimageelement.src' in that specification. living standard browser compatibility the compatibility table on this page is generated from stru...
...And 9 more matches
IDBDatabase.transaction() - Web APIs
transaction unless you actually need to write into the database. if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a sm...
...nnot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config. details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store specified in in the storenames parameter has been deleted ...
... the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
ImageCapture.takePhoto() - Web APIs
bpromise = imagecaptureobj.takephoto([photosettings]) parameters photosettings optional an object that sets options for the photo to be taken. the available options are: filllightmode: the flash setting of the capture device, one of "auto", "off", or "flash". imageheight: the desired image height as an integer. the user agent selects the closest height value to this setting if it only supports discrete heights. imagewidth: the desired image width as an integer. the user agent selects the closest width value to this setting if it only supports discrete widths. redeyereduction: a boolean indicating whether the red-eye reduction should be used if it is available. return value a promise that resolves with a blob. example this example is extracted from this simple image ca...
...atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
Key Values - Web APIs
0xff7f) qt::key_numlock (0x01000025) keycode_num_lock (143) "scrolllock" [2] the scroll lock key. toggles between scrolling and cursor movement modes. vk_scroll (0x91) gdk_key_scroll_lock (0xff14) qt::key_scrolllock (0x01000026) keycode_scroll_lock (116) "shift" the shift key. ...
...ft key. modifies keystrokes to allow typing upper (or other) case letters, and to support typing punctuation and other special characters. vk_shift (0x10) vk_lshift (0xa0) vk_rshift (0xa1) kvk_shift (0x38) kvk_rightshift (0x3c) gdk_key_shift_l (0xffe1) gdk_key_shift_r (0xffe2) qt::key_shift (0x01000020) keycode_shift_left (59) keycode_shift_right (60) "super" [4] the super key. gdk_key_super_l (0xffeb) gdk_key_super_r (0xffec) qt::key_super_l (0x01000053) qt::key_super_r (0x01000054) "symbol" the symbol modifier key (found on certain virtual keyboards). keycode_sym (63) [3] "symbollock" the symbol lock key. [1] in internet explorer (tested on release 9 and 1...
...63) [3] "symbollock" the symbol lock key. [1] in internet explorer (tested on release 9 and 11), as well as in all versions of firefox, the windows key is reported as "os" instead of as "meta". this will be changed in firefox per bug 1232918. until that's fixed, these keys are returned as "os" by firefox: vk_lwin (0x5b) and vk_rwin (0x5c) on windows, and gdk_key_super_l (0xffeb), gdk_key_super_r (0xffec), gdk_key_hyper_l (0xffed), and gdk_key_hyper_r (0xffee) on linux. [2] internet explorer (tested on release 9 and 11) reports "scroll" instead of "scrolllock" for the scroll lock key. [3] firefox did not add support for the symbol key until firefox 37. [4] firefox generates the key value "os" for the super and hyper keys, instead of "super" and "hyper". [...
...And 9 more matches
PaymentAddress.toJSON() - Web APIs
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... for androidopera for androidsafari on iossamsung internettojson()chrome full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge full support 15firefox full support 62notes disabled full support 62notes disabled notes available only in nightly builds. ...
...And 9 more matches
PaymentRequest.prototype.id - Web APIs
Web › API › PaymentRequest › id
the id read-only attribute of the paymentrequest interface returns a unique identifier for a particular paymentrequest instance. when constructing an instance of the paymentrequest, you are able to supply an custom id via paymentdetailsinit dictionary's id member. if none is provided, the browser automatically sets the id value to a uuid. example this example shows how to give a paymentrequest instance a custom id. ...
...interface returns a unique identifier for a particular paymentrequest instance. when constructing an instance of the paymentrequest, you are able to supply an custom id via paymentdetailsinit dictionary's id member. if none is provided, the browser automatically sets the id value to a uuid. example this example shows how to give a paymentrequest instance a custom id. const details = { id: "super-store-order-123-12312", total: { label: "total due", amount: { currency: "usd", value: "65.00" }, }, }; const request = new paymentrequest(methoddata, details); console.log(request.id); // super-store-order-123-12312 the id is then also available in the paymentresponse returned from the show() method, but under the requestid attribute. const response = await request.show(); conso...
...atibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
PerformanceLongTaskTiming - Web APIs
on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...er-compat-data and send us a pull request. ...
...And 9 more matches
SVGTransformList - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
:visited - CSS: Cascading Style Sheets
Web › CSS › :visited
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 9 more matches
:where() - CSS: Cascading Style Sheets
Web › CSS › :where
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...idsafari on iossamsung internet:where()chrome full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled). ...
...And 9 more matches
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
<input> elements of type="date" create input fields that let the user enter a date, either with a textbox that validates the input or a special date picker interface. the resulting value includes the year, month, and day, but not the time. the time and datetime-local input types support time and date+time input. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input ui generally varies from browser to browser; see browser compatibility for further details. in unsupported browsers, the control degrades gracefully to <input type="text">. among browsers with custom interfaces for selecting dates are chrome and op...
...ted browsers, the control degrades gracefully to <input type="text">. among browsers with custom interfaces for selecting dates are chrome and opera, whose data control looks like so: the edge date control looks like: and the firefox date control looks like this: value a domstring representing a date in yyyy-mm-dd format, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the date entered in the input. the date is formatted according to iso8601, described in format of a valid date string in date and time formats used in html. you can set a def...
...ue of step is 1, indicating 1 day. specifying any as the value for step has the same effect as 1 for date inputs. using date inputs date inputs sound convenient — they provide an easy interface for choosing dates, and they normalize the data format sent to the server regardless of the user's locale. however, there are currently issues with <input type="date"> because of its limited browser support. in this section, we'll look at basic and then more complex uses of <input type="date">, and offer advice on mitigating the browser support issue later (see handling browser support). hopefully, over time browser support will become ubiquitous, and this problem will fade away. basic uses of date the simplest use of <input type="date"> involves one <input> combined with its <label>, as s...
...And 9 more matches
Public class fields - JavaScript
see the compat information below. both static and instance public fields are writable, enumerable, and configurable properties. as such, unlike their private counterparts, they participate in prototype inheritance. ...
...ld' } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = 'sub class field' } console.log(subclasswithstaticfield.substaticfield) // expected output: "sub class field" console.log(subclasswithstaticfield.basestaticfield) // expected output: "base field" when initializing fields, this refers to the class constructor. ...
...lasswithstaticfield extends classwithstaticfield { static substaticfield = 'sub class field' } console.log(subclasswithstaticfield.substaticfield) // expected output: "sub class field" console.log(subclasswithstaticfield.basestaticfield) // expected output: "base field" when initializing fields, this refers to the class constructor. ...
...And 9 more matches
Using the W3C DOM - Archive of obsolete content
lections of elements, such as document.images and document.forms. some browsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript errors in standards-compliant browsers. the w3c document object model provides interfaces dom elements to scriptable objects. ...
...owsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript errors in standards-compliant browsers. the w3c document object model provides interfaces dom elements to scriptable objects. w3c dom standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. ...
...se javascript errors in standards-compliant browsers. the w3c document object model provides interfaces dom elements to scriptable objects. w3c dom standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. using w3c standards means that code will run in compliant browsers with minimal need for cross-browser support, whereas code based on proprietary standards requires much more effort to be compatible with multiple user agents. ...
...And 8 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
url referenced by the codebase attribute and retrieve the activex control. additional param elements (which are "children" of the above object element) specify configuration parameters for the flash plugin. for instance, the param name="movie" tells the flash plugin the location of the swf file to start playing. ...
...lements (which are "children" of the above object element) specify configuration parameters for the flash plugin. for instance, the param name="movie" tells the flash plugin the location of the swf file to start playing. with the release of netscape 7.1, this kind of activex use of the object element is supported for use with the microsoft® windows media player. only the windows media player is supported as an activex control in netscape 7.1. the details are covered in another article. ...
... with the release of netscape 7.1, this kind of activex use of the object element is supported for use with the microsoft® windows media player. only the windows media player is supported as an activex control in netscape 7.1. the details are covered in another article. browsers such as netscape 7 will not render the flash plugin if the above kind of markup is used, because netscape 7 does not support activex or activex-based component invocations, with the exception of windows media player in netscape 7.1. mozilla-based browsers support the netscape plugin architecture, which is not com based like activex (and thus, not invoked via a unique identifier) but rather, mime type based. mozilla-based browsers support the use of the object element along with a mime type. here is an example of th...
...And 8 more matches
Strategies for carrying out testing - Learn web development
rk out a list of browsers you will need to test on to start with. there is no way you can test on every combination of browser and device your users might use to view your site — there are just too many, and new ones appear all the time. instead, you should try to make sure your site works on the most important target browsers and devices, and then code defensively to give your site the widest support reach it can be expected to have. by coding defensively, we mean trying to build in intelligent fallbacks so that if a feature or style doesn't work in a browser, the site will be able to downgrade to something less exciting that still provides an acceptable user experience — the core information is still accessible, for example, even if it doesn't look quite as nice. the aim is to build ...
...ill be able to downgrade to something less exciting that still provides an acceptable user experience — the core information is still accessible, for example, even if it doesn't look quite as nice. the aim is to build up a chart of browsers/devices you can refer to as you test. you can make this as simple or as complex as you like — for example a common approach is to have multiple grades of support level, something like: a grade: common/modern browsers — known to be capable. test thoroughly and provide full support. b grade: older/less capable browsers — known not to be capable. test, and provide a more basic experience that gives full access to core information and services. c grade: rare/unknown browsers — don't test, but assume they are capable. serve the full site, which ...
... b grade: older/less capable browsers — known not to be capable. test, and provide a more basic experience that gives full access to core information and services. c grade: rare/unknown browsers — don't test, but assume they are capable. serve the full site, which should work, at least with the fallbacks provided by our defensive coding. throughout the following sections, we'll build up a support chart in this format. note: yahoo first made this approach popular, with their graded browser support approach. educated guesses you could call these "assumptions", or "gut feelings". this is not an accurate, scientific approach, but as someone who has experience with the web industry you'll have a pretty good idea of at least some of the browsers you should test. this can form a good ba...
...And 8 more matches
NSS 3.35 release notes
network security services (nss) 3.35, which is a minor release. distribution information the hg tag is nss_3_35_rtm. nss 3.35 requires nspr 4.18, or newer. nss 3.35 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_35_rtm/src/ new in nss 3.35 new functionality tls 1.3 support has been updated to draft -23. this includes a large number of changes since 3.34, which supported only draft -18. see below for details. new types in sslt.h sslhandshaketype - the type of a tls handshake message. for the sslsignaturescheme enum, the enumerated values ssl_sig_rsa_pss_sha* are deprecated in response to a change in tls 1.3. please use the equivalent ssl_sig_rsa_...
...see below for details. new types in sslt.h sslhandshaketype - the type of a tls handshake message. for the sslsignaturescheme enum, the enumerated values ssl_sig_rsa_pss_sha* are deprecated in response to a change in tls 1.3. please use the equivalent ssl_sig_rsa_pss_rsae_sha* for rsaencryption keys, or ssl_sig_rsa_pss_pss_sha* for pss keys. note that this release does not include support for the latter. notable changes in nss 3.35 previously, nss used the dbm file format by default. starting with version 3.35, nss uses the sql file format by default. below, are explanations that could be helpful for environments that need to adopt to the new default. if nss is initialized, in read-write mode with a database directory provided, it uses database files to store c...
....35 previously, nss used the dbm file format by default. starting with version 3.35, nss uses the sql file format by default. below, are explanations that could be helpful for environments that need to adopt to the new default. if nss is initialized, in read-write mode with a database directory provided, it uses database files to store certificates, key, trust, and other information. nss supports two different database file formats: dbm: the legacy file format, based on berkeley db, using filenames cert8.db, key3.db and secmod.db. parallel database access, by multiple applications, is forbidden as it will likely result in data corruption. sql: the newer file format, based on sqlite, using filenames cert9.db, key4.and and pkcs11.txt. parallel database access, by multipl...
...And 8 more matches
Introduction to XPCOM for the DOM
the hairy details, if you just intend to read the code or to work with the existing framework. the numerous macros and facilities brought by the dom, as well as nscomptr's, make our life much easier. in this chapter i will attempt to cover the most widespread use of xpcom in the dom, avoiding the details as much as possible. i will introduce nscomptr's, interfaces, reference counting, and the nsisupports interface. a tutorial about how to add a new interface is also provided, and eventually, a more detailed discussion of class inheritance in c++. interfaces object-oriented programming is based on the used of inheritance between classes. furthermore, a class can be de declared to be "abstract" if it declares some methods but does not implement them entirely. pushing this concept to its maxi...
.... let's consider what happens when the class nsfoo implements an interface nsifoo. you can manipulate the nsfoo object directly through fooptr, however your code will not be very robust. indeed, if someone decides to change the name or the signature of the methods you use, you will have to change all the calls to those methods throughout your code. as opposed to a concreate class, an interface is supposed to be more stable through time. indeed, many interfaces in the mozilla code are frozen (this is indicated by the comment @frozen at the beginning of the interface definition). that means that the interface will never change anymore. the good thing is that your code will (in the best condition) last forever. the bad thing is that we have to find a way to improve those interfaces, and freezing...
...ake sure that no object is deleted while interface pointers still point at that object. indeed, dereferencing a pointer that points to a deleted object can have bad consequences. that is why each time a pointer to an interface is assigned the address of an object, we have to increase the reference count of that object by one. the function that does this is called "addref" and is defined in the nsisupports interface. when the pointer no longers holds the address of that object, it has to decrease the reference count of that object by one. this is done using the "release" function, also defined in the nsisupports interface. when the reference count of an object hits 0 (zero), the object deletes itself. this is why it is very important to keep track of the reference count of each object. in the ...
...And 8 more matches
nsIWebBrowserPersist
ng/browser/nswebbrowser;1 and @mozilla.org/embedding/browser/nswebbrowserpersist;1. ...
...;1. ...
...nce, use: var webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports ac...
...And 8 more matches
Plug-in Basics - Plugins
) note: firefox nightly checks a subset of these locations. also some linux distributions provide a system browser configured differently. advanced: you can determine which directories a gecko program checks with the linux strace command, for example: strace -e open /usr/bin/firefox 2>&1 | grep plugin but with version firefox-41.0.2 we can not check. ...
...ed also this command with above script (with environment variable) on my system and also working. however, primary working path with binary file was /usr/lib/mozilla/plugins for 32-bit and 64-bit linux distributions and looks still working. firefox and opensuse probably use "moz_plugin_path environment variable" in script to run firefox, so in this way /usr/lib64/mozilla/plugins also should be supported. about distributions: example debian 64bit probably use: /lib/x86_64-linux-gnu/ --> for 64 libs /lib/i386-linux-gnu/ --> for 32 libs if exist /lib32/ --> this is symlinked (or bind mounted) desired proper directory /lib64/ --> this is symlinked (or bind mounted) desired proper directory more in https://wiki.debian.org/multiarch/thecaseformultiarch if something wrong, please edit. ...
...i.debian.org/multiarch/thecaseformultiarch if something wrong, please edit. example fedora 64bit use: /lib/ --> for 32 bit libs /lib64/ --> for 64 bit libs plug-ins within toolkit bundles. to find out which plug-ins are currently installed visit about:plugins. gecko displays a page listing all installed plug-ins and the mime types they handle, as well as optional descriptive information supplied by the plug-in. on windows, installed plug-ins are automatically configured to handle the mime types that they support. if multiple plug-ins handle the same mime type, the first plug-in registered handles the mime type. for information about the way mime types are assigned, see registering plug-ins. checking plug-ins by mime type the enabledplugin property in javascript can be used to det...
...And 8 more matches
BudgetService - Web APIs
ge is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudgetservice experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung i...
...And 8 more matches
BudgetState - Web APIs
page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...te to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudgetstate experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ? ie ? opera no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? samsung inter...
...And 8 more matches
ConvolverNode() - Web APIs
ntaining the (possibly multichannel) impulse response used by the convolvernode to create the reverb effect. disablenormalization: a boolean controlling whether the impulse response from the buffer will be scaled by an equal-power normalization, or not. the default is 'false'. return value a new convolvernode object instance. exceptions exception explanation notsupportederror the referenced audiobuffer does not have the correct number of channels, or it has a different sample rate to the associated audiocontext. specifications specification status comment web audio apithe definition of 'convolvernode()' in that specification. working draft initial definition. browser compatibility the compatibility table on ...
...lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...'d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
FileSystemDirectoryReader.readEntries() - Web APIs
ble on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... pull request. ...
...And 8 more matches
FileSystemSync - Web APIs
lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemsync non-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera full support 15prefixed full supp...
...And 8 more matches
HTMLIFrameElement.allowPaymentRequest - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...droidsafari on iossamsung internetallowpaymentrequest experimentalchrome full support 60disabled full support 60disabled disabled from version 60: this feature is behind the #web-payments preference (needs to be set to enabled). ...
...And 8 more matches
IDBCursor.request - Web APIs
Web › API › IDBCursor › request
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
IDBDatabase.createObjectStore() - Web APIs
keypath is either an empty string or an array containing an empty string. example // let us open our database var request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.indexeddb.open(). // this handler is only supported in recent browsers. request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.
... compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
IDBKeyRange.includes() - Web APIs
g whether a specified key is inside the key range. note: this feature is available in web workers. syntax var isincluded = mykeyrange.includes(key) parameters key the key you want to check for in your key range. this can be any type. return value a boolean. ...
... description dataerror the supplied key was not a valid key. example var keyrangevalue = idbkeyrange.bound('a', 'k', false, false); var myresult = keyrangevalue.includes('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, the following polyfill can be used. idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c = indexeddb.cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c = indexeddb.cmp(key, r.upper); if (r.upperopen &&...
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
IDBTransaction.oncomplete - Web APIs
previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. ...
...y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
IDBVersionChangeEvent.version - Web APIs
syntax readonly attribute unsigned long long? version; value a 64-bit integer. ...
...y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
PaymentRequest.abort() - Web APIs
the paymentrequest.abort() method of the paymentrequest interface causes the user agent to end the payment request and to remove any user interface that might be shown. syntax paymentrequest.abort(); returns void. parameters none examples the following example sets up a timeout to clear the payment request that might have been abandoned or neglected. ...
...lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetabort()chrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentRequest.onshippingaddresschange - Web APIs
d by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated address is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of clarity. }).catch(function(err) { console.error("uh oh, someth...
...tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonshippingaddresschangechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentResponse.complete() - Web APIs
pending. you can't treat a payment as complete after requesting that the payment be tried again. examples the following example sends payment information to a secure server using the fetch api. it calls complete() with an answer appropriate to the status in the response. // initialization of paymentrequest arguments are excerpted for the // sake of brevity. ...
...y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcomplete()chrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentResponse.payerEmail - Web APIs
this option is only present when the requestpayeremail option is set to true in the paymentoptions object passed to the paymentrequest constructor. syntax var payeremail = paymentresponse.payeremail; specifications specification status comment payment request api candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpayeremailchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentRequest.payerName - Web APIs
this option is only present when the requestpayername option is set to true in the options parameter of the paymentrequest() constructor. syntax var payername = paymentresponse.payername; value a string containing the payer name. specifications specification status comment payment request apithe definition of 'payername' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpayernamechrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentResponse.requestId - Web APIs
syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe definition of 'requestid' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestidchrome full support 61edge full support 16firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentResponse.shippingAddress - Web APIs
calling the paymentrequest constructor. in the example below, the cost of shipping varies by geography. when the paymentrequest.onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost. // initialization of paymentrequest arguments are excerpted for brevity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. }).catch(function(err) { console.error("uh oh, someth...
...he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingaddresschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
PaymentResponse.shippingOption - Web APIs
s object passed to the paymentrequest constructor. syntax var shippingoption = paymentrequest.shippingoption; example in the example below, the paymentrequest.onshippingaoptionchange event is called. it calls updatedetails() to toggle the shipping method between "standard" and "express". // initialization of paymentrequest arguments are excerpted for brevity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(resolve, reject) { updatedetails(details, request.shippingoption, resolve, reject); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity. }).catch(function(err) { console.error(...
...the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingoptionchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
...And 8 more matches
Geometry and reference spaces in WebXR - Web APIs
a way to report its position to your app. thus, it has its own coordinate system. this is a reference space which is provided to your app when input events occur. this reference space internally knows how to map the coordinates of the controller to the headset's coordinates, so webxr can translate coordinates back and forth for you. once created, an xrreferencespace guarantees a certain level of support for motion and orientation tracking, and provides a mechanism for obtaining an xrviewerpose from which you can get a matrix which represents the position and facing direction of the space relative to the world space, if the space represents a viewer such as the user's headset, an observer's headset, or a virtual camera. all of this is the browser's responsibility to handle, providing consist...
...om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace the remainder of this guide explores how to select t...
... guide explores how to select the right reference space for your app's needs. defining spatial relationships with reference spaces there are a number of commonly used ways to reference the positions and orientations of objects relative to their environment, as well as to constrain the environment itself. to that end, webxr defines a set of standard spaces, called reference spaces, each of which supports a different technique for correlating its local space's reference frame coordinate system to the coordinate system of the space in which it exists. however, regardless of which type of reference space is being used, you can use the same functions to convert coordinates from space to parent space. selecting the reference space type straight off, let's state the simplest step in the process...
...And 8 more matches
Window.releaseEvents() - Web APIs
e in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...wser-compat-data and send us a pull request. ...
...And 8 more matches
Window.scrollBy() - Web APIs
Web › API › Window › scrollBy
lity the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
XRSystem: requestSession() - Web APIs
resolves to an xrsession object through which you can manage the requested type of webxr session. while only one immersive vr session can be active at a time, multiple inline sessions can be in progress at once. syntax var sessionpromise = xr.requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum. the supported modes are: 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. the session's environmentblendmode indicates the method to be used to blend the content together. important: the immersive-ar mode is defined by the webxr augmented reality module, which is not yet stable a...
...e if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. sessioninit optional a xrsessioninit object providing options to configure the new xrsession. see specifying session options for details on how to configure a webxr session. return value a promise that resolves with an xrsession object if the device and user agent support the requested mode and features. exceptions this method doesn't throw true exceptions; instead, it rejects the re...
...atures. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalidstateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up. there can only be one immersive vr session at a time. notsupportederror there is no webxr-compatible device available, or the device does not support the specified sessionmode; this can also be thrown if any of the required options are unsupported. securityerror permission to enter the specified xr mode is denied. this can happen for a number of reasons, which are covered in more detail in permissions and security in webxr device api. examples cr...
...And 8 more matches
::slotted() - CSS: Cascading Style Sheets
Web › CSS › ::slotted
ersonal id card</h2> <slot name="person-name">name missing</slot> <ul> <li><slot name="person-age">age missing</slot></li> <li><slot name="person-occupation">occupation missing</slot></li> </ul> </div> </template> a custom element — <person-details> — is defined like so: customelements.define('person-details', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('person-template'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}); let style = document.createelement('style'); style.textcontent = 'div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }' + 'h2 { margin: 0 0 10px; }' + ...
...tyle element with content, we select all slotted elements (::slotted(*)) and give them a different font and color. this allows them to stand out better next to the slots that haven't been successfully filled. the element looks like this when inserted into the page: <person-details> <p slot="person-name">dr. shazaam</p> <span slot="person-age">immortal</span> <span slot="person-occupation">superhero</span> </person-details> specifications specification status comment css scoping module level 1the definition of '::slotted' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
Variable fonts guide - CSS: Cascading Style Sheets
access all the variations contained in a given font file via css and a single @font-face reference. this article will give you all you need to know to get you started using variable fonts. warning: in order to use variable fonts on your operating system, you need to make sure that it is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. if your operating system is not up to date, you will not be able to use variable fonts in web pages or the firefox developer tools. variable fonts: what they are, and how they differ to better understand what's different about variable fonts, it is worth reviewing what non-variable ones are like and how they compare. standard (or static) fonts in the past, a typeface woul...
...n the code examples below. registered axes and existing css attributes in this section we'll demonstrate the five registered axes defined with examples and the corresponding css. where possible, both the standard and lower-level syntax are included. the lower-level syntax (font-variation-settings) was the first mechanism implemented in order to test the early implementations of variable font support, and is necessary to utilize new or custom axes beyond the five registered ones. however, the w3c’s intent was for this syntax not to be used when other attributes are available. therefore wherever possible, the appropriate property should be used, with the lower-level syntax of font-variation-settings only being used to set values or axes not available otherwise. notes when using fo...
...n axis of how narrow or wide (condensed or extended, in typographic terms) the letterforms can be. this is typically set in css using the font-stretch property, with values expressed as a percentage above or below ‘normal’ (100%), any number greater than 0 is technically valid—though it is far more likely that the range would fall closer to the 100% mark, such as 75%-125%. if a number value supplied is outside the range encoded in the font, the browser should render the font at the closest value allowed. note: the % symbol is not used when utilizing font-variation-settings. font-stretch: 115%; font-variation-settings: 'wdth' 115; the following live example's css can be edited to allow you to play with font width values. italic the italic (ital) axis works differently in that ...
...And 8 more matches
background-position - CSS: Cascading Style Sheets
rent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-position' in that specification. candidate recommendation adds support for multiple backgrounds and the four-value syntax. modifies the percentage definition to match implementations. css level 2 (revision 1)the definition of 'background-position' in that specification. recommendation allows for keyword values and <length> and <percentage> values to be mixed. css level 1the definition of 'background-position' in that specification. rec...
...ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
caption-side - CSS: Cascading Style Sheets
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
element() - CSS: Cascading Style Sheets
Web › CSS › element
as a background. on gecko browsers, you can use the non-standard document.mozsetimageelement() method to change the element being used as the background for a given css background element. syntax element(id) where: id the id of an element to use as the background, specified using the html attribute #id on the element. examples these examples can be viewed live in builds of firefox that support -moz-element(). a somewhat realistic example this example uses a hidden <div> as a background. the background element uses a gradient, but also includes text that is rendered as part of the background. <div style="width:400px; height:400px; background:-moz-element(#mybackground1) no-repeat;"> <p>this box uses the element with the #mybackground1 id as its background!</p> </div> <div styl...
...mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
object-fit - CSS: Cascading Style Sheets
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobject-fitchrome full support 31edge full support 16notes full support 16notes notes edge supports object-fit on img elements only. ...
...And 8 more matches
object-position - CSS: Cascading Style Sheets
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
pointer-events - CSS: Cascading Style Sheets
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
Cross-browser audio basics - Developer guides
here we define an <audio> element with m...
... attributes, properties, and events explained a guide to custom controls created using the media api basic audio example the code below is an example of a basic audio implementation using html5: <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for non supporting browsers goes here --> <p>your browser does not support html5 audio, but you can still <a href="audiofile.mp3">download the music</a>.</p> </audio> note: you can also use an mp4 file instead of mp3. mp4 files typically contain aac encoded audio. you can use type="audio/mp4". (currently, browsers that support mp3 also support mp4 audio). here we define an <audio> element with multiple sources — we do this as not all browsers support th...
... formats that will give maximum coverage are mp3 and ogg vorbis. we do this using the <source> element, which takes the attributes src and type. src contains the path to the audio file to be loaded (relative or absolute). type is used to inform the browser of the file type. if omitted, most browsers will attempt to guess this from the file extension. if the <audio> element is not supported then <audio> and <source> will be ignored. however any supported text or elements that you define within <audio> will be displayed or acted upon. so the ideal place to create a fallback or inform of incompatibility is before the closing </audio> tag. in this case, we've provided a simple paragraph including a link to download the audio directly. the controls attribute on the <audio> elemen...
...And 8 more matches
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
easy entry of a year plus the iso 8601 week number during that year (i.e., week 1 to 52 or 53). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the control's user interface varies from browser to browser; cross-browser support is currently a bit limited, with only chrome/opera and microsoft edge supporting it at this time. in non-supporting browsers, the control degrades gracefully to function identically to <input type="text">. in chrome/opera the week control provides slots to fill in week and year values, a pop-up calendar interface to select them more visually, and an "x" button to clear the control's value. ...
...opera the week control provides slots to fill in week and year values, a pop-up calendar interface to select them more visually, and an "x" button to clear the control's value. the edge week control is somewhat more elaborate, opening up week and year pickers with sliding reels. value a domstring representing a week and year, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the format of the date and time value used by this input type is described in format of a valid week string in date ...
...e of "any" means for step when used with week inputs. this will be updated as soon as that information is determined. using week inputs week inputs sound convenient at first glance, since they provide an easy ui for choosing weeks, and they normalize the data format sent to the server, regardless of the user's browser or locale. however, there are issues with <input type="week"> because browser support is not guaranteed across all browsers. we'll look at basic and more complex uses of <input type="week">, then offer advice on mitigating the browser support issue later on (see handling browser support). basic uses of week the simplest use of <input type="week"> involves a basic <input> and <label> element combination, as seen below: <form> <label for="week">what week would you like to ...
...And 8 more matches
Browser detection using the user agent - HTTP
s uncommon, it's worth checking if this bug has been reported to the browser vendor via their bug tracking system (mozilla; webkit; blink; opera). browser makers do pay attention to bug reports, and the analysis may hint about other workarounds for the bug. are you trying to check for the existence of a specific feature? your site needs to use a specific web feature that some browsers don't yet support, and you want to send those users to an older web site with fewer features but that you know will work. this is the worst reason to use user agent detection because odds are eventually all the other browsers will catch up. in addition, it is not practical to test every one of the less popular browsers and test for them. you should never do user agent sniffing. there is always the alternative ...
...f the specific feature you need is available. if it's not, you use a fallback. in those rare cases where behavior differs between browsers, instead of checking the user agent string, you should instead implement a test to detect how the browser implements the api and determine how to use it from that. an example of feature detection is as follows. ...
... not, you use a fallback. in those rare cases where behavior differs between browsers, instead of checking the user agent string, you should instead implement a test to detect how the browser implements the api and determine how to use it from that. an example of feature detection is as follows. in 2017, chrome unflagged experimental lookbehind support in regular expressions, but no other browser supported it. ...
...And 8 more matches
Details of the object model - JavaScript
isting prototype-based inheritance. the class syntax does not introduce a new object-oriented inheritance model to javascript. subclasses and inheritance in a class-based language, you create a hierarchy of classes through the class definitions. in a class definition, you can specify that the new class is a subclass of an already existing class. the subclass inherits all the properties of the superclass and additionally can add new properties or modify the inherited ones. for example, assume the employee class includes only the name and dept properties, and manager is a subclass of employee that adds the reports property. in this case, an instance of the manager class would have all three properties: name, dept, and reports. javascript implements inheritance by allowing you to associate ...
...; } the manager and workerbee definitions show the difference in how to specify the next object higher in the inheritance chain. in javascript, you add a prototypical instance as the value of the prototype property of the constructor function, then override the prototype.constructor to the constructor function. you can do so at any time after you define the constructor. in java, you specify the superclass within the class definition. you cannot change the superclass outside the class definition. javascript function manager() { employee.call(this); this.reports = []; } manager.prototype = object.create(employee.prototype); manager.prototype.constructor = manager; function workerbee() { employee.call(this); this.projects = []; } workerbee.prototype = object.create(employee.prototyp...
...fred.name is '' // fred.dept is 'sales' // fred.projects is [] // fred.quota is 100 var jane = new engineer; // jane.name is '' // jane.dept is 'engineering' // jane.projects is [] // jane.machine is '' object properties this section discusses how objects inherit properties from other objects in the prototype chain and what happens when you add a property at run time. inheriting properties suppose you create the mark object as a workerbee with the following statement: var mark = new workerbee; when javascript sees the new operator, it creates a new generic object and implicitly sets the value of the internal property [[prototype]] to the value of workerbee.prototype and passes this new object as the value of the this keyword to the workerbee constructor function. the internal [[prot...
...And 8 more matches
WebAssembly.CompileError() constructor - JavaScript
n this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ontribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...er-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Instance() constructor - JavaScript
le on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rowser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Instance.prototype.exports - JavaScript
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.LinkError() constructor - JavaScript
e on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...o contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...owser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Memory.prototype.buffer - JavaScript
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Memory.prototype.grow() - JavaScript
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Module() constructor - JavaScript
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Module.customSections() - JavaScript
lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...'d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Module.exports() - JavaScript
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Module.imports() - JavaScript
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.RuntimeError() constructor - JavaScript
n this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ontribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...er-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Table() constructor - JavaScript
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Table.prototype.get() - JavaScript
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Table.prototype.grow() - JavaScript
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Table.prototype.length - JavaScript
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.Table.prototype.set() - JavaScript
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.compile() - JavaScript
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.instantiate() - JavaScript
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
WebAssembly.validate() - JavaScript
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 8 more matches
<math> - MathML
Web › MathML › Element › math
re: display (which has the same effect as display="block") and inline. overflow specifies how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. ...
... and inline. overflow specifies how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. ...
...how an expression behaves if it is too long to fit in the allowed width. possible values are: linebreak (default), scroll, elide, truncate, scale. ...
...And 8 more matches
Complete - Archive of obsolete content
other pages. this page is for readers who have followed the custom toolbar button tutorial for firefox, thunderbird and sunbird, or the custom toolbar button:seamonkey tutorial for seamonkey, and who want to learn more about developing extensions. introduction you can use the custom toolbar button tutorial as a very simple introduction to extensions. however, because it is so simple it does not support some of the usual features of extensions. this page describes how to structure the extension in a more conventional way. this page is not a step-by-step tutorial. instead it explains the missing features, and outlines how to add them. if you want to see these techniques in action, then you can download and install the complete allcustom extension: allcustom.xpi (the link is external only bec...
...eatures of extensions. this page describes how to structure the extension in a more conventional way. this page is not a step-by-step tutorial. instead it explains the missing features, and outlines how to add them. if you want to see these techniques in action, then you can download and install the complete allcustom extension: allcustom.xpi (the link is external only because this wiki does not support xpi files.) the extension does not contain any useful functions. it is just an extended code sample. to see the code, use a jar tool or zip tool to unpack the xpi file that you downloaded. for more information about developing extensions, see the main extensions page here. features of this extension this extension is a more complex version of the original custom toolbar button extension. it p...
...s. it is just an extended code sample. to see the code, use a jar tool or zip tool to unpack the xpi file that you downloaded. for more information about developing extensions, see the main extensions page here. features of this extension this extension is a more complex version of the original custom toolbar button extension. it provides a user interface in two languages (english and french). it supports firefox, thunderbird, sunbird and flock—these are referred to as "firefox etc." in the rest of this page. it also supports seamonkey. in seamonkey it supports two themes (classic and modern). it provides all five custom toolbar buttons on all the toolbars, and it provides corresponding menu choices in seamonkey's chatzilla window. the following sections describe this extension's overall st...
...And 7 more matches
Archived Mozilla and build documentation - Archive of obsolete content
if you are a plug-in author, you may find this project saves you a lot of work! ant script to assemble an extension this ant script helps to package an extension archived spidermonkey docs this section contains old spidermonkey documentation. ...
...at can be dragged around and dropped onto other objects. dtrace dtrace is sun microsystem's dynamic tracing framework that allows developers to instrument a program with probes that have little to no effect on performance when not in use and very little when active. probe data can be collected with scripts written in d (no, not that one). mozilla dtrace support has been added by the sun dtrace team and can be used on solaris 10 and mac os x 10.5. embedding faq embedding mozilla in a java application using javaxpcom xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java...
... liveconnect. liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., javascript crypto mozilla defines a special javascript object to allow web pages access to certain cryptographic-related services. these services are a balance between the functionality web pages need a...
...And 7 more matches
HTML forms in legacy browsers - Learn web development
y ones. in the mobile world, when neither the browser nor the os can be updated such as on older android phones or iphones, the stock browsers that don't update are also legacy browsers. dealing with this wilderness is part of the job. fortunately, there are a few tricks to know that can help you to solve most of the problems caused by legacy browsers. and html5 <input> types don't fail when not supported: they fall back to type=text. learn about the issues to understand common patterns, it helps to read browser documentation. if you are reading this on mdn, you are at the right place to start. just check the support of the elements (or dom interface) you want to use. mdn has compatibility tables available for most elements, properties and apis that can be used in a web page. there are oth...
... the webkit blog and planet webkit aggregate the best articles by webkit core developers. chrome platform status site is also important. as well as the apple web site. ...
...tionality", but building efficient html forms is not a question of design or technology. rather, it's about simplicity, intuitivess, and ease of user interaction. the tutorial, forms usability on ux for the masses, explains it well. graceful degradation is web developer's best friend graceful degradation and progressive enhancement are development patterns that allow you to build great stuff by supporting a wide range of browsers at the same time. when you build something for a modern browser, and you want to be sure it will work, one way or another, on legacy browsers, you are performing graceful degradation. let's see some examples related to html forms. html input types the input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly pre...
...And 7 more matches
Implementing QueryInterface
ation::queryinterface( refnsiid aiid, void** ainstanceptr ) { ns_assertion(ainstanceptr, "queryinterface requires a non-null destination!"); // it's a logic error, not a runtime error, to call me without any place to put my answer! // ...but that won't matter when someone calls me wrongly in a non-debug build. ...
...ild. if ( !ainstanceptr ) return ns_error_null_pointer; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed... ...
...; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed... ...
...And 7 more matches
Observer Notifications
applications application shutdown these are the topics that you can observe on shutdown, in order of appearance. topic description quit-application-requested something has requested that the application be shutdown. you can cancel the shutdown from here by setting asubject.data to true (asubject is the first parameter to your observer, the data value is an nsisupportsprbool). quit-application-granted all observers have agreed to the shutdown. quit-application the application is about to quit. this can be in response to a normal shutdown, or a restart. note: the data value for this notification is either 'shutdown' or 'restart'. profile-change-net-teardown the network connection is going offline at this point. ...
...:purge-domain-data sent after domain-specific history and other information have been purged. the data value is a string form of the domain. browser-lastwindow-close-requested sent when the browser wishes to close the last open browser window. when this is sent, it is possible that other windows may still be open, such as the download manager or preferences. the data value is an nsisupportsprbool. recipients may set this to true to abort the close. browser-lastwindow-close-granted sent when all interested parties have responded to the browser-lastwindow-close-requested notification and none of them requested that the close be aborted. after this is sent and handled, the browser window will close. browser-delayed-startup-finished sent when the browser win...
...s removed from the backward/forward cache. see working with bfcache for information about the bfcache, and inner and outer windows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryinterface(components.interfaces.nsisupportspruint64).data outer-window-destroyed nsidomwindow called when an outer window is disconnected from its docshell. see inner and outer windows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryint...
...And 7 more matches
nsIWebSocketListener
netwerk/protocol/websocket/nsiwebsocketlistener.idlscriptable implement this interface to receive websocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). ...
... netwerk/protocol/websocket/nsiwebsocketlistener.idlscriptable implement this interface to receive websocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). ...
...t this interface to receive websocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). ...
...And 7 more matches
BasicCardResponse.billingAddress - Web APIs
the billingaddress property of the basiccardresponse dictionary contains the billing address of the card used to make the payment. syntax "billingaddress" : paymentaddress value a paymentaddress object representing the billing address of the card. example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object avai...
... the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbillingaddresschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BasicCardResponse.cardNumber - Web APIs
request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardnumberchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BasicCardResponse.cardSecurityCode - Web APIs
the cardsecuritycode property of the basiccardresponse dictionary contains the security code of the card used to make the payment. syntax "cardsecuritycode" : "number" value a domstring representing the card security code. example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfille...
...the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardsecuritycodechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BasicCardResponse.cardholderName - Web APIs
the cardnumber property of the basiccardresponse dictionary contains the cardholder name of the card used to make the payment. syntax name = basiccardresponse.cardholdername; value a domstring indicating the name of the cardholder. example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the...
... the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardholdernamechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BasicCardResponse.expiryMonth - Web APIs
the expirymonth property of the basiccardresponse dictionary contains the expiry month of the card used to make the payment. syntax "expirymonth" : "number" value a domstring representing the card expiry month as a two-digit number in the range 01 to 12. example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse obje...
...ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexpirymonthchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BasicCardResponse.expiryYear - Web APIs
the expiryyear property of the basiccardresponse dictionary contains the expiry year of the card used to make the payment. syntax "expiryyear" : "number" value a domstring representing the card expiry year as a four-digit number in the range 0000 to 9999. example let's look at a sample payment request: var request = new paymentrequest(supportedinstruments, details, options); // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse obj...
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexpiryyearchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.
...And 7 more matches
BlobEvent.timecode - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... send us a pull request. ...
...And 7 more matches
FetchEvent.navigationPreload - Web APIs
y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a pull request. ...
...And 7 more matches
File.webkitRelativePath - Web APIs
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... ...
...And 7 more matches
FontFaceSetLoadEvent - Web APIs
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...owser-compat-data and send us a pull request. ...
...And 7 more matches
HTMLImageElement.alt - Web APIs
the htmlimageelement property alt provides fallback (alternate) text to display when the image specified by the <img> element is not loaded. this may be the case because of an error, because the user has disabled the loading of images, or because the image simply hasn't finished loading yet. perhaps the most important reason to use the alt tag is to support accessibility, as the alt text may be used by screen readers and other assistive technologies to help differently-abled users make full use of your content. it will be read aloud or sent to the touch device, for example, to support visually impaired users. think of it like this: when choosing alt strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image ...
...text should be the name of that state. for example, if an image is a badge that's shown on a page to indicate that the content of the page is new and has been updated recently, the corresponding alt text might be "updated recently" or even "updated on 27 august 2019". in this example, a starburst image with the word "new!" is used to indicate that an article is about something new (and probably supposedly also exciting). the alt attribute is set to new page! to allow that text to be displayed in place of the image if the image isn't available. it is also available to be read by screen readers. html the html below creates a snippet of content from a site using the described icon. note the use of the alt attribute on the <img>, providing a good substitution string to use in case the image d...
...atibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
HTMLImageElement.complete - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
HTMLImageElement.crossOrigin - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
HTMLImageElement.currentSrc - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcurrentsrc experimentalchrome full support 45edge full support 13firefox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). to change preferences in firefox, ...
...ox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). ...
...And 7 more matches
HTMLImageElement.naturalHeight - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
HTMLImageElement.naturalWidth - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.continue() - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.direction - Web APIs
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.primaryKey - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.source - Web APIs
Web › API › IDBCursor › source
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBCursorWithValue.value - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.close() - Web APIs
Web › API › IDBDatabase › close
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.deleteObjectStore() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...heck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.name - Web APIs
Web › API › IDBDatabase › name
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.objectStoreNames - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.onabort - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.onclose - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.onerror - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.onversionchange - Web APIs
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabase.version - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
..., please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBDatabaseException - Web APIs
is page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbdatabaseexception deprecatednon-standardchrome full support 12prefixed full support 12prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support 4 — 14ie no support noopera no support nosafari no support ...
...And 7 more matches
IDBEnvironment - Web APIs
on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.lower - Web APIs
Web › API › IDBKeyRange › lower
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.lowerBound() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.lowerOpen - Web APIs
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.upper - Web APIs
Web › API › IDBKeyRange › upper
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.upperBound() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBKeyRange.upperOpen - Web APIs
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.onerror - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.onsuccess - Web APIs
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...se check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.readyState - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBRequest.transaction - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBTransaction.abort() - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBTransaction.mode - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rom structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBTransaction.objectStore() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBTransaction.onabort - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
IDBTransaction.onerror - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ease check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
Metadata - Web APIs
Web › API › Metadata
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...echromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmetadata experimentalnon-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support ...
...And 7 more matches
NonDocumentTypeChildNode.nextElementSibling - Web APIs
e is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("nextelementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "nextelementsibling", { get: function(){ var e = this.nextsibling; while(e && 1 !== e.node...
...compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
PaymentRequest.shippingOption - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingoptionchrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
... 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
...And 7 more matches
PaymentRequest.shippingType - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingtypechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
... 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
...And 7 more matches
PaymentResponse.details - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdetailschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:...
... 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). ...
...And 7 more matches
SVGLength - Web APIs
Web › API › SVGLength
object itself is read only. methods name & arguments return description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is raised if unittype is svg_lengthtype_unknown or not a valid unit type constant (one of the other svg_lengthtype_* constants defined on this interface). a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. converttospecifiedunits(in unsigned short unittype) ...
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
SVGTransform - Web APIs
t is live, meaning that any changes made to the svgtransform object are immediately reflected in the matrix object and vice versa. in case the matrix object is changed directly (i.e., without using the methods on the svgtransform interface itself) then the type of the svgtransform changes to svg_transform_matrix. for svg_transform_matrix, the matrix contains the a, b, c, d, e, f values supplied by the user. for svg_transform_translate, e and f represent the translation amounts (a=1, b=0, c=0 and d=1). for svg_transform_scale, a and d represent the scale amounts (b=0, c=0, e=0 and f=0). for svg_transform_skewx and svg_transform_skewy, a, b, c and d represent the matrix which will result in the given skew (e=0 and f=0). for svg_transform_rotate, a, b, c, d, e and ...
... the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
SharedWorkerGlobalScope.applicationCache - Web APIs
e compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
SharedWorkerGlobalScope.onconnect - Web APIs
ity the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
Starting up and shutting down a WebXR session - Web APIs
the the navigator property xr, which returns the xrsystem object if suitable xr hardware is available for your use given the hardware available and your document's environment. thus the simplest code that fetches the xrsystem object is: const xr = navigator.xr; the value of xr will be null or undefined if webxr isn't available. ...
...ment api, webxr support is limited to specific devices and browsers; and even on those, it may not be enabled by default. there may be options available to allow you to experiment with webxr even if you don't have a compatible system, however. webxr polyfill the team designing the webxr specification has published a webxr polyfill which you can use to simulate webxr on browsers which don't have support for the webxr apis. if the browser supports the older webvr api, that is used. otherwise, the polyfill falls back to an implementation which uses google's cardboard vr api. the polyfill is maintained alongside the specification, and is kept up to date with the specification. ...
... be sure to read the readme carefully; the polyfill comes in several versions depending on what degree of compatibility with newer javascript features your target browsers include. ...
...And 7 more matches
Using the Web Speech API - Web APIs
cognition processing, so it won't work offline. demo to show simple usage of web speech recognition, we've written a demo called speech color changer. when the screen is tapped/clicked, you can say an html color keyword, and the app's background color will change to that color. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome. browser support support for web speech api speech recognition is curently limited to chrome for desktop and android — chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g. webkitspeechrecognition. html and css the...
... paragraph, and a div into which we output diagnostic messages. <h1>speech color changer</h1> <p>tap/click then say a color to change the background color of the app.</p> <div> <p class="output"><em>...diagnostic messages</em></p> </div> the css provides a very simple responsive styling so that it looks ok across devices. javascript let's look at the javascript in a bit more detail. ...
...ostic messages. <h1>speech color changer</h1> <p>tap/click then say a color to change the background color of the app.</p> <div> <p class="output"><em>...diagnostic messages</em></p> </div> the css provides a very simple responsive styling so that it looks ok across devices. javascript let's look at the javascript in a bit more detail. ...
...And 7 more matches
Window.print() - Web APIs
Web › API › Window › print
ibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...fariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera full support 6notes full support 6notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribu...
...And 7 more matches
Window.prompt() - Web APIs
Web › API › Window › prompt
bility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...it does not display a prompt to the user, and always returns u...
...And 7 more matches
WorkerNavigator.permissions - Web APIs
e a permissions object. examples self.navigator.permissions.query({name:'notifications'}).then(function(result) { if (result.state === 'granted') { shownotification(); } else if (result.state === 'prompt') { requestnotificationpermission() } }); specification specification status comment permissions working draft initial definition. browser support the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpermissions experimentalchrome ...
...ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
:checked - CSS: Cascading Style Sheets
Web › CSS › :checked
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ll request. ...
...And 7 more matches
@charset - CSS: Cascading Style Sheets
Web › CSS › @charset
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
font-variant-caps - CSS: Cascading Style Sheets
s; font-variant-caps: all-small-caps; font-variant-caps: petite-caps; font-variant-caps: all-petite-caps; font-variant-caps: unicase; font-variant-caps: titling-caps; /* global values */ font-variant-caps: inherit; font-variant-caps: initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below. in each case, if the font doesn't support the opentype value, then it synthesizes the glyphs. values normal deactivates of the use of alternate glyphs. small-caps enables display of small capitals (opentype feature: smcp). small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. all-small-caps enables display of small capitals for both upper and lowercase letters (openty...
... compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-variant-capschrome full support 52edge full support 79firefox full support 34 full support 34 no support 24 — 34disabled disabled from version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). to change preferences in f...
...And 7 more matches
outline-color - CSS: Cascading Style Sheets
lue */ outline-color: invert; /* global values */ outline-color: inherit; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, performs a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid. description an outline is a line that is drawn around an element, outside the border. unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless...
...essibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typea color formal syntax <color> | invertw...
... the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 7 more matches
Creating a cross-browser video player - Developer guides
an that the specified image is to be displayed until the user chooses to play the video. ie9 will only use the specified poster image in this way if preload="none" is set; otherwise, it will take the first still of the video and display that instead. three different video sources are provided for the player: mp4, webm, and ogg. using these different source formats gives the best chance of being supported across all browsers that support html5 video. for further information on video formats and browser compatibility, see supported media formats. for browsers that do not support html5 video, a flash player is provided that will allow playback of the mp4 video source, provided the end user has flash installed. in addition a download link is displayed to allow users to download the mp4 video f...
... would allow playback of the video in most browsers, using the browser's default control set. the next step is to define a custom control set, also in html, which will be used to control the video. the control set most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. once again the html is quite straightforward, using an unordered list with list-style-type:none set to enclose the controls, each of which is a list item with float:left. for the progress bar, the progress element is taken advantage of, with a fallback provided for browsers that don't support it (e.g. ie8 and ie9). this list is inserted...
.../li> <li><button id="mute" type="button">mute/unmute</button></li> <li><button id="volinc" type="button">vol+</button></li> <li><button id="voldec" type="button">vol-</button></li> <li><button id="fs" type="button">fullscreen</button></li> </ul> each button is given an id so it can be easily accessed with javascript. the span within the <progress> element is for browsers that do not support the progress element and will be updated at the same time as progress (this span element won't be visible on browsers that support progress). the controls are initially hidden with a css display:none and will be enabled with javascript. again if a user has javascript disabled, the custom control set will not appear and they can use the browser's default control set unhindered. of course thi...
...And 7 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
you can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows simple usage of the <video> element. ...
...he <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data. note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be av...
...he user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend media data loading has been suspended. timeupdate the time indicated by the currenttime attribute has been updated. volumechange the volume has changed. waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same video formats; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands. <video controls> <source src="myvideo.mp4" type="video/mp4"> <source src="myvideo.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="myvideo.mp4">link to the video</a> instead.</p> </video> we o...
...And 7 more matches
Classes - JavaScript
hrown, and certain keywords are reserved for future versions of ecmascript. constructor the constructor method is a special method for creating and initializing an object created with a class. there can only be one special method with the name "constructor" in a class. a syntaxerror will be thrown if the class contains more than one occurrence of a constructor method. a constructor can use the super keyword to call the constructor of the super class. prototype methods see also method definitions. class rectangle { constructor(height, width) { this.height = height; this.width = width; } // getter get area() { return this.calcarea(); } // method calcarea() { return this.height * this.width; } } const square = new rectangle(10, 10); console.log(square.area...
... this.height = height; this.width = width; } } static (class-side) data properties and prototype data properties must be defined outside of the classbody declaration: rectangle.staticwidth = 20; rectangle.prototype.prototypewidth = 25; field declarations public and private field declarations are an experimental feature (stage 3) proposed at tc39, the javascript standards committee. support in browsers is limited, but the feature can be used through a build step with systems like babel. public field declarations with the javascript field declaration syntax, the above example can be written as: class rectangle { height = 0; width; constructor(height, width) { this.height = height; this.width = width; } } by declaring fields up-front, class definitions become...
...mal properties can. for more information, see private class fields. sub classing with extends the extends keyword is used in class declarations or class expressions to create a class as a child of another class. class animal { constructor(name) { this.name = name; } speak() { console.log(`${this.name} makes a noise.`); } } class dog extends animal { constructor(name) { super(name); // call the super class constructor and pass in the name parameter } speak() { console.log(`${this.name} barks.`); } } let d = new dog('mitzie'); d.speak(); // mitzie barks. if there is a constructor present in the subclass, it needs to first call super() before using "this". one may also extend traditional function-based "classes": function animal (name) { this.name = ...
...And 7 more matches
OpenSearch description format
the opensearch description format lets a website describe a search engine for itself, so that a browser or other client application can use that search engine. opensearch is supported by (at least) firefox, edge, internet explorer, safari, and chrome. (see reference material for links to other browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <searchform> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch description file the xml file...
...are stored in the profile's searchplugins/ folder). http: and https: urls are converted to data: uris when this is done. note: for icons loaded remotely (that is, from https:// uris as opposed to data: uris), firefox will reject icons larger than 10 kilobytes. url describes the url or urls to use for the search. the template attribute indicates the base url for the search query. ...
... for search suggestions, the application/x-suggestions+json url template is used to fetch a suggestion list in json format. ...
...And 7 more matches
page-mod - Archive of obsolete content
org": var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can supply the content script(s) in one of two ways: as a string literal, or an array of string literals, assigned to the contentscript option, as above as separate files supplied in your add-on's "data" directory. if you supply the scripts as separate files in the "data" directory, you specify them using with a url, typically constructed using the url() method of the self module's data object: va...
..., debug and review. a page-mod only attaches scripts to documents loaded in tabs. it will not attach scripts to add-on panels, page-workers, sidebars, or firefox hidden windows. to stop a page-mod from making any more modifications, call its destroy() method. the pagemod constructor takes a number of other options to control its behavior: contentstyle lists stylesheets to attach, supplied as strings. contentstylefile lists stylesheets to attach, supplied in separate files. contentscriptoptions defines read-only values accessible to content scripts. attachto controls whether to attach scripts to tabs that were already open when the page-mod was created, and whether to attach scripts to iframes as well as the topmost document. conten...
...on file named "icon-16.png" saved in your add-on's "data" directory. you could use this icon: . private windows if your add-on has not opted into private browsing, then your page-mods will not attach content scripts to documents loaded into private windows, even if their urls match the pattern you have specified. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals constructors pagemod(options) creates a page-mod. parameters options : object required options: name: include type: string, regexp, or array of (string or regexp) a match pattern string or an array of match pattern strings. these define the documents to which the page-mod applies. at least one matc...
...And 6 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
ing value; ptr->gettermethod(getter_copies(value)); - const prunichar *strvalue = value; + // nsstring doesn't cast directly to prunichar*, use .get()+ const prunichar *strvalue = value.get(); the frozen string api doesn't accept a length for .truncate(). use .setlength() instead: nsstring mystring = somestring; - mystring.truncate(4); + mystring.setlength(4); the frozen string api doesn't support the iterator or const_iterator classes, but you can use pointers the same way: nsstring mystring = somestring; - nsstring::const_iterator begin, end;- mystring.beginreading(begin); mystring.endreading(end); + const prunichar *begin, *end;+ mystring.beginreading(&begin, &end); the frozen string api uses comparator functions instead of a virtual comparator class. unicharutils has been modifi...
... particular you may need to use ns_literal_(c)string("") instead of empty(c)string. the equalsignorecase method does not take a length parameters. you may be able to use stringbeginswith instead. the findinreadable methods do not exist in the external api. you may be able to use the find methods instead. the tonewcstring, tonewunicode methods only work on the appropriate string class. you need to supply the appropriate conversion yourself. the adopt and getter_copies methods do not work on abstract strings. instead of passing getter_copies(astring) to a method expecting a character pointer out parameter, you will need to use a temporary variable and copy the result.missing headers some headers are included from idl files only when mozilla_internal_api is defined (actually, they shouldn't be t...
...rors about undeclared do_createinstance: #include "nscomponentmanagerutils.h" for errors about undeclared do_getservice: #include "nsservicemanagerutils.h" for errors about undeclared ns_getspecialdirectory: #include "nsdirectoryserviceutils.h" utility classes some utility classes could previously be created with ns_new* utility functions. ...
...And 6 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
rbird if thunderbird ask you to import your profile from netscape/mozilla/tb depending on you mail client history, don't import anything, here we want to check the autoconfig job alone! that should work, just restart the process by setting a different user variable (user=procacci, user=test etc... anyone in your ldap directory...) to check multiuser autoconfig. thunderbird (previous release) support of autoconfig and ldap calls below is a "try and catch" we had in previous release of thunderbird where that feature wasn't compiled in by default, it can help if needed ... unfortunately, the autoconfig option and ldap support for autoconfig (getldapattributes) was not compiled in fedora11 default thunderbird package (thunderbird-3.0-2.3.beta2.fc11.src.rpm) . so we needed to patch and rec...
...istrator. error: getldapattibutes failed: [exception... "component returned failure code: 0xc1f30001 (ns_error_not_initialized) [nsildapurl.spec]" nsresult: "0xc1f30001 (ns_error_not_initialized)" location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_xpcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script. see bug 295329 for details. add the autoconfig option for old thunderbird 1.0.x by default, autoconfig did not make part of the binaries dis...
...s now part of thunderbird default packages. moz_ldap_xpcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script. see bug 295329 for details. add the autoconfig option for old thunderbird 1.0.x by default, autoconfig did not make part of the binaries distribution of thunderbird (1.0.x). it was apparently supposed to increase the load of the binary for a feature not used by lots of individuals. however for enterprise deployment, it is vital! so we needed to recompile thunderbird with autoconfig support, it's just a matter of adding --enable-extensions=pref in mozconfig file. on my fedora core 3 system, i took the thunderbird source package thunderbird-1.0.2-1.3.3.src.rpm installed it (rpm -i) then mo...
...And 6 more matches
The Joy of XUL - Archive of obsolete content
ns right away. also described are some reasons application developers might choose to leverage xul and mozilla technology for building cross-platform applications. this same investigation will provide sufficient explanation of mozilla's motivation to build xul and why the mozilla platform is constructed using it. the key features and benefits of xul will be explored followed by an examination of supporting mozilla technologies. finally, a mini case study of a calendar application written in xul will reinforce the benefits of building applications with mozilla. key features and benefits powerful widget-based markup language the goal of xul is to build cross platform applications, in contrast with dhtml which is intended for developing web pages. for this reason, xul is oriented ...
...rast with dhtml which is intended for developing web pages. for this reason, xul is oriented toward application artifacts such as windows, labels, and buttons instead of pages, heading levels, and hypertext links. in fact, many developers invest a significant amount of effort to achieve these results in their dhtml web applications but at the cost of complexity and performance and without any supporting standards. based on existing standards xul is an xml language based on w3c standard xml 1.0. applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including ecma-262 edition 3 (ecmascript); xml 1.0. platform portability li...
...eaturing html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including ecma-262 edition 3 (ecmascript); xml 1.0. platform portability like html, xul is designed to be platform-neutral, making applications easily portable to all of the operating systems on which mozilla runs. ...
...And 6 more matches
Developing cross-browser and cross-platform pages - Archive of obsolete content
s of the browser which loads your web page. as a web author, you understandably want to avoid script errors and page layout problems and you may want to ensure your scripts reach as wide an audience as possible. there are 2 known approaches for such goals: the browser identification approach (also known as useragent string detection and often referred as "browser sniffing") and the object/feature support detection approach. the browser identification approach is now known to be complicated, unreliable and difficult to maintain. browser identification approach (aka "browser sniffing"): not best, not reliable approach this approach, still commonly used nowadays, attempts to identify the browser and makes the web author at design time decide what that implies in terms of capabilities of the vi...
...they want in the navigator.useragent string and this may trick your code into executing a "wrong" block of code. moreover, there are many cases where even the accurately-identified browser does not perform as it is reputed/expected to. so if "browser sniffing" is unreliable and difficult, then how do you code safely for different browsers and different browser versions? ... using object/feature support detection approach: best and overall most reliable when you use object/feature support detection, you only implement those features whose support you have first tested and verified on the visiting browser. this method has the advantage of not requiring you to test for anything except whether the particular features you code are supported in the visiting browser. let's see a basic, simple ob...
...detection approach: best and overall most reliable when you use object/feature support detection, you only implement those features whose support you have first tested and verified on the visiting browser. this method has the advantage of not requiring you to test for anything except whether the particular features you code are supported in the visiting browser. let's see a basic, simple object support detection example. function hideelement(id_attribute_value) { if (document.getelementbyid && document.getelementbyid(id_attribute_value) && document.getelementbyid(id_attribute_value).style ) { document.getelementbyid(id_attribute_value).style.visibility = "hidden"; }; } // example: // <button type="button" onclick="hideelement('d1');">hide div</button> // <div id="d1"...
...And 6 more matches
Other form controls - Learn web development
tion>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> note: in the case of multiple choice select boxes, you'll notice that the select box no longer displays the values as drop-down content — instead, all values are displayed at once in a list, with the optional size attribute determining the height of the widget. note: all browsers that support the <select> element also support the multiple attribute. autocomplete box you can provide suggested, automatically-completed values for form widgets using the <datalist> element with child <option> elements to specify the values to display. the <datalist> needs to be given an id. the data list is then bound to an <input> element (e.g. a text or email input type) using the list attribute, ...
... example. ...
...(with fallback)</label> <input type="text" id="myfruit" name="fruit" list="fruitlist"> <datalist id="fruitlist"> <label for="suggestion">or pick a fruit</label> <select id="suggestion" name="altfruit"> <o...
...And 6 more matches
Mozilla's Section 508 Compliance
dication of the current focus shall be provided that moves among interactive interface elements as the input focus changes. the focus shall be programmatically exposed so that assistive technology can track focus and focus changes. complete. we expose focus programmatically via msaa (windows) and atk (linux/unix). incomplete, we show focus but need to expose it programmatically by supporting carbon/cocoa accessibility. (d) sufficient information about a user interface element including the identity, operation and state of the element shall be available to assistive technology. when an image represents a program element, the information conveyed by the image must also be available in text. complete. we expose this information to assistive technolog...
...iety of color selections capable of producing a range of contrast levels shall be provided. complete. mozilla's appearance preferences panel contains a large number of color possibilities. (k) software shall not use flashing or blinking text, objects, or other elements having a flash or blink frequency greater than 2 hz and lower than 55 hz. complete. mozilla supports of <blink> and text-decoration: blink in web pages. in these situations mozilla blinks 1 hz, which is within the allowable range and follows the stricter mil-std standard. (l) when electronic forms are used, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the fo...
... clutter accessibility. ...
...And 6 more matches
Introduction to NSPR
they access. this, and the fact that threads share an address space with other threads in the same process, makes it important to remember that threads are not processes . nspr threads are scheduled in two separate domains: local threads are scheduled within a process only and are handled entirely by nspr, either by completely emulating threads on each host operating system (os) that doesn't support threads, or by using the threading facilities of each host os that does support threads to emulate a relatively large number of local threads by using a relatively small number of native threads. global threads are scheduled by the host os--not by nspr--either within a process or across processes on the entire host. global threads correspond to native threads on the host os. nspr thread...
...uling nspr threads are scheduled by priority and can be preempted or interrupted. the sections that follow briefly introduce the nspr approach to these three aspects of thread scheduling. setting thread priorities preempting threads interrupting threads for reference information on the nspr api used for thread scheduling, see threads. setting thread priorities the host operating systems supported by nspr differ widely in the mechanisms they use to support thread priorities. in general, an nspr thread of higher priority has a statistically better chance of running relative to threads of lower priority. however, because of the multiple strategies to provide execution vehicles for threads on various host platforms, priorities are not a clearly defined abstraction in nspr. at best they ...
...of cpu time that a higher-priority thread might expect relative to a lower-priority thread. this preference is still subject to resource availability, and must not be used in place of proper synchronization. for more information on thread synchronization, see nspr thread synchronization. ...
...And 6 more matches
NSS 3.12.4 release notes
rce tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_4_rtm/src/. major changes in nss 3.12.4 nss 3.12.4 is the version that we submitted to nist for fips 140-2 validation. currently nss 3.12.4 is in the "review pending" state in the fips 140-2 pre-validation list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch these functions will match a string with a shell expression. the exp...
...nly \ and ] require escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. ...
... has been removed. support for openvms has been removed. bugs fixed the following bugs have been fixed in nss 3.12.4. ...
...And 6 more matches
NSS 3.28 release notes
.28, which is a minor release. distribution information the hg tag is nss_3_28_rtm. nss 3.28 requires netscape portable runtime (nspr) 4.13.1 or newer. nss 3.28 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_rtm/src/ new in nss 3.28 new functionality nss includes support for tls 1.3 draft -18. this includes a number of improvements to tls 1.3: the signed certificate timestamp, used in certificate transparency, is supported in tls 1.3 (bug 1252745). key exporters for tls 1.3 are supported (bug 1310610). this includes the early key exporter, which can be used if 0-rtt is enabled. note that there is a difference between tls 1.3 and key exporters in o...
... new functions in ssl.h ssl_exportearlykeyingmaterial implements a key exporter based on the tls 1.3 early exporter secret. ...
...exporter, which can be used if 0-rtt is enabled. note that there is a difference between tls 1.3 and key exporters in older versions of tls. tls 1.3 does not distinguish between an empty context and no context. the tls 1.3 (draft) protocol can be enabled, by defining nss_enable_tls_1_3=1 when building nss. nss includes support for the x25519 key exchange algorithm (bug 957105), which is supported and enabled by default in all versions of tls. new functions in ssl.h ssl_exportearlykeyingmaterial implements a key exporter based on the tls 1.3 early exporter secret. this api is equivalent in function to ssl_exportkeyingmaterial, but it can only succeed if 0-rtt was attempted (on the client) or accepted (on the server). ssl_sendadditionalkeyshares co...
...And 6 more matches
NSS functions
eadings are links to the individual pages where you can edit them. keywords: deprecated - function should no longer be used. updated - function has new arguments such as new flag or addition to structure. ssl functions the public functions listed here are used to configure sockets for communication via the ssl and tls protocols. in addition to the functions listed here, applications that support ssl use some of the certificate functions, crypto functions, and utility functions described below on this page. other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl. the nss home page links to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to eithe...
...inks to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr ...
...setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_seturl mxr 3.2 and later ssl_shutdownserversessionidcache mxr 3.7.4 and later deprecated ssl functions the following ssl functions have been replaced with newer versions. the deprecated functions are not supported by the new ssl shared libraries. applications that want to use the ssl shared libraries must convert to calling the new replacement functions listed below. each function name is linked to its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. fun...
...And 6 more matches
NSS tools : modutil
spec to load into the security database. -ciphers cipher-enable-list enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. -dbdir [sql:]directory specify the database directory in which to access or create security module database files. modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. --dbprefix prefix specify the prefix used on the database files, such as my_ for my_cert8.db. this option is provided as a special cas...
...e flagged as a default provider. the mechanism-list is a colon-delimited list of mechanism names. enclose this list in quotation marks if it contains spaces. the module becomes a default provider for the listed mechanisms when those mechanisms are enabled. if more than one module claims to be a particular mechanism's default provider, that mechanism's default provider is undefined. modutil supports several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable). -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw option. -nocertdb do ...
...tory is used. usage and examples creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. modutil -create -dbdir [sql:]directory adding a cryptographic module adding a pkcs #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms. this can be done by supplying all of the information through modutil directly or by running a jar file and install script. for the most basic case, simply upload the library: modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] f...
...And 6 more matches
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. -dbdir [sql:]directory specify the database directory in which to access or create security module database files. modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. --dbprefix prefix specify the prefix used on the database files, such as my_ for ...
...n-delimited list of mechanism names. enclose this list in quotation marks if it contains spaces. the module becomes a default provider for the listed mechanisms when those mechanisms are enabled. if more than one module claims to be a particular mechanism's default provider, that mechanism's default provider is undefined. modutil supports several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable). -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered aut...
...e and examples creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. modutil -create -dbdir [sql:]directory adding a cryptographic module adding a pkcs #11 module means submitting a supporting library file, enabling its ciphers, and setting default provider status for various security mechanisms. this can be done by supplying all of the information through modutil directly or by running a jar file and install script. for the most basic case, simply upload the library: modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism...
...And 6 more matches
Component Internals
odule/library implements. in this chapter we will outline this entire process. as a component in the xpcom framework illustrates, in addition to the nsgetmodule entry point, there are nsimodule and nsifactory interfaces that control the actual creation of the component, and also the string and xpcom glue parts, which we'll discuss in some detail in the next section (see xpcom glue). these latter supply ease-of-development utilities like smart pointers, generic modules support, and simple string implementations. the largest and possibly most complex part of a component is the code specific to the component itself. but where are the components? components reside in modules, and those modules are defined in shared library files that typically sit in the components directory of an xpcom appli...
...ocation of all type library files mapping of all known interfaces to type libraries where these structures are defined using the data in these two manifests, xpcom knows exactly which component libraries have been installed and what implementations go with which interfaces. additionally, it relates the components to the type libraries in which the binary representations of the interfaces they support are defined. the next section describes how to hook into the xpcom startup and registration process and make the data about your component available in these manifests, so that your component will be found and registered at startup. registration methods in xpcom what is xpcom registration? in a nutshell, registration is the process that makes xpcom aware of your component(s). as this sec...
... nsicomponentregistrar apis from service manager the registration process is fairly involved. this section introduces it in terms of xpcom initialization, and the next chapter describes what you have to do in your component code to register your component with xpcom. once the manifest files are read in, xpcom checks to see if there are any components that need to be registered. there are two supported ways to go about registering your xpcom component. the first is to use xpinstall, which is an installation technology that may or may not come with a gecko application and provides interfaces for registering your component during installation. another, more explicit way to register your component is to run the application regxpcom, which is built as part of mozilla and is also available in ...
...And 6 more matches
nsIClipboard
widget/nsiclipboard.idlscriptable this interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data. ...
... widget/nsiclipboard.idlscriptable this interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data. ...
... the kselectionclipboard is peculiar to the x windows system, where it refers to the primary selection, which is the one that simple mouse selection and middle-click paste ...
...And 6 more matches
nsIDOMNSHTMLDocument
dom/interfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
... dom/interfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2. ...
...an execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 domstring querycommandvalue(in domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes ...
...And 6 more matches
nsIXmlRpcClient
warning: this interface was removed from firefox 3 and is no longer available. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable please add a summary to this article. ...
... inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly 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. null if the last call didn't return an xml-rpc fault. r...
...null if the last call didn't return a valid result. responsestatus readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. responsestring readonly unsigned long the most recent http status code returned from this server. ...
...And 6 more matches
Version, UI, and Status Information - Plugins
minor version numbers for the browser and the plug-in api. int plugin_major, plugin_minor, netscape_major, netscape_minor; // declare variables to hold version numbers void npn_version( &plugin_major, &plugin_minor, &netscape_major, &netscape_minor ); // find version numbers finding out if a feature exists a plug-in can figure out whether it is running in a version of the browser that supports a particular feature by using version or npvers constants (see version feature constants). each npvers constant represents a feature. the plug-in can compare the npvers constant to the version number. if the version supports the feature, the plug-in can operate according to plan. if not, the plug-in cannot use some functionality. if an essential feature is unavailable, the developer must arr...
... it starts by using npn_version to get the version numbers. ...
...-in can operate according to plan. if not, the plug-in cannot use some functionality. if an essential feature is unavailable, the developer must arrange for alternative behavior, shut down the plug-in, or give the user a chance to decide what to do. detecting windowless support on ms windows and mac os x in this example, the has_windowless method finds out whether the current version of the api supports windowless plug-ins. this method for detecting support is only useful on ms windows and mac os x. it starts by using npn_version to get the version numbers. it then uses the netscape_minor version number to find out if the windowless feature, represented by the npvers_has_windowless constant, is supported. if the method returns true, a windowless plug-in can confidently proceed. if false is...
...And 6 more matches
DOMException.code - Web APIs
Web › API › DOMException › code
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
DOMException.message - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Document.execCommand() - Web APIs
itable elements. most commands affect the document's selection (bold, italics, etc.), while others insert new elements (adding a link), or affect an entire line (indenting). when using contenteditable, execcommand() affects the currently active editable element. syntax document.execcommand(acommandname, ashowdefaultui, avalueargument) return value a boolean that is false if the command is unsupported or disabled. note: only returns true if part of a user interaction. don't try using the return value to verify browser support before calling a command. parameters acommandname a domstring specifying the name of the command to execute. see commands for a list of possible commands. ashowdefaultui a boolean indicating whether the default user interface should be shown. this is not i...
...explorer uses this to set the text background color. bold toggles bold on/off for the selection or at the insertion point. internet explorer uses the <strong> tag instead of <b>. clearauthenticationcache clears all authentication credentials from the cache. contentreadonly makes the content document either read-only or editable. this requires a boolean true/false as the value argument. (not supported by internet explorer.) copy copies the current selection to the clipboard. conditions of having this behavior enabled vary from one browser to another, and have evolved over time. check the compatibility table to determine if you can use it in your case. createlink creates an hyperlink from the selection, but only if there is a selection. requires a uri string as a value argument for th...
...character, which may be whitespace. (internet explorer will create a link with a null value.) cut removes the current selection and copies it to the clipboard. when this behavior is enabled varies between browsers, and its conditions have evolved over time. check the compatibility table for usage details. decreasefontsize adds a <small> tag around the selection or at the insertion point. (not supported by internet explorer.) defaultparagraphseparator changes the paragraph separator used when new paragraphs are created in editable text regions. see differences in markup generation for more details. delete deletes the current selection. enableabsolutepositioneditor enables or disables the grabber that allows absolutely-positioned elements to be moved around. the grabber is disabled by...
...And 6 more matches
Document.fonts - Web APIs
Web › API › Document › fonts
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontschrome full support 60edge full support 79firefox full support 41 full support 41 no support 35 — 41disabled disabled from version 35 until version 41 (exclusive): this feature is behind the layout.css.font-loading-api.enabled preference (needs to be set to true). to change preferences i...
... full support 41 full support 41 no support 35 — 41disabled disabled from version 35 until version 41 (exclusive): this feature is behind the layout.css.font-loading-api.enabled preference (needs to be set to true). ...
...And 6 more matches
Document.forms - Web APIs
Web › API › Document › forms
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
DocumentOrShadowRoot.getSelection() - Web APIs
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Element.slot - Web APIs
Web › API › Element › slot
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
FileException - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...pull request. ...
...And 6 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
ileerror.path_exists_err the create and exclusive options were both true, indicating that the directory should be created but must not already exist, but the directory does in fact already exist. fileerror.security_err the request to access the directory was denied for security reasons. fileerror.type_mismatch_err the path specified is not a directory; it's probably a file, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent. filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getdirectory() method. create optional if this property is true, and the requested file or directory doesn't exist, the user agent shou...
...bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
esn't exist. fileerror.path_exists_err the create and exclusive options were both true, indicating that the file should be created but must not already exist, but the file does in fact already exist. fileerror.security_err the request to access the file was denied for security reasons. fileerror.type_mismatch_err the path specified is not a file; it's probably a directory, but might be an unsupported file descriptor such as a pipe; this depends on the user agent to some extent. filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getfile() method. create optional if this property is true, and the requested file or directory doesn't exist, the user agent should cr...
...mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
FileSystemEntry.toURL() - Web APIs
be used to help deal with files whose types aren't recognized automatically by the user agent. if this parameter is omitted, the user agent uses its standard algorithms to identify the file. return value a domstring containing a url that can then be used as a document reference in html content, or an empty string if the url can't be generated (such as if the file system implementation doesn't support tourl()). example if you have a filesystemfileentry corresponding to an image file in a file system available to your web site or app, you can call tourl() to get its url for use in html. if your site is located at http://my-awesome-website.woot, and you have a temporary file system that contains an image file named awesomesauce.jpg, the url returned by tourl() might be (depending on the br...
... this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ontribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
FontFace.display - Web APIs
Web › API › FontFace › display
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
HTMLIFrameElement.src - Web APIs
atibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
HTMLImageElement.useMap - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
HTMLImageElement.vspace - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
HTMLImageElement.width - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
HTMLLinkElement.as - Web APIs
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
databases - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
IDBObjectStore.getKey() - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
IDBTransaction.objectStoreNames - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Using IndexedDB - Web APIs
indexeddb || window.mozindexeddb || window.webkitindexeddb || window.msindexeddb; // don't use "var indexeddb = ..." if you're not in a function. // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction || {read_write: "readwrite"}; // this line should only be needed if it is needed to support the object's constants for older browsers window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) beware that implementations that use a prefix may be buggy, or incomplete, or following an old version of the specification. therefore, it is not recommended to use it in productio...
...r browsers window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) beware that implementations that use a prefix may be buggy, or incomplete, or following an old version of the specification. therefore, it is not recommended to use it in production code. it may be preferable to not support a browser than to claim to support it and fail: if (!window.indexeddb) { console.log("your browser doesn't support a stable version of indexeddb. such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var request = window.indexeddb.open("mytestdatabase", 3); see that? opening a database is just like any...
...nformation, you should read it out and save it somewhere else before upgrading the database.) trying to create an object store with a name that already exists (or trying to delete an object store with a name that does not already exist) will throw an error. if the onupgradeneeded event exits successfully, the onsuccess handler of the open database request will then be triggered. blink/webkit supports the current version of the spec, as shipped in chrome 23+ and opera 17+; ie10+ does too. other and older implementations don't implement the current version of the spec, and thus do not support the indexeddb.open(name, version).onupgradeneeded signature yet. for more information on how to upgrade the version of the database in older webkit/blink, see the idbdatabase reference article. struc...
...And 6 more matches
MediaRecorder.audioBitsPerSecond - Web APIs
table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Performance.timeOrigin - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedAngle - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedBoolean - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedEnumeration - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedInteger - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedLength - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedLengthList - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedNumber - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedNumberList - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedPreserveAspectRatio - Web APIs
y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedRect - Web APIs
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedString - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...thub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGAnimatedTransformList - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGLengthList - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGNumberList - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
SVGPreserveAspectRatio - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Selection.extend() - Web APIs
Web › API › Selection › extend
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Selection.removeAllRanges() - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Selection.removeRange() - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...b.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
StereoPannerNode.StereoPannerNode() - Web APIs
y table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d us a pull request. ...
...And 6 more matches
HTMLSlotElement.assignedSlot - Web APIs
Web › API › Text › assignedSlot
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Signaling and video calling - Web APIs
her. this process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. through this third server, the two devices can locate one another, and exchange negotiation messages. in this article, we will further enhance the websocket chat first created as part of our websocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out this example on glitch, and you can remix the example to experiment with it as well. you can also look at the full project on github. note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections. in addition, there is a short timeout period; the glitch instance is ...
...r peer, you do so, and the other peer knows how to receive this information and deliver it to its own ice subsystem. all you have to do is channel the information back and forth. the contents don't matter at all to the signaling server. readying the chat server for signaling our chat server uses the websocket api to send information as json strings between each client and the server. the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages. to allow the server to support signaling and ice negotiation, we need to update the code. we'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, ...
...e. we'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, without the server needing to know what they are. this lets us send signaling messages using this same server, instead of needing a separate server. let's take a look which changes we need to make to the chat server support webrtc signaling. this is in the file chatserver.js. first up is the addition of the function sendtooneuser(). as the name suggests, this sends a stringified json message to a particular username. function sendtooneuser(target, msgstring) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i]...
...And 6 more matches
Using WebRTC data channels - Web APIs
snippet, the channel is created with negotiated set to true, then a function called requestremotechannel() is used to trigger negotiation, to create a remote channel with the same id as the local channel. doing this lets you create data channels with each peer using different properties, and to create channels declaratively by simply using the same value for id. buffering webrtc data channels support buffering of outbound data. this is handled automatically. while there's no way to control the size of the buffer, you can learn how much data is currently buffered, and you can choose to be notified by an event when the buffer starts to run low on queued data. this makes it easy to write efficient routines that make sure there's always data ready to send without over-using memory or swamping...
... being transmitted over a network, there are size restrictions. at a fundamental level, the individual network packets can't be larger than a certain value (the exact number depends on the network and the transport layer being used). at the application level—that is, within the user agent's implementation of webrtc on which your code is running—the webrtc implementation implements features to support messages that are larger than the maximum packet size on the network's transport layer. this can complicate things, since you don't necessarily know what the size limits are for various user agents, and how they respond when a larger message is sent or received. even when user agents share the same underlying library for handling stream control transmission protocol (sctp) data, there can st...
...sages that it believes are complete, and will deliver them to the receiving rtcdatachannel as multiple messages. messages smaller than 16kib can be sent without concern, as all major user agents handle them the same way. beyond that, things get more complicated. ...
...And 6 more matches
Using bounded reference spaces - Web APIs
system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, and providing guidance to move back toward the origin point, or at least to stay inside the safe zone. xr hardware that does not have an inherent boundary defined may or may not support the bounded reference space. if it does, it likely has a system in place to allow the user to specify or select the boundaries to apply if a bounded space is to be used. however, it's entirely possible that the device will simply decline to support bounded spaces at all, so you should be prepared to fall back to some other type of reference space. understanding boundaries as mentioned previ...
...d reference spaces, it's important to keep in mind that not all xr devices are capable of creating them. by their very nature, bounded reference spaces have special hardware requirements, since they need to allow for the user to physically move around in space while their movements are tracked. ...
...cial hardware requirements, since they need to allow for the user to physically move around in space while their movements are tracked. in this section, we'll look at how to safely create a session that will work whether bounded spaces are supported or not. safely creating a bounded-preferred space before actually attempting to create a bounded reference space, you need to create a session that supports them. ...
...And 6 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
the mouse to pitch and yaw the view angle. allowkeyboardmotion if true, the w, a, s, and d keys move the viewer forward, left, backward, and to the right, while the up and down arrow keys move up and down. if false, only xr device changes to the view are permitted. enableforcepolyfill if this boolean is true, the example will attempt to use the webxr polyfill even if the browser actually has support for webxr. if false, the polyfill is only used if the browser doesn't implement navigator.xr. session_type the type of xr session to create: inline for an inline session presented in the context of the document and immersive-vr to present the scene to an immersive vr headset. mouse_speed a multiplier used to scale the inputs from the mouse used for pitch and yaw control. move_distance t...
... if navigator.xr is defined. if it isn't—and/or the enableforcepolyfill configuration constant is set to true—we install the webxr polyfill by instantiating the webxrpolyfill class. ...
...the webxr polyfill by instantiating the webxrpolyfill class. handling the startup and shutdown ui then we call the setupxrbutton() function, which handles configuring the "enter/exit webxr" button to enable or disable it as necessary depending on the availability of webxr support for the session type specified in the session_type constant. ...
...And 6 more matches
Window.customElements - Web APIs
specification specification status comment html living standardthe definition of 'w...
...the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcustomelementschrome full support 54edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). to change preferen...
...And 6 more matches
Window.open() - Web APIs
Web › API › Window › open
th the specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the specified resource is loaded into it. syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded. this can be a path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is specified as url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname. t...
...return null, so the originating window will not have access to the new one either. this is useful for preventing untrusted sites opened via window.open() from tampering with the originating window, and vice versa. note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab. this is supported in modern browsers including chrome, and firefox 52+. see rel="noopener" for more information and for browser compatibility details, including information about ancillary effects. noreferrer if this feature is set, the request to load the content located at the specified url will be loaded with the request's referrer set to noreferrer; this prevents the request from sending the url of the...
...to load the content located at the specified url will be loaded with the request's referrer set to noreferrer; this prevents the request from sending the url of the page that initiated the request to the server where the request is sent. in addition, setting this feature also automatically sets noopener. see rel="noreferrer" for additional details and compatibility information. firefox introduced support for noreferrer in firefox 68. best practices <script type="text/javascript"> var windowobjectreference = null; // global variable function openffpromotionpopup() { if(windowobjectreference == null || windowobjectreference.closed) /* if the pointer to the window object in memory does not exist or if such pointer exists but the window was closed */ { windowobjectreference = ...
...And 6 more matches
window.requestIdleCallback() - Web APIs
table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestidlecallback experimentalchrome full support 47edge full support 79firefox full support 55notes full support 55notes notes enabled by default. ...
...And 6 more matches
WritableStreamDefaultWriter.ready - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Accessibility documentation index - Accessibility
pment means enabling as many people as possible to use web sites, even when those people's abilities are limited in some way. 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 javascript) more accessible to people with disabilities. it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies 3 aria screen reader implementors guide aria, accessibility this is just a guide. live region markup is a complex area which is somewhat open to interpretation. the following is intended to provide implementation guidance that respects screen readers developers'...
...lementors guide aria, accessibility this is just a guide. live region markup is a complex area which is somewhat open to interpretation. the following is intended to provide implementation guidance that respects screen readers developers' need to try different things. the intention is to strike a balance between providing useful guidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete. 4 aria test cases aria, accessibility for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determ...
...unity. if you notice an implementation issue, please take a little time and let the developers know. here's where to file bugs: 13 using aria: roles, states, and properties aria, accessibility, overview, reference aria defines semantics that can be applied to elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role. authors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element). addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom. 14 aria technique template ac...
...And 6 more matches
:has() - CSS: Cascading Style Sheets
Web › CSS › :has
the :has() css pseudo-class represents an element if any of the selectors passed as parameters (relative to the :scope of the given element) match at least one element. ...
...s a relative selector list as an argument. in earlier revisions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets. instead, it could only be used with functions like document.queryselector(); this was due to performance concerns. this limitation has been removed because no browser implemented it that way. instead, browsers currently only support the use of :has() within stylesheets. examples matching <a> elements that directly contain an <img> the following selector matches only <a> elements that directly contain an <img> child: a:has(> img) matching <h1> elements that are followed by a <p> the following selector matches <h1> elements only if they have a <p> element directly following them: h1:has(+ p) specifications ...
...tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
:host - CSS: Cascading Style Sheets
Web › CSS › :host
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:hostchrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences i...
... full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). ...
...And 6 more matches
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
the history of flexbox as with all css specifications the flexbox specification went through a large number of changes before it became the candidate recommendation that we have today. as a candidate recommendation we should not see large changes at this point to the spec, however this has not been the case with past flexbox iterations. flexbox was implemented in an experimental way in several web browsers. ...
...te different. to create a flex container you would use display: box and there were a number of box-* properties, which did things that you will recognise from flexbox today. there was an update to the spec that updated the syntax to display: flexbox — this was again vendor-prefixed. ultimately the specification was updated to define display: flex as the way to create a flex container. browser support for the up-to-date version of the specification is excellent from this point forward. there are a few old articles in existence that refer to the older versions of flexbox, which are pretty easy to identify due to the change in the way that a flex container is created. if you find something referring to display: box or display: flexbox this is outdated information. status in browsers brows...
...t for the up-to-date version of the specification is excellent from this point forward. there are a few old articles in existence that refer to the older versions of flexbox, which are pretty easy to identify due to the change in the way that a flex container is created. if you find something referring to display: box or display: flexbox this is outdated information. status in browsers browser support for flexbox is excellent, and the majority of browsers do not need a prefix at this point. safari was the last of the major browsers to remove prefixes, with the release of safari 9 in 2015. the two browsers you should still keep in mind for cross-browser compatibility are: internet explorer 10, which implemented the display: flexbox version of the specification with the -ms- prefix. uc b...
...And 6 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
these extensions are generally prefixed with -webkit-. most -webkit- prefixed properties also work with an -apple- prefix. a few are prefixed with -epub-. webkit-only properties note: avoid using on websites. these properties will only work in webkit applications. ...
...or -webkit-text-security -webkit-text-stroke-color -webkit-text-stroke-width -webkit-text-stroke -webkit-text-zoom -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z u -webkit-user-drag -webkit-user-modify * a few are on the standards, unprefixed track ** new syntax has been standardized. property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y formerly proprietary properties that are now standard note: to maximize the compatibility of your css, you should use the unprefixed standard propertie...
...phasis-style -webkit-text-justify -webkit-text-orientation -webkit-text-size-adjust -webkit-text-underline-position -webkit-transform -webkit-transform-origin -webkit-transform-style -webkit-transition -webkit-transition-delay -webkit-transition-duration -webkit-transition-property -webkit-transition-timing-function u-w -webkit-user-select -epub-word-break -epub-writing-mode supported in non-webkit browsers without a prefix, but not standard the following properties are supported in at least one browser without a prefix, but are not on the standards track. -webkit-mask-position-x* -webkit-mask-position-y* * supported unprefixed in firefox, with prefix in safari. supported in firefox with -webkit- prefix the following properties are supported with the -webkit- ...
...And 6 more matches
box-align - CSS: Cascading Style Sheets
Web › CSS › box-align
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...o contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbox-align deprecatednon-standardchrome full support 1prefixed full support 1prefixed prefixed implemented with the vendor prefix: -webkit-edge full support 12prefixed full support 12prefixed prefixed implemented with the vendor prefix: -webkit-firefox full support 1prefixed full support 1prefixed prefixed implemented with the vendor prefix: -moz- full support ...
...And 6 more matches
column-count - CSS: Cascading Style Sheets
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 6 more matches
Adding captions and subtitles to HTML5 video - Developer guides
ont-size:1rem; font-weight:bold; color:#666; background:#000; border-radius:2px; } there are also other css changes that are specific to some extra javascript implementation, but these will be mentioned at the appropriate place below. subtitle implementation a lot of what we do to access the video subtitles revolves around javascript. similar to the video controls, if a browser supports html5 video subtitles, there will be a button provided within the native control set to access them. however, since we have defined our own video controls, this button is hidden, and we need to define our own. browsers do vary as to what they support, so we will be attempting to bring a more unified ui to each browser where possible. there's more on browser compatibility issues later on. i...
... the ::cue pseudo-element is the key to targetting individual text track cues for styling, as it matches any defined cue. there are only a handful of css properties that can be applied to a text cue: color opacity visibility text-decoration text-shadow background shor...
...s voice spans, which allow cues to be defined as having a particular "voice": 0 00:00:00.000 --> 00:00:12.000 <v test>[test]</v> then this specific 'voice' will be stylable like so: ::cue(v[voice='test']) { color:#fff; background:#0095dd; } note: some of the styling of cues with ::cue currently works on chrome, opera, and safari, but not yet on firefox. browser compatibility browser support for webvtt and the <track> element is fairly good, although some browsers differ slightly in their implementation. internet explorer internet explorer 10+ subtitles are enabled by default, and the default controls contain a button and a menu that offers the same functionality as the menu we just built. the default attribute is also supported. note: ie will completely ignore webvtt files u...
...And 6 more matches
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › content
tributes this element includes the global attributes. select a comma-separated list of selectors. these have the same syntax as css selectors. they select the content to insert in place of the <content> element. example here is a simple example of using the <content> element. it is an html file with everything needed in it. note: for this code to work, the browser you display it in must support web components. see enabling web components in firefox. <html> <head></head> <body> <!-- the original content accessed by <content> --> <div> <h4>my content heading</h4> <p>my content text</p> </div> <script> // get the <div> above. var mycontent = document.queryselector('div'); // create a shadow dom on the <div> var shadowroot = mycontent.createshadowroot(); ...
...y table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontent deprecatednon-standardchrome full support 35edge full support 79firefox no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true). to change preferences in firefox, ...
... full support 79firefox no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true). ...
...And 6 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
y other attributes to achieve various purposes: referrer/cors control for security and privacy: see crossorigin and referrerpolicy. use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. responsive image hints with sizes and srcset (see also the <picture> element and our responsive images tutorial). supported image formats the html standard doesn't list what image formats to support, so each user agent supports different formats. a complete guide to image formats supported by web browsers is available. below is a list of the image formats that are most commonly used on the web, as well as some older formats that should no longer be used, despite existing content possibly still using them. ...
... image loading errors if an error occurs while loading or rendering an image, and an onerror event handler has been set on the error event, that event handler will get called. this can happen in a number of situations, including: the src attribute is empty ("") or null. the src url is the same as the url of the page the u...
...s, including: the src attribute is empty ("") or null. the src url is the same as the url of the page the user is currently on. the image is corrupted in some way that prevents it from being loaded. the image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were specified in the <img> element's attributes. the image is in a format not supported by the user agent. attributes this element includes the global attributes. alt defines an alternative text description of the image. note: browsers do not always display images. there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by people with visual impairments) the user chooses not to display imag...
...And 6 more matches
Object.create() - JavaScript
ative code] }" // ...and all the rest of the properties and methods of object.prototype. as shown, objects modified this way now look very much like ordinary objects. polyfill this polyfill covers the main use case, which is creating a new object for which the prototype has been chosen but doesn't take the second argument into account. note that while the setting of null as [[prototype]] is supported in the real es5 object.create, this polyfill cannot support it due to a limitation inherent in versions of ecmascript lower than 5. if (typeof object.create !== "function") { object.create = function (proto, propertiesobject) { if (typeof proto !== 'object' && typeof proto !== 'function') { throw new typeerror('object prototype may only be an object: ' + proto); ...
...an 5. ...
...peerror('object prototype may only be an object: ' + proto); } else if (proto === null) { throw new error("this browser's implementation of object.create is a shim and doesn't support 'null' as the first argument."); } if (typeof propertiesobject != 'undefined') { throw new error("this browser's implementation of object.create is a shim and doesn't support a second argument."); } function f() {} f.prototype = proto; return new f(); }; } examples classical inheritance with object.create() below is an example of how to use object.create() to achieve classical inheritance. this is for a single inheritance, which is all that javascript supports. // shape - superclass function shape() { this.x = 0; this...
...And 6 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
m is looking at your site. but this is increasingly inefficient: browser sniffing is inherently error prone, and maintaining multiple copies of your code can turn out to be a nightmare. it is usually much better to create a single version of your code which doesn't care about what browser or platform is accessing the site, but instead uses feature tests to find out what code features the browser supports or what the values of certain browser features are, and then adjusts the code appropriately. this tends to be termed responsive design or adaptive design, two related but different approaches. this is much more reliable, more maintainable, and more future proof. you don't get caught in the situation of having to bring out more new site versions as more new browsers and platforms come out, a...
...f certain browser features are, and then adjusts the code appropriately. this tends to be termed responsive design or adaptive design, two related but different approaches. this is much more reliable, more maintainable, and more future proof. you don't get caught in the situation of having to bring out more new site versions as more new browsers and platforms come out, and adjust code as feature support in existing browsers changes. there are disadvantages to this approach as well. if the content, layout, and functionality need to change greatly for different devices, it may not be such a good approach. also, taking an existing site and adding responsiveness to it, to make it mobile/tablet friendly, can be a lot more effort than just creating a separate mobile site or app, especially if it ...
...s kick in appropriately. there are many more options available in the viewport meta tag, which you can read about in using the viewport meta tag to control layout on mobile browsers. note: there is a spec called device adaptation, which defines the same functionality but in css, using a @viewport at-rule. this is probably a more logical place to put such information, but the spec is not as well supported as the viewport meta tag, therefore you should stick with that for now. responsive images/video another problem that comes up more and more these days is making image/video weight (size in kb) responsive as well as the dimensions of the image on screen. yes, you want the images to be contained inside the app ui whether you are using it on desktop or mobile, but you should also consider t...
...And 6 more matches
jpm - Archive of obsolete content
installing npm there are two ways to get npm. ...
.... see selecting a browser version. problems? if you do not see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing list. someone else may have had the same problem you do, so try searching the list. you are welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. command reference jpm supports the following commands: jpm init create a skeleton add-on as a starting point for your add-on. jpm run launch an instance of firefox with your add-on installed. jpm test runs your add-on's unit tests. jpm xpi package your add-on as an xpi file, which is the install file format for firefox add-ons. jpm post package your add-on as an...
...atchpost package your add-on as an xpi file whenever there is a file change and post that to some url. jpm sign package your add-on as an xpi file, and then retrieve a new xpi signed by mozilla. jpm init this command initializes a new add-on from scratch. create a new directory, change into it, and run jpm init. mkdir my-addon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. title name: this defaults to the name of the directory in which you are running jpm init. unless an id field is present in package.json, jpm prepends "@" to name and use the result as the id field in the add-on's install manifest. version description entry point (which maps to "main" in pack...
...And 5 more matches
Preferences - Archive of obsolete content
et a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value. however, there is a concept of complex types, which makes it easier for developers to save and load nsilocalfile and nsisupportsstring objects in preferences (as strings — note that from the preferences system's point of view, complex values have a nsiprefbranch.pref_string type.) there are two nsiprefbranch methods implementing the concept — setcomplexvalue() and getcomplexvalue(). you can look up their implementations in nsprefbranch.cpp. here are the idl definitions: void getcomplexvalue(in string aprefname, ...
...ype.) there are two nsiprefbranch methods implementing the concept — setcomplexvalue() and getcomplexvalue(). you can look up their implementations in nsprefbranch.cpp. here are the idl definitions: void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); as you can see, both of them take a parameter, atype, which can have one of the following values (to be precise, you should pass components.interfaces.nsiwhatever instead of just nsiwhatever, which is undefined). nsisupportsstring used to handle unicode strings in preferences. use this when the preference value may contain non-ascii characters (for example, a user's name). n...
... take a parameter, atype, which can have one of the following values (to be precise, you should pass components.interfaces.nsiwhatever instead of just nsiwhatever, which is undefined). nsisupportsstring used to handle unicode strings in preferences. use this when the preference value may contain non-ascii characters (for example, a user's name). nsipreflocalizedstring almost the same as nsisupportsstring, but it is handled differently in getcomplexvalue() when there's no user value for the given preference; see below for details. nsilocalfile and nsirelativefilepref store paths in preferences. ...
...And 5 more matches
Index of archived content - Archive of obsolete content
rosetta running applications svg animation svg general scrollbar sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets xml:base support in old browsers xpath getattributens common pitfalls communication between html and your extension creating custom firefox extensions with the mozilla build system custom about: urls default preferences deploying a plugin as an extension developing ad...
... displaying web content in an extension without security issues downloading json and javascript in extensions enhanced extension installation extension etiquette extension library extension packaging extension samples extension theming guidelines extension versioning, update and compatibility extensions support in seamonkey 2 firefox addons developer guide hiding browser chrome hotfix extension how to convert an overlay extension to restartless inline options install manifests installing extensions and themes from web pages interaction between privileged and non-privileged pages jetpack processes lega...
...r notifications and alerts xpcom objects performance best practices in extensions search extension tutorial (draft) security best practices in extensions session store api setting up an extension development environment signing an xpi signing an extension supporting search suggestions in search plugins tabbed browser techniques promises updating addons broken by private browsing changes using dependent libraries in extension components using the stylesheet service bookmarks.export() bookmarks.import() ...
...And 5 more matches
XUL Questions and Answers - Archive of obsolete content
to xul faq (make sure they have a clear answer.) where can i get more information about creating mozsearch plugins? creating mozsearch plugins contains more help information about creating mozsearch plugin on firefox 2. more documentation on search plugins is available in the search plugins category. is localizing remote xul possible? loading remote dtds for xml documents is currenty not supported in xul. the following bugs were reported on this issue: bug 22942, bug 133698. is there an editor widget in xul that supports syntax highlighting? daniel glazman has been working on this for his projects. he said the code will be open-source, but it is not released yet (as of oct 2006). some teasers are on his blog. overlaying elements without ids the original developers only tend t...
...put ids where they need them. as an extension author, you have at least two options: use dom methods to dynamically create or rearrange elements file an enhancement request in bugzilla to have extra ids added. ...
...ions: use dom methods to dynamically create or rearrange elements file an enhancement request in bugzilla to have extra ids added. ...
...And 5 more matches
XUL Explorer - Archive of obsolete content
option to include a user snippet file. the snippets are merged with the built-in snippets at startup. double-click or drag-and-drop to insert a snippet file > new allows user to pick any “template” snippet, as well as blank. simple xul checker can be used to ‘validate’ the xul snippet. it checks for legal element and attribute names, including allowed attributes for a given element. ...
...rtup. double-click or drag-and-drop to insert a snippet file > new allows user to pick any “template” snippet, as well as blank. simple xul checker can be used to ‘validate’ the xul snippet. it checks for legal element and attribute names, including allowed attributes for a given element. ...
.... simple xul checker can be used to ‘validate’ the xul snippet. it checks for legal element and attribute names, including allowed attributes for a given element. ...
...And 5 more matches
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
s all of the interfaces that you would normally expect to exist in the plugins will still exist when using xembed plugins. there are only two key differences: in the npp_setwindow call, the window parameter will be the xid of the hosting xembed window. as an implementation note, this is really the xid of a gtksocket window. in your plugin instance npp_getvalue call you need to make sure that you support the new nppvpluginneedsxembed value. more information is included on this below. hosting using gtk2.x included below are a couple of code snippits that should help you get started as well as some hints on building a successful plugin. please use the following diagram as a reference: as you can see from the diagram above, it's pretty easy to set up a plugin using gtk2. the general idea is th...
... the following diagram as a reference: as you can see from the diagram above, it's pretty easy to set up a plugin using gtk2. the general idea is that you use the xid that was passed into your npp_setwindow() call and create a gtkplug to host inside of that socket. since the gtkplug is just a container, you can add your own widgets at your leisure with the packing you prefer. telling mozilla you support xembed as mentioned above, you will need to tell mozilla that you support the xembed protocol for hosting plugins. for backwards compatibility reasons if you don't tell mozilla that you support it it will try to hand you an xt widget as a parent. however, before you do so you should make sure that the browser also supports xembed when the plugin is first initialized. if you've built your plug...
...ioned above, you will need to tell mozilla that you support the xembed protocol for hosting plugins. for backwards compatibility reasons if you don't tell mozilla that you support it it will try to hand you an xt widget as a parent. however, before you do so you should make sure that the browser also supports xembed when the plugin is first initialized. if you've built your plugin so that it will support either xt or xembed you can include a fallback for older style hosting. if you haven't you can return an error and the plugin will be ignored. it's good practice to do this in case people try to install your plugin for older versions of the browser that don't support xembed functionality. this is an incomplete example of what a piece of code might look like that tries to check for the proper ...
...And 5 more matches
LiveConnect Overview - Archive of obsolete content
va string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring is a javaobject because it holds an instance of the java object string. as a javaobject, mystring has access to the public instance methods of java.lang.string and its superclass, java.lang.object. these java methods are available in javascript as methods of the javaobject, and you can call them as follows: mystring.length(); // returns 11 static members can be called directly on the javaclass object. alert(java.lang.integer.max_value); //alerts 2147483647 the packages object if a java class is not part of the java, sun, or netscape packages, you access it with t...
...java methods are available in javascript as methods of the javaobject, and you can call them as follows: mystring.length(); // returns 11 static members can be called directly on the javaclass object. alert(java.lang.integer.max_value); //alerts 2147483647 the packages object if a java class is not part of the java, sun, or netscape packages, you access it with the packages object. for example, suppose the redwood corporation uses a java package called redwood to contain various java classes that it implements. to create an instance of the helloworld class in redwood, you access the constructor of the class as follows: var red = new packages.redwood.helloworld(); you can also access classes in the default package (that is, classes that don't explicitly name a package). for example, if the ...
...member or method and fails, the java exception is passed on to javascript for you to handle. beginning with javascript 1.4, you can catch this exception in a try...catch statement. (although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a variable called theclass. the forname method throws an exception if the value you pass it does not evaluate to the name of a java class. place the forname assignment stateme...
...And 5 more matches
Plug-in Development Overview - Gecko Plugin API Reference
irectory for your operating system. see installing plug-ins. test your plug-in and debug as necessary. create an html page and embed the plug-in object. for information about the html elements to use, see using html to display plug-ins. to see your plug-in in action, simply display the html page that calls it in the browser. registering plug-ins gecko identifies a plug-in by the mime type it supports. when it needs to display data of a particular mime type, the browser finds and invokes the plug-in object that supports that type. the data can come from either an object element in an html file (where the object or embed element either specifies the mime type directly or references a file of that type), from a separate non-html file of that mime type, or from the server. the server looks ...
...r looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser. the browser looks up the media type, and if it finds a plug-in registered to that type, loads the plug-in software. when it starts up, the browser checks for plug-in modules for the platform and registers them. it determines which plug-ins are installed and which types they support through a combination of user preferences that are private to the browser, the contents of the plug-ins directory, or the registry on windows. a mime type is made up of a major type (such as application or image) and a minor type, for example, image/jpeg. if you define a new mime type for a plug-in, you must register it with ietf (internet engineering task force). until your new mime type is...
...escription, which will appear in the navigator.plugins dom object which is used to populate about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-ins are found according to the section how gecko finds plug-ins. plug-ins are identified by file type nspl. ...
...And 5 more matches
The HTML5 input types - Learn web development
some new input types, which were added in html5 to allow collection of specific types of data. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the newer input type values available to create native form controls, and how to implement them using html. note: most of the features discussed in this article have wide support across browsers. we'll note any exceptions. if you want more detail on browser support, you should consult our html forms element reference, and in particular our extensive <input> types reference. because html form control appearance may be quite different from a designer's specifications, web developers sometimes build their own custom form controls. we cover this in an advanced tutorial:...
...tep="0.01"> the number input type makes sense when the range of valid values is limited, for example a person's age or height. 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 option; it provides the numeric keypad while forgoing the number's spinner ui feature. note: number inputs are not supported in versions of internet explorer below 10. slider controls another way to pick a number is to use a slider. you see these quite often on sites like housebuying sites where you want to set a maximum property price to filter by. let's look at a live example to illustrate this: usage-wise, sliders are less accurate than text fields. therefore, they are used to pick a number whose precise...
...istener('input', function() { output.textcontent = price.value; }); here we store references to the range input and the output in two variables. then we immediately set the output's textcontent to the current value of the input. finally, an event listener is set to ensure that whenever the range slider is moved, the output's textcontent is updated to the new value. note: range inputs are not supported in versions of internet explorer below 10. date and time pickers gathering date and time values has traditionally been a nightmare for web developers. for good user experience, it is important to provide a calendar selection ui, enabling users to select dates without necessating context switching to a native calendar application or potentially entering them in differing formats that are ...
...And 5 more matches
How to build custom form controls - Learn web development
to make our control behave like a <select> element, and the second part will consist of the fancy styles used to make it look the way we want. required styles the required styles are those necessary to handle the three states of our control. .select { /* this will create a positioning context for the list of options; adding this to .select:focus-within will be a better option when fully supported */ position: relative; /* this will make our control become part of the text flow and sizable at the same time */ display : inline-block; } we need an extra class active to define the look and feel of our control when it is in its active state. because our control is focusable, we double this custom style with the :focus pseudo-class in order to be sure they will behave the same. ...
...*/ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { /* because the value can be wider than our control, we have to make sure it will not change the control's width. if the content overflows, we display an ellipsis */ display : inline-block; width : 100%; overflow : hidden; white-space : nowrap...
...y: you should always consider this possibility. the script is in conflict with a third party script: this can happen with tracking scripts or any bookmarklets the user uses. the script is in conflict with, or is affected by, a browser extension (such as firefox's noscript extension or chrome's notscripts extension). the user is using a legacy browser, and one of the features you require is not supported: this will happen frequently when you make use of cutting-edge apis. the user is interacting with the content before the javascript has been fully downloaded, parsed, and executed. because of these risks, it's really important to seriously consider what will happen if your javascript doesn't work. we'll discuss options to consider and cover the basics in our example (a full discussion of...
...And 5 more matches
Inheritance in JavaScript - Learn web development
o). the technique we covered here is not the only way to create inheriting classes in javascript, but it works ok, and it gives you a good idea about how to implement inheritance in javascript. you might also be interested in checking out some of the new ecmascript features that allow us to do inheritance more cleanly in javascript (see classes). we didn't cover those here, as they are not yet supported very widely across browsers. all the other code constructs we discussed in this set of articles are supported as far back as ie9 or earlier, and there are ways to achieve earlier support than that. a common way is to use a javascript library — most of the popular options have an easy set of functionality available for doing inheritance more easily and quickly. coffeescript for example pr...
...arity will come with practice. ecmascript 2015 classes ecmascript 2015 introduces class syntax to javascript as a way to write reusable classes using easier, cleaner syntax, which is more similar to classes in c++ or java. in this section we'll convert the person and teacher examples from prototypal inheritance to classes, to show you how it's done. note: this modern way of writing classes is supported in all modern browsers, but it is still worth knowing about the underlying prototypal inheritance in case you work on a project that requires supporting a browser that doesn't support this syntax (most notably internet explorer). let's look at a rewritten version of the person example, class-style: class person { constructor(first, last, age, gender, interests) { this.name = { ...
...this.subject = subject; this.grade = grade; } } but there's a little catch. unlike old-school constructor functions where the new operator does the initialization of this to a newly-allocated object, this isn't automatically initialized for a class defined by the extends keyword, i.e the sub-classes. therefore running the above code will give an error: uncaught referenceerror: must call super constructor in derived class before accessing 'this' or returning from derived constructor for sub-classes, the this intialization to a newly allocated object is always dependant on the parent class constructor, i.e the constructor function of the class from which you're extending. here we are extending the person class — the teacher sub-class is an extension of the person class. so for tea...
...And 5 more matches
CSUN Firefox Materials
icult for ordinary people. firefox's "www for everyone" philosophy is also a great accessibility story. every user, regardless of what accomodations they need, can enjoy a less cluttered web, free of intrusions such as popup ads and spyware. the simple, uncluttered user interface is simply more pleasant. as a result, nearly everyone who tries firefox finds themselves hooked.. assistive technology support on windows "i am a full firefox convert with the release of 1.5. at my next opportunity, i intend to convert my family over to it too. " -- darren paskell, from window-eyes beta testing list firefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. jaws support is quickly catching up as well. in recent articles from both afb's acces...
...explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and app reader. firefox on linux currently boasts the best onscreen keyboard support in the industry via gok, the gnome onscreen keyboard. basic screen reader accessibility is available via gnopernicus or the fire vox extension. keyboard support "mozilla firefox is a web-browser with superior keyboard support. " - alan cantor, cantor acc...
...s you to move through web content one letter a time. you can even select web content and copy it to the clipboard. -- all with the keyboard moving back and forward by web page (alt+left and alt+right) occurs near-instantaneously the download manager provides keyboard access to all of your recent downloads customize your experience! many users are finding the true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus removes ads...
...And 5 more matches
Error codes returned by Mozilla APIs
be called before other methods are used. ns_error_already_initialized (0xc1f30002) an attempt is made to initialize a component or object again which has already been initialized. ns_error_not_implemented (0x80004001) this error is caused by methods which are not implemented. this could occur because the implementation has not yet been written, or because the component intentionally does not support the desired feature. ns_error_no_interface (0x80004002) an attempt was made to call queryinterface to retrieve an interface which an object does not support. ns_error_null_pointer (0x80004003) an error occurred because a value was set to null when this was not expected. ns_error_abort (0x80004004) this error indicates that an operation failed and the caller should abort whatever action ...
...ror code does not apply. ns_error_unexpected (0x8000ffff) an operation did not complete due to a condition which was not expected. this error occurred rather than continuing. ns_error_out_of_memory (0x8007000e) this error occurs when there is not enough memory available to carry out an operation, or an error occurred trying to allocate memory. ns_error_illegal_value (0x80070057) an argument supplied to a method was not valid, for instance a null value was supplied as an argument which does not allow null values, or a value was out of range. ns_error_no_aggregation (0x80040110) ns_error_not_available (0x80040111) an operation could not be completed because some other necessary component or resource was not available. ns_error_factory_not_registered (0x80040154) returned when a se...
...nent or resource was not available. ns_error_factory_not_registered (0x80040154) returned when a service could not be found. ns_error_factory_register_again (0x80040155) this error is returned when registering a component and the registration should try registering again later. ns_error_factory_not_loaded (0x800401f8) ns_error_factory_exists (0xc1f30100) ns_error_factory_no_signature_support (0xc1f30101) ns_error_proxy_invalid_in_parameter (0x80010010) ns_error_proxy_invalid_out_parameter (0x80010011) ns_error_cannot_convert_data (0x80460001) ns_error_object_is_immutable (0x80460002) ns_error_loss_of_significant_data (0x80460003) ns_error_illegal_during_shutdown (0x8046001e) many operations cannot be performed once the application is being shutdown. this ...
...And 5 more matches
IME handling guide
timing may not be safe actually, but it causes a lot of oranges of automated tests. see also notifications to ime section for the detail of sending notifications. currently, widgetquerycontentevent is handled via imecontentobserver because if it has a cache of selection, it can set reply of equeryselectedtext event only with the cache. that is much faster than using contenteventhandler. e10s support even when a remote process has focus, native ime handler in chrome process does its job. so, there is process boundary between native ime handler and focused editor. unfortunately, it's not allowed to use syncronous communication from chrome process to a remote process. this means that chrome process (and also native ime and our native ime handler) cannot query the focused editor contents di...
... when tabparent receives notification from corresponding remote process, it assigns contentcacheinparent new contentcache and post the notification to contentcacheinparent. if all sent widgetcompositionevents and widgetselectionevents are already handled in the remote process, contentcacheinparent sending the notifications to widget. and also this handles widgetquerycontentevents with its cache. supported event messages of them are: equeryselectedtext (only with selectiontype::enormal) equerytextcontent equerytextrect equerycaretrect equeryeditorrect additionally, this does not support query content events with xp line breakers but this must not be any problem since native ime handlers query contents with native line breakers. contentcacheinparent also manages sent widgetcompositio...
...yle_* defined in nsstyleconsts.h. ui.imerawinputunderlinestyle ui.imeselectedrawtextunderlinestyle ui.imeconvertedtextunderlinestyle ui.imeselectedconvertedtextunderlinestyle underline width can be specified with "ui.imeunderlinerelativesize" pref. this affects all types of clauses. the value should be 100 or 200. 100 means normal width, 200 means double width. on some platforms, ime may support its own style for each clause. currently, this feature is supported in tsf mode of windows and on linux. the style information is stored in textrangestyle which is defined in textrange.h. it's a member of textrange. textrange is stored in mranges of widgetcompositionevent only when its message is ecompositionchange. lifetime of composition string when native ime notifies gecko of starting a...
...And 5 more matches
Mozilla MathML Status
the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. ...
...the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. ...
...the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. ...
...And 5 more matches
JSS FAQ
Mozilla › Projects › NSS › JSS › JSS FAQ
how can i debug my ssl connection? can you explain jss ssl certificate approval callbacks? can i have multiple jss instances reading separate db's? ...
... how can i debug my ssl connection? can you explain jss ssl certificate approval callbacks? can i have multiple jss instances reading separate db's? ...
... sign data in java with jss? how do i convert org.mozilla.jss.crypto.x509certificate to org.mozilla.jss.pkix.cert.certificate? how do i convert org.mozilla.jss.pkix.cert to org.mozilla.jss.crypto.x509certificate? is it possible to use jss to access cipher functionality from pkcs11 modules? can you explain token names and keys with regards to jss? ...
...And 5 more matches
SpiderMonkey 24
below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...th this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...n the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — dec 16, 2013 the download url still available, but spidermonkey not release alone! get it here mozilla-esr24 if the download url is outdate you will find it in "firefox extended support release 24" package on hg release platform support spidermonkey 24 is supported on all the platforms where firefox 24 runs. ...
...And 5 more matches
WebReplayRoadmap
requires scanning the recording and the console will not update immediately. these messages will show up on the timeline and can be seeked to in the same way as other console messages. dom/css integration (partially implemented) when paused, the inspector panel can be used to inspect the dom and css state of the page. ...
...anning the recording and the console will not update immediately. these messages will show up on the timeline and can be seeked to in the same way as other console messages. dom/css integration (partially implemented) when paused, the inspector panel can be used to inspect the dom and css state of the page. ...
...o inspect the dom and css state of the page. new features are possible with time travel, though, which would be nice to support: supporting the debugger's event breakpoints would allow searching the recording for places where particular dom events occur, and -- in the same manner as logpoints -- logging them to the console and allowing them to be seeked to later. similarly, when the debugger supports dom mutation breakpoints (bug 1547692), the recording can be searched for dom mutations, and mutations can be logged to the console and seeked to later. allowing css to be changed while paused somewhere in the recording and update graphics with the effects of those changes. object watching (not yet implemented) it would be nice to log the changes to a specific object or one of its proper...
...And 5 more matches
Gecko object attributes
object attributes are relevant for the entire subtree of the object they are on, unless they are overridden by a descendent with the same object attribute. this is in contrast to text attributes, which apply only to substrings in a text object. object attributes list aria attributes all aria attributes used on dom element (i.e., any attribute prefixed by 'aria-') are exposed as object attributes; name is preserved except the 'aria-' prefix is cut. common attributes class the class name for an element from html, xul, svg, etc. this is useful for retrieving microformat semantics for an element. display similar with display css style. ...
... and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not. please see the aria states and properties module for more information. exposed in aria: aria-relevant container-atomic is this change inside a region that should always be presented at once. if yes, member-of relation will point to the root of the region. ...
...the live region support for more information. container-busy the current changes are not yet complete. a state change event for the a11y api's busy state will be fired on the container object currently marked as busy, once it is no longer busy. this is especially important in atomic regions. the entire atomic region should be presented once when it is finally no longer busy. see the live region support for more information. container-live interruption policy. see the live region support for more information. container-live-role indicates the role for the live region that contains the current accessible object. container-relevant what types of mutations are possibly relevant? see the live region support for more information. event-from-input was the root cause of this event explicit ...
...And 5 more matches
Generic factory
plementation of nsifactory is needed. here is the interface, and a description of its use. /** * provides a generic nsifactory implementation that can be used by * dlls with very simple factory needs. */ class nsigenericfactory : public nsifactory { public: static const nsiid& iid() { static nsiid iid = ns_igenericfactory_iid; return iid; } typedef ns_callback(constructorprocptr) (nsisupports *aouter, refnsiid aiid, void **aresult); /** * establishes the generic factory's constructor function, which will be called * by createinstance. */ ns_imethod setconstructor(constructorprocptr constructor) = 0; }; using nsigenericfactory is simple. create a new instance from the repository with a cid of ns_genericfactory_cid, and and iid of ns_igenericfactory_iid. d...
...genericfactory is simple. create a new instance from the repository with a cid of ns_genericfactory_cid, and and iid of ns_igenericfactory_iid. define a constructor function that matches the constructorprocptr prototype, and call nsigenericfactory::setconstructor with a pointer to that function. you're done. you now have a fully functional factory object. ...
... matches the constructorprocptr prototype, and call nsigenericfactory::setconstructor with a pointer to that function. you're done. you now have a fully functional factory object. ...
...And 5 more matches
nsICollection
xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. ...
... xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. ...
...on.idlscriptable this interface represents a list of nsisupports items. it provides basic operations on those items like: getting, setting, appending, removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. ...
...And 5 more matches
nsIDOMMozNetworkStatsManager
note: gecko is a fast evolving project. please check dom/network/interfaces/nsidomnetworkstatsmanager.idl to make sure this data is accurate. dom/network/interfaces/nsidomnetworkstatsmanager.idlscriptable interface that provides access to network usage statistics. inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) implemented by: @mozilla.org/networkstatsmanager;1. to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstatsmanager;1"] .createinstance(components.interfaces.nsidomnetworkstatsmanager); furthermore, the networkstatsmanager is published through a moznetworkstats child object within the navigator object. if the object exists, you can use the ne...
...nager); furthermore, the networkstatsmanager is published through a moznetworkstats child object within the navigator object. if the object exists, you can use the network statistics service. ...
...rkstats child object within the navigator object. if the object exists, you can use the network statistics service. ...
...And 5 more matches
nsISHEntry
nsdocshelleditordataptr forgeteditordata(); violates the xpcom interface guidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native...
... nsdocshelleditordataptr forgeteditordata(); violates the xpcom interface guidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only! boolean hasdetachededitor(); violat...
... contenttype acstring indicates the content-type of the document that this is a session history entry for. contentviewer nsicontentviewer content viewer, for fast restoration of presentation. docidentifier unsigned long long an integer that should be the same for two entries attached to the same docshell if and only if the two entries are entrie...
...And 5 more matches
Reference Manual
t at runtime in the bad assignment. // given two un-related interfaces |nsifoo| and |nsibar|... nsibar* bar = ...; // ... nscomptr<nsifoo> foo = bar; // ns_assertion: "queryinterface needed" // ...even assuming you can get the line to compile // (either by casting, or because the types are related by c ) this invariant is relaxed for nscomptr<nsisupports>. like nsisupports* (or even void*), people generally use nscomptr<nsisupports> to mean "any xpcom interface." it would be annoying if nscomptr forced you to queryinterface to the xpcom-correct nsisupports within an object in places where you don't care to know the exact type. null-dereference safeguards an nscomptr will also assert at runtime if you try to dereference it when it is void, e.
... to help prevent this, we are trying to make the first form, above, illegal by making operator& private. see bug 59414. implementation details and debugging machinery although it is a class, nscomptr has no virtual methods, and therefore, no vtable or vptr. because a few key routines are factored out into a common non-template base class, the actual underlying pointer is stored as an nsisupports* (except in debug builds where nscap_feature_debug_ptr_types is turned on). it is because of these factored routines that nscomptr users must link with the xpcom library. when nscap_feature_debug_ptr_types is turned on, instead of holding its underlying pointer in a variable of type nsisupports*, the nscomptr holds it in a pointer matching the underlying type. this allows source level debugg...
... annotated with the do_queryinterface directive a do_queryreferent directive the first three of these are simple and obvious. the fourth (applying the dont_queryinterface directive) is a synonym for just assigning in a raw xpcom interface pointer of the same type. the remaining directives provide some additional control in special situations. additionally, you can construct an nscomptr without supplying an initial value, in which case it is initialized to 0. just like a primitive pointer, an nscomptr with the value 0 points to no object, and can be tested with expressions like if (foo) and if (!foo). the directives mentioned above may make more sense in this table table 1. options for assigning into an nscomptr. don't qi qi addref ...
...And 5 more matches
Mozilla
se it's a special crasher or a hang. this article describes how to get a stacktrace in those cases with windbg on windows. (to get a stacktrace for thunderbird or some other product, substitute the product name where ever you see firefox in this instructions.) how to implement a custom autocomplete search component the xul textbox element supports an autocomplete mechanism that is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. there are actually two autocomplete mechanisms: how to investigate disconnect failures this article will guide you on how to investigate disconnect failures. an example of such a fai...
.... these are memory allocation routines that never return null; that is, they always successfully return the requested block of memory. this is in contrast to a traditional, fallible memory allocator that can return null indicating that the request failed. ...
...ble memory allocator that can return null indicating that the request failed. integrated authentication this entails support for the the simple and protected gss-api negotiation mechanism (spnego) internet standard (rfc 2478) to negotiate either kerberos, ntlm, or other authentication protocols supported by the operating system. internationalized domain names (idn) support in mozilla browsers netscape 7.1 is the first commercial browser that has built-in support for internationalized domain name under the new ietf rfc's established in 2003. introduction to layout in mozilla ipc protocol definition language (ipdl) ...
...And 5 more matches
Plug-in Development Overview - Plugins
irectory for your operating system. see installing plug-ins. test your plug-in and debug as necessary. create an html page and embed the plug-in object. for information about the html elements to use, see using html to display plug-ins. to see your plug-in in action, simply display the html page that calls it in the browser. registering plug-ins gecko identifies a plug-in by the mime type it supports. when it needs to display data of a particular mime type, the browser finds and invokes the plug-in object that supports that type. the data can come from either an object element in an html file (where the object or embed element either specifies the mime type directly or references a file of that type), from a separate non-html file of that mime type, or from the server. the server looks ...
...r looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser. the browser looks up the media type, and if it finds a plug-in registered to that type, loads the plug-in software. when it starts up, the browser checks for plug-in modules for the platform and registers them. it determines which plug-ins are installed and which types they support through a combination of user preferences that are private to the browser, the contents of the plug-ins directory, or the registry on windows. a mime type is made up of a major type (such as application or image) and a minor type, for example, image/jpeg. if you define a new mime type for a plug-in, you must register it with ietf (internet engineering task force). until your new mime type is...
...escription, which will appear in the navigator.plugins dom object which is used to populate about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-ins are found according to the section how gecko finds plug-ins. plug-ins are identified by file type nspl. ...
...And 5 more matches
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
le on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... pull request. ...
...And 5 more matches
BasicCardRequest - Web APIs
the basiccardrequest dictionary is a javascript object-structure that can be used in the payment request api. the properties of basiccardrequest are defined in the basic card payment spec). properties basiccardrequest.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g. "amex", "mastercard"); see card network identifiers for a complete list. if the property is missing, it implies that all networks are supported. ...
... an optional array of domstrings representing the card networks that the retailer supports (e.g. "amex", "mastercard"); see card network identifiers for a complete list. if the property is missing, it implies that all networks are supported. obsolete properties these properties have been removed from the payment method: basic card specification and should no longer be used. basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). if the property is missing, it implies that all the card types are supported. ...
...tion and should no longer be used. basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). if the property is missing, it implies that all the card types are supported. instead of using this property, it is up to the server to check support for the card given the information coded into the account number. card network identifiers the w3c maintains an official list of approved card network identifier strings, which may be used in the supportednetworks list. those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used t...
...And 5 more matches
DelayNode() - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...nd send us a pull request. ...
...And 5 more matches
Document.evaluate() - Web APIs
Web › API › Document › evaluate
ml) which would be more wasteful.) see introduction to using xpath in javascript for more information. notes xpath expressions can be evaluated on html and xml documents. while using document.evaluate() works in ff2, in ff3 one must use somexmldoc.evaluate() if evaluating against something other than the current document. result types (merge with template:xpathresultconstants? these are supported values for the resulttype parameter of the evaluate method: result type value description any_type 0 whatever type naturally results from the given expression. number_type 1 a result set containing a single number. useful, for example, in an xpath expression using the count() function. string_type 2 a result set containing a singl...
...lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
DynamicsCompressorNode() - Web APIs
e on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... pull request. ...
...And 5 more matches
Element.scroll() - Web APIs
Web › API › Element › scroll
bility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Element.scrollTo() - Web APIs
Web › API › Element › scrollTo
lity the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
FileSystemEntry.copyTo() - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ntribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ser-compat-data and send us a pull request. ...
...And 5 more matches
FileSystemEntry.getMetadata() - Web APIs
page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ompat-data and send us a pull request. ...
...And 5 more matches
FileSystemEntry.moveTo() - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ntribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ser-compat-data and send us a pull request. ...
...And 5 more matches
FileSystemEntry.remove() - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ntribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ser-compat-data and send us a pull request. ...
...And 5 more matches
GainNode() - Web APIs
Web › API › GainNode › GainNode
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... and send us a pull request. ...
...And 5 more matches
HTMLImageElement.align - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.border - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.height - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.hspace - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.isMap - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.longDesc - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.name - Web APIs
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTMLImageElement.sizes - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsizes experimentalchrome full support 45edge full support 13firefox full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true). to change preferences in firefox,...
...x full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true). ...
...And 5 more matches
HTMLImageElement.srcset - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsrcset experimentalchrome full support 34edge full support 12firefox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). to change preferences in firefox, ...
...ox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true). ...
...And 5 more matches
HTMLSlotElement.name - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetname experimentalchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences i...
... full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config. no support ? — 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.ie no support noopera full support ...
...And 5 more matches
Drag Operations - Web APIs
property returns a list of mime-type like domstrings, such as text/plain or image/jpeg. you can also create your own types. the most commonly used types are listed in the article recommended drag types. a drag may include data items of several different types. this allows data to be provided in more specific types, often custom types, yet still provide fallback data for drop targets that do not support more specific types. it is usually the case that the least specific type will be normal text data using the type text/plain. this data will be a simple textual representation. to set a drag data item within the datatransfer, use the setdata() method. it takes two arguments: the type of data and the data value. for example: event.datatransfer.setdata("text/plain", "text to drag"); in this ...
...hould call it with formats in order from most specific to least specific. const dt = event.datatransfer; dt.setdata("application/x.bookmark", bookmarkstring); dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); here, data is added in three different types. the first type, application/x.bookmark, is a custom type. other applications won't support this type, but you can use a custom type for drags between areas of the same site or application. by providing data in other types as well, we can also support drags to other applications in less specific forms. the application/x.bookmark type can provide data with more details for use within the application whereas the other types can include just a single url or text version. note that bo...
...s used vary by platform, typically the shift and control keys would be used to switch between copying, moving, and linking. the mouse pointer will change to indicate which operation is desired. for instance, for a copy, the cursor might appear with a plus sign next to it. you can modify the dropeffect property during the dragenter or dragover events, if for example, a particular drop target only supports certain operations. you can modify the dropeffect property to override the user effect, and enforce a specific drop operation to occur. note that this effect must be one listed within the effectallowed property. otherwise, it will be set to an alternate value that is allowed. event.datatransfer.dropeffect = "copy"; in this example, copy is the effect that is performed. you can use the va...
...And 5 more matches
IIRFilterNode() - Web APIs
lity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...end us a pull request. ...
...And 5 more matches
MediaDeviceInfo.deviceId - Web APIs
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...meedgefirefoxinternet 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 adapter.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 adapter.js polyfill.safari no ...
...And 5 more matches
MediaDeviceInfo.kind - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...chromeedgefirefoxinternet 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 adapter.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 adapter.js polyfill.safari no ...
...And 5 more matches
MediaKeyMessageEvent() - Web APIs
age is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...idsafari on iossamsung internetmediakeymessageevent() constructor experimentalchrome full support 42edge full support ≤18firefox ? ie ? opera ? safari ? webview android no support nochrome android full support 42firefox android ? opera android ? safari ios ? ...
...And 5 more matches
MediaKeyStatusMap.get() - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
MediaKeyStatusMap.has() - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
MediaKeyStatusMap.size - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
MediaRecorder.ignoreMutedMedia - Web APIs
le in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d send us a pull request. ...
...And 5 more matches
MediaSession.playbackState - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
MediaStream.id - Web APIs
Web › API › MediaStream › id
compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ge is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
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 adaptive streaming, and access to display property information. examples detect audio file support and expected performance this example defines a audio configuration then checks to see if the user agent supports decoding that media configuration, and whether it will perform well in terms of smoothness and power efficiency. if ('mediacapabilities' in navigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, ...
...oothness and power efficiency. ...
...y. ...
...And 5 more matches
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ibute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... request. ...
...And 5 more matches
PaymentRequest.PaymentRequest() - Web APIs
will be used to handle the process of generating, validating, and submitting a payment request. syntax var paymentrequest = new paymentrequest(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site accepts and any associated payment method specific data. each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website accepts. starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods. for example, the basic card payment method is selected by specifying t...
...for basic credit card services, this structure should match the basiccardrequest dictionary. ...
... it is a single domstring, and the meaning of the data parameter changes with the supportedmethods. for example, the basic card payment method is selected by specifying the string basic-card here. data a json-serializable object that provides optional information that might be needed by the supported payment methods. this has to conform to the type expected by the payment handler indicated by supportedmethods. for basic credit card services, this structure should match the basiccardrequest dictionary. details provides information about the requested transaction. this parameter contains the following fields: total the total amount of the payment request. id optional a free-form identifier for this payment request. if a value is not supplied, the browser will construct one. ...
...And 5 more matches
PerformanceLongTaskTiming.attribution - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Pointer events - Web APIs
pointer events address that need. pointer events are dom events that are fired for a pointing device. they are designed to create a single dom event model to handle pointing input devices such as a mouse, pen/stylus or touch (such as one or more fingers). the pointer is a hardware-agnostic device that can target a specific set of screen coordinates. ...
...bal event handler. event on event handler description pointerover onpointerover fired when a pointer is moved into an element's hit test boundaries. pointerenter onpointerenter fired when a pointer is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown). pointerdown onpointerdown fired when a pointer becomes active buttons state. pointermove onpointermove fired when a pointer changes coordinates. this event is also used if the change in pointer state can not be reported by other events. pointerup onpointerup fired when a pointer is no longer active buttons state. p...
...ve buttons state. pointercancel onpointercancel a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived). pointerout onpointerout fired for several reasons including: pointer is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. pointerleave onpointerleave fired when a pointer is moved out of the hit test boundaries of an element. for pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. gotpointerc...
...And 5 more matches
PushMessageData.arrayBuffer() - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
PushMessageData.blob() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
PushMessageData.json() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
PushMessageData.text() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
PushSubscription.options - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Selection.toString() - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Slottable: assignedSlot - Web APIs
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetassignedslot experimentalchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences i...
... full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config. no support ? — 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.ie no support noopera full support ...
...And 5 more matches
TaskAttributionTiming.containerId - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
TaskAttributionTiming.containerType - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Using Touch Events - Web APIs
today, most web content is designed for keyboard and mouse input. however, devices with touch screens (especially portable devices) are mainstream and web applications can either directly process touch-based input by using touch events or the application can use interpreted mouse events for the application input. a disadvantage to using mouse events is that they do not support concurrent user input, whereas touch events support multiple simultaneous inputs (possibly at different locations on the touch surface), thus enhancing user experiences. the touch events interfaces support application specific single and multi-touch interactions such as a two-finger gesture. a multi-touch interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently tou...
...e current event. for the touchmove event, it is a list of the touch points that have changed since the last event. for the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface). together, these interfaces define a relatively low-level set of features, yet they support many kinds of touch-based interaction, including the familiar multi-touch gestures such as multi-finger swipe, rotation, pinch and zoom. from interfaces to gestures an application may consider different factors when defining the semantics of a gesture. for instance, the distance a touch point traveled from its starting location to its location when the touch ended. another potential factor ...
...or example, the time elapsed between the touch's start and the touch's end, or the time lapse between two consecutive taps intended to create a double-tap gesture. the directionality of a swipe (for example left to right, right to left, etc.) is another factor to consider. the touch list(s) an application uses depends on the semantics of the application's gestures. ...
...And 5 more matches
WaveShaperNode.WaveShaperNode() - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...end us a pull request. ...
...And 5 more matches
Using DTMF with WebRTC - Web APIs
in order to more fully support audio/video conferencing, webrtc supports sending dtmf to the remote peer on an rtcpeerconnection. this article offers a brief high-level overview of how dtmf works over webrtc, then provides a guide for everyday developers about how to send dtmf over an rtcpeerconnection. the dtmf system is often referred to as "touch tone," after an old trade name for the system. webrtc doesn't send dtmf codes as audio data. instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. ...
...on. the dtmf system is often referred to as "touch tone," after an old trade name for the system. webrtc doesn't send dtmf codes as audio data. instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. ...
...fsender the rtcdtmfsender object for the connection. this will be obtained while setting up the connection, in the gotstream() function shown in adding the audio to the connection. hasaddtrack because some browsers have not yet implemented rtcpeerconnection.addtrack(), therefore requiring the use of the obsolete addstream() method, we use this boolean to determine whether or not the user agent supports addtrack(); if it doesn't, we'll fall back to addstream(). this gets figured out in connectanddial(), as shown in starting the connection process. mediaconstraints an object conforming to the mediaconstraints dictionary specifying the constraints to use when starting the connection. we want an audio-only connection, so video is false, while audio is true. offeroptions an rtcofferoptions ...
...And 5 more matches
window.cancelIdleCallback() - Web APIs
table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcancelidlecallback experimentalchrome full support 47edge full support 79firefox full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true). to change preferences in firefox, visit ab...
... 79firefox full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true). ...
...And 5 more matches
Window.openDialog() - Web APIs
Web › API › Window › openDialog
bject and added to the newly created window as a property named window.arguments. they may be referenced in the javascript of the window at any time, including during the execution of a load handler. these parameters may be used, then, to pass arguments to and from the dialog window. the call to opendialog() returns immediately. if you want the call to block until the user has closed the dialog, supply modal as a windowfeatures parameter. note that this also means the user won't be able to interact with the opener window until he closes the modal dialog. syntax newwindow = opendialog(url, name, features, arg1, arg2, ...) newwindow the opened window url the url to be loaded in the newly opened window. name the window name (optional). see window.open() description for detailed infor...
...ng, or contains only one or more of the behavior features (chrome, dependent, dialog and modal) the chrome features are assumed "os' choice." that is, window creation code is not given specific instructions, but is instead allowed to select the chrome that best fits a dialog on that operating system. passing extra parameters to the dialog to pass extra parameters into the dialog, you can simply supply them after the windowfeatures parameter: opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); the extra parameters will then get packed into a property named arguments of type array, and this property gets added to the newly opened dialog window. to access these extra parameters from within dialog code, use the following scheme: var food = window.arguments[0]; var price = ...
...og code. (another example). returning values from the dialog since window.close() erases all properties associated with the dialog window (i.e. the variables specified in the javascript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs). to be able to pass values back to the caller, you have to supply some object via the extra parameters. you can then access this object from within the dialog code and set properties on it, containing the values you want to return or preserve past the window.close() operation. var retvals = { address: null, delivery: null }; opendialog("http://example.tld/zzz.xul", "dlg", "modal", "pizza", 6.98, retvals); if you set the properties of the retvals objec...
...And 5 more matches
Window.scroll() - Web APIs
Web › API › Window › scroll
bility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTML in XMLHttpRequest - Web APIs
this limitation avoids wasting time parsing html uselessly when legacy code uses xmlhttprequest in the default mode to retrieve responsetext for text/html resources. ...
...this limitation avoids wasting time parsing html uselessly when legacy code uses xmlhttprequest in the default mode to retrieve responsetext for text/html resources. ...
...this limitation avoids wasting time parsing html uselessly when legacy code uses xmlhttprequest in the default mode to retrieve responsetext for text/html resources. ...
...And 5 more matches
ARIA Test Cases - Accessibility
introduction the information on this page is out of date: it was last updated november 2010. however, the information might still be useful for some readers. for more up-to-date examples, see the openajaxalliance aria examples page. or copy-paste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determine where to file a bug (browser or at). there are several purposes for providing this information: help browser vendors provide correct implementations help at vendors provide correct implementations inform authors as to what actuall...
...2. reference to link example note regarding dojo/dijit test files the main purpose of dojo's dijit test files are for dojo developers to exercise and debug the code. as such, they are used to test a variety of features, such as styling, behavior, mouse, ...
...et source simply comes from another url, and is tied in using an iframe) yui "carousel" listbox -- a more advanced test case expected at behavior: (mz) screen reader should announce the label and role of the listbox when it gains focus. if an item is focused within the list, this should be announced next, followed by an indication of this item's position within the list if the screen reader supports this in other lists as well. as focus moves within the list, the screen reader should announce the relevant list items. (al) what about multiple selection? what should happen as the user selects or unselects the current item, does a select all, uses shift+arrow to select, etc.? markup used: role="listbox", "option" (listitem should only be used with list, which is for static document s...
...And 5 more matches
:host-context() - CSS: Cascading Style Sheets
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
border-right-style - CSS: Cascading Style Sheets
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-right-stylechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. this has been fixed in...
...dge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
...efox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
...And 5 more matches
clear - CSS: Cascading Style Sheets
Web › CSS › clear
ibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
can i start to use the two-value syntax? as dem...
... spec to evolve. can i start to use the two-value syntax? as demonstrated above, there is not a lot of advantage in using the two-value version right now; if you did your page would only work in firefox! other browsers do not yet implement the two-value versions. therefore display: block flex will only get you flex layout in firefox, and will be ignored as invalid in chrome. you can see current support in the compat data for the two-value syntax: the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung...
... table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
initial - CSS: Cascading Style Sheets
Web › CSS › initial
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
letter-spacing - CSS: Cascading Style Sheets
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
mix-blend-mode - CSS: Cascading Style Sheets
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
page-break-after - CSS: Cascading Style Sheets
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
page-break-before - CSS: Cascading Style Sheets
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
Index - Developer guides
Web › Guide › Index
community ajax if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the ajax basics and gives you some simple hands-on examples to get you started. 5 wai aria live regions/api support ajax, accessibility firefox 3 contains important improvements to the way the mozilla engine exposes live changes in a document. 6 audio and video delivery audio, guide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains ...
...irefox 3 contains important improvements to the way the mozilla engine exposes live changes in a document. 6 audio and video delivery audio, guide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a c...
... your until-now-webkit-only sites work with firefox, which uses the unprefixed version of the spec. 16 audio and video manipulation audio, canvas, examples, guide, html5, media, video, web audio api, webgl, developer recommendation the ability to read the pixel values from each frame of a video can be very useful. 17 event developer guide dom, event, guide, needsupdate, events events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types. 18 creating and triggering events advanced, dom, guide, javascript, needscontent, events this article demonstrates how to creat...
...And 5 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
. in a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading. note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be...
...he user agent is trying to fetch media data, but data is unexpectedly not forthcoming. suspend media data loading has been suspended. timeupdate the time indicated by the currenttime attribute has been updated. volumechange the volume has changed. waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same file types and audio codecs; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands: <audio controls> <source src="myaudio.mp3" type="audio/mpeg"> <source src="myaudio.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio. here is a <a href="myaudio.mp4">link to the audio</a> instead.</p> <...
... other usage notes: if you don't specify the controls attribute, the audio player won't include the browser's default controls. you can, however, create your own custom controls using javascript and the htmlmediaelement api. ...
...And 5 more matches
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
number input type. because this kind of widget is imprecise, it shouldn't typically be used unless the control's exact value isn't important. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ctive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the user's browser doesn't support type range, it will fall back and treat it as a text input. value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number. ...
...st of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. see the range control with hash marks below for an example of how the options on a range are denoted in supported browsers max the greatest value in the range of permitted values. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a number, then the element has no maximum value. this value must be greater than or equal to the value of the min attribute. see the html max attribute. min the lowest value in the range of...
...And 5 more matches
<listing> - HTML: Hypertext Markup Language
Web › HTML › Element › listing
e compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 5 more matches
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
short inline quotation. most modern browsers implement this by surrounding the text in quotation marks. <rb> the html ruby base (<rb>) element is used to delimit the base text component of a <ruby> annotation, i.e. the text that is being annotated. <rp> the html ruby fallback parenthesis (<rp>) element is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby> element. <rt> the html ruby text (<rt>) element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for east asian typography. the <rt> element must always be contained within a <ruby> element. <rtc> the html ruby text container (<rtc...
... share attribute values, such as lang. <strong> the html strong importance element (<strong>) indicates that its contents have strong importance, seriousness, or urgency. browsers typically render the contents in bold type. <sub> the html subscript element (<sub>) specifies inline text which should be displayed as subscript for solely typographical reasons. <sup> the html superscript element (<sup>) specifies inline text which is to be displayed as superscript for solely typographical reasons. <time> the html <time> element represents a specific period in time. <u> the html unarticulated annotation element (<u>) represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annot...
...ar> the html variable element (<var>) represents the name of a variable in a mathematical expression or a programming context. <wbr> the html <wbr> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location. image and multimedia html supports various multimedia resources such as images, audio, and video. element description <area> the html <area> element defines a hot-spot region on an image, and optionally associates it with a hypertext link. this element is used only within a <map> element. <audio> the html <audio> element is used to embed sound content in documents. it may contain ...
...And 5 more matches
Microformats - HTML: Hypertext Markup Language
summary microformats (sometimes abbreviated μf) are standards used to embed semantics & structured data in html, and provide an api to be used by search engines, aggregators, and other tools. these minimal patterns of html are used for marking up entities that range from fundamental to domain-specific information, such as people, organizations, events, and locations. microformats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous appro...
...ties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which require learning new attributes. microformats are supported by all major search engines. search engines benefit greatly from direct access to this structured data because it allows them to understand the information on web pages and provide more relevant results to users. in addition to being machine-readable, their format is designed to be easily read by humans. to create a microformats object, h-* class names are used in the class attribute. t...
...epresents episodic or datestamped content on the web. h-entry is often used with content intended to be syndicated, e.g. blog posts. example h-entry as a blog post: <article class="h-entry"> <h1 class="p-name">microformats are amazing</h1> <p>published by <a class="p-author h-card" href="http://example.com">w. ...
...And 5 more matches
MIME types (IANA media types) - HTTP
it's the only mime type guaranteed to work now and into the future. some content you find may have a charset parameter at the end of the text/javascript media type, to specify the character set used to represent the code's content. this is not valid, and in most cases will result in a script not being loaded. image types files whos...
..., opera, safari tiff tagged image file format image/tiff .tif, .tiff none built-in; add-ons required webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later. audio and video types as is the case for images, html doesn't mandate that web browsers support any specific file and codec types for the <audio> and <video> elements, so it's important to consider your target audience and the range of browsers (and versions of those browsers) they may be using when choosing the file type an...
... images, html doesn't mandate that web browsers support any specific file and codec types for the <audio> and <video> elements, so it's important to consider your target audience and the range of browsers (and versions of those browsers) they may be using when choosing the file type and codecs to use for media. our media container formats guide provides a list of the file types that are commonly supported by web browsers, including information about what their special use cases may be, any drawbacks they have, and compatibility information, along with other details. ...
...And 5 more matches
Inheritance and the prototype chain - JavaScript
s example: function graph() { this.vertices = [4,4]; } var g = new graph(); console.log(g.vertices); // print [4,4] g.vertices = 25; console.log(g.vertices); // print 25 delete g.vertices; console.log(g.vertices); // print undefined with the class keyword ecmascript 2015 introduced a new set of keywords implementing classes. ...
...s; console.log(g.vertices); // print undefined with the class keyword ecmascript 2015 introduced a new set of keywords implementing classes. the new keywords include class, constructor, static, extends, and super. ...
...esults to the console), except in different ways for the purpose of illustration. name example(s) pro(s) con(s) new-initialization function foo(){} foo.prototype = { foo_prop: "foo val" }; function bar(){} var proto = new foo; proto.bar_prop = "bar val"; bar.prototype = proto; var inst = new bar; console.log(inst.foo_prop); console.log(inst.bar_prop); supported in every browser imaginable (support goes all the way back to ie 5.5!). also, it is very fast, very standard, and very jist-optimizable. in order to use this method, the function in question must be initialized. during this initialization, the constructor may store unique information that must be generated per-object. however, this unique information would only be generated once, potenti...
...And 5 more matches
WebAssembly.Memory() constructor - JavaScript
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../browser-compat-data and send us a pull request. ...
...And 5 more matches
Tools for SVG - SVG: Scalable Vector Graphics
inkscape url: www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. ...
... inkscape url: www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. ...
... inkscape url: www.inkscape.org one of the most important tools for a graphics format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file format. ...
...And 5 more matches
ui/toolbar - Archive of obsolete content
interface real estate. like a panel, a toolbar's content is specified using html. ...
... content is specified using html. unlike a panel, a toolbar: does not overlap with any web content is persistent, remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other ui components and supply them to the toolbar constructor. ...
...indows, so operations like show and hide work across all browser windows. if you need to customize content for a particular browser window, you can do that by messaging the window-specific frame hosted by that toolbar. globals constructors toolbar(options) creates a toolbar. the only mandatory option is title, but for the toolbar to contain any actual content, the items parameter must also be supplied, and must contain at least object. this add-on creates a toolbar containing one button and a frame: var { actionbutton } = require('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({ url: "./my-frame.html" }...
...And 4 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
add-on versioning add-ons should specify their versions using the toolkit version format. as a rough overview this is a version string split by periods, some examples: 2.0 1.0b1 3.0pre1 5.0.1.2 note: before firefox 1.5 the more basic firefox version format was used: major.minor.release.build[+] where only digits were allowed. the toolkit version format supports the firefox version format but allows greater flexibility. how applications determine compatibility when installing add-ons applications look at the targetapplication entries in the add-on's install.rdf. an entry must exist with an id matching the id of the application. additionally the minversion and maxversion of this entry must be a range that includes the version of the running application. if the application ha...
... a maxversion that is larger than the currently available version of the application since you do not know what api and ui changes are just around the corner. with compatibility updating it is not necessary to release a whole new version of the extension just to increase its maxversion. for the maxversion it is generally permissible to use a * in place of the minor version of the application you support, for example 2.0.0.* would mean that you support any minor update to version 2 of the application. the application will usually suggest to extension authors which version part it is sensible to do this with. do not mistakenly think that * in a version represents any version. the * actually represents an infinitely high number and so is really only sensibly used in the maxversion. using it in...
... automatic add-on update checking applications will periodically check for updates to installed add-ons by retrieving the updateurl. the information returned can be used to notify the user of an updated version to the add-on as well as inform the application of new application versions that the add-on is compatible with. note: starting in gecko 2.0, the automatic add-on update process properly supports cases in which the add-on's guid changes by uninstalling the old version and then installing the new one. previously, it was possible to wind up with two copies of the same add-on installed. compatibility updates during the automatic update checks, applications look for both new versions and updated compatibility information about the currently installed version of an add-on. this means t...
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
scheme, or whatever term you prefer) really should be avoided at this point. the resource:// protocol actually bleeds into content which allows webpages to detect installed add-ons using the protocol, which is not particularly fantastic (just the static file contents, not any loaded script/data). step 2a: load your jsm from chrome:// now with that preface out of the way, this part is easy: drop support for firefox 3.x if you haven't already, move your jsm files to wherever you've got your chrome mapping to for your xul overlay and/or windows, import your files from that new chrome mapped path instead of the old resource one, and remove your "resource" line from your chrome.manifest file. it's probably a good idea to do this even if you aren't going fully restartless / extractionless due to ...
...u've got your chrome mapping to for your xul overlay and/or windows, import your files from that new chrome mapped path instead of the old resource one, and remove your "resource" line from your chrome.manifest file. it's probably a good idea to do this even if you aren't going fully restartless / extractionless due to the previously mentioned exposure to content of resource mappings. also, drop support for firefox 4 through 9 while you're at it. prior to firefox 10, the chrome.manifest file you rely on wasn't loaded automatically for restartless add-ons. hacks were required, and probably a bad idea. step 2b: audit any remaining resource:// uri usage internal to your extension if you don't need resource:// uris for anything else, then you may be able to skip the next step. if not, see if y...
...olpref(prefname,prefvalue); return; } } function setdefaultpref(prefname,prefvalue) { var defaultbranch = services.prefs.getdefaultbranch(null); setgenericpref(defaultbranch,prefname,prefvalue); } function getucharpref(prefname,branch) // unicode getcharpref { branch = branch ? ...
...And 4 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
this section describes how to use the javascript wrapper for drag and drop. the javascript drag and drop wrapper the javascript wrapper to drag and drop simplifies the process by handling all of the xpcom interfaces for you. it works by providing an object which implements the event handlers. all you have to do is write some simpler functions which work with the data being dragged. this drag and drop interface is stored in the global package, in the file chrome://global/content/nsdraganddrop.js. you can include this file in your xul file with the script tag in the same way you would include your own scripts. ...
... session) this function should be defined when something should happen on a drag exit. it has two arguments, the event object and the drag session. ondrop(event, dropdata, session) this function should be defined when you want something to happen when an object is dropped. the first argument is the event object and the second is the data being dragged. the third argument is the drag session. getsupportedflavours() this function should return a list of flavors that the object being dragged over can accept. this function takes no arguments. this function is necessary so that the wrapper can determine the best flavour to pass to the other functions. for an observer that is observing an element that can start a drag, you should define at least the ondragstart function. for elements that can h...
...object being dragged over can accept. this function takes no arguments. this function is necessary so that the wrapper can determine the best flavour to pass to the other functions. for an observer that is observing an element that can start a drag, you should define at least the ondragstart function. for elements that can have objects dropped on them, you should define ondragover, ondrop and getsupportedflavours (and, if desired, ondragexit). the type of data being dragged is stored as a set of flavors. often, a dragged object will be available in a number of flavors. that way, a drop target can accept the flavor it finds most suitable. for example, a file may come in two flavors, the file itself and the text name of the file. if the file is dragged and dropped onto a directory, the file fl...
...And 4 more matches
JavaScript crypto - Archive of obsolete content
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't wo...
...ue a user prompt to confirm the operation before the add or delete actually occurs. parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. cryptomechanismflags a bit vector indicating all cryptographic mechanisms should be turned on by default (see below). cipherflags a bit vector indicating all ssl or s/mime cipher functions supported by the module (see below). mechanism flag definitions in general, most tokens should not set any of the cipher flags. setting these flags means you want your token to supply the default implementation for these functions. normally mozilla uses its own internal module to supply these functions. these flags override that preference. if you choose to implement these flags, your module must ...
...ported by the module (see below). mechanism flag definitions in general, most tokens should not set any of the cipher flags. setting these flags means you want your token to supply the default implementation for these functions. normally mozilla uses its own internal module to supply these functions. these flags override that preference. ...
...And 4 more matches
Frequently Asked Questions - Archive of obsolete content
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> make sure all your svg files have these bindings. for more information see this link. why am i asked to choose a program to open svg files? when you try to load svg files from some websites you may get a dialogue asking you "what should firefox do with this file?". this is either because your browser doesn't support svg (you must have mozilla firefox 1.5 or newer), or because the webpage/server isn't correctly telling mozilla that the file contains svg. for example, webpages that embed svg using the <object> or <embed> tags must have a 'type' attribute assigned with the correct svg mime type of "image/svg+xml". if the mime type specified is wrong (for example image/svg-xml) mozilla won't recognise it. if...
...ur time, please first search in the svg component of our bug database to check that the issue hasn't already been reported. if you can't find a matching bug please file a new svg bug report, preferably attaching a (very small!) svg file that demonstrates the bug. if you have any problems with the bug database feel free to contact contact us. can i use a plugin for svg instead of mozilla's native support? individuals can choose to use a plugin to view svg in mozilla on their own computers, but there is no way for svg content authors to make mozilla use a plugin when people view the svg files on their website. the native svg support must be turned off before mozilla will look to see if there's an svg plugin installed. this is done by toggling a hidden user configuration preference (pref). to ...
...r website. the native svg support must be turned off before mozilla will look to see if there's an svg plugin installed. this is done by toggling a hidden user configuration preference (pref). to access the pref type about:config into the url bar, then type svg.enabled into the filter field. when you double click on the pref you will see its value change to and from true/false, turning the native support on/off. how does mozilla's svg implementation compare to adobe's? mozilla's native implementation is less complete than adobe svg viewer's in general. there are major features such as filters and smil based animation that have still to be implemented in mozilla. however, mozilla's implementation already supports some things that adobe's lacks, particularly parts of the xml and svg doms. for...
...And 4 more matches
Building accessible custom components in XUL - Archive of obsolete content
ld the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a treeview). by implementing dhtml accessibility techniques, web developers can declare that generic html elements are really acting as specific gui controls (such as a treeitem within a treeview). firefox 1.5 is the first browser to support dhtml accessibility; it maps the declarations within the html page to the underlying accessibility architecture so that assistive technologies can "read" a web page and know how to present these complex controls to the end user. this has all been well-documented for some time. however, it is less well-known that the same dhtml accessibility techniques can be applied to xul, mozilla's xml mark...
...s a much richer set of built-in controls than html. there is generally no need to build your own xul tab bar or treeview. firefox ships with a tabbox element and a tree element, and these elements are fully accessible out-of-the-box. however, if you are building custom controls in xul, you may need to use dhtml accessibility techniques to ensure that your custom controls are equally accessible. a super-simple spreadsheet download stage-1.zip install stage-1.xpi to build our xul spreadsheet, we'll use three built-in xul controls: a single grid element to contain the other elements and position them in rows and columns. description elements for each row and column header. label elements for each cell in the spreadsheet. the xul markup is straightforward. we define the grid, then define the ...
...html accessibility download stage-2.zip install stage-2.xpi using the new dhtml accessibility techniques in firefox 1.5, we can declare the role of each element in our spreadsheet. the grid element is really a spreadsheet. each label element is really a cell within the spreadsheet. each description element is really a row or column header within the spreadsheet. you can find a list of all the supported roles in firefox 1.5 on mozilla.org. role declarations are a little confusing at first glance, but they all follow the same pattern. the role attribute itself is in the xhtml 2 namespace. we will need to declare the namespace (xmlns:x2="http://www.w3.org/tr/xhtml2") so we can add an xhtml2:role attribute to each xul element. the role attribute value is also in a namespace. we will need to d...
...And 4 more matches
Trees - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Trees
anged into a hierarchy. a tree also allows the user to rearrange, resize and hide individual columns. some examples of trees include the list of messages in a mail application, or the bookmarks window in mozilla. in some ways, a tree has some similarities with the listbox. both can be used to create tables of data with multiple rows and columns, and both may contain column headers. the tree also supports nested rows, whereas the listbox does not. however, listboxes may contain any type of content, whereas trees may only contain text and images. (using advanced features, progress meters or checkboxes also can be added to the tree) a tree consists of two parts, the set of columns, and the tree body. the set of columns is defined by a number of treecol elements, one for each column. each co...
...second part, the tree body, contains the data to appear in the tree and is created with a treechildren tag. the tree is unique in that the body of the tree consists only of a single widget which draws all of the data in the tree. this contrasts with the listbox, where individual listitem and listcell tags are used to specify the rows in the listbox. in a tree, all of the data to be displayed is supplied by a separate object, called a tree view. when it comes time to display a cell, the tree widget will call out to this tree view to determine what to display, which in turn will be drawn by the tree. the tree is smart enough to only ask for information from the view for those rows that need to be displayed. this allows the view to be optimized such that it only needs to load the data for disp...
...ou do, you might store the data in an array or javascript data structure, or load the data from an xml file. since the entire body of the tree is a single widget, you can't change the style of individual rows or cells in the normal way. this is because there are no elements that display the individual cells, like there is with the listbox. instead, all drawing is done by the tree body using data supplied by the view. this is an important point and many xul developers have trouble understanding this aspect. to modify the appearance of a tree cell, the view must instead associate a set of keywords for a row and cell. a special css syntax is used which styles components of the tree body with those keywords. in a sense, it is somewhat like using css classes. tree styling will be discussed in det...
...And 4 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
... tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
... tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
...And 4 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
ation of html 4 as an xml 1.0 application. if you're writing xhtml (as opposed to regular html) you should understand the fundamental differences between html 4 and xhtml. xhtml is xml, not html one of the primary misunderstandings about xhtml is that it is just another version of html. this misunderstanding is compounded by the fact that, prior to version 9, microsoft® internet explorer only supports xhtml if it is served with mime media type text/html rather than the recommended application/xhtml+xml. when an xhtml page is served with mime type text/html it is treated by all browsers as if it were nothing more than html. however when an xhtml page is served with mime type text/xml or application/xhtml+xml, then it should be treated as an xml document which must conform to the strict ru...
...ow for backward compatibility. <script type="text/javascript"> //<![cdata[ var i = 0; while (++i < 10) { // ... } //]]> </script> examples using css rules in inline style within comments example 1 - xhtml 1.0 strict as text/html this example illustrates the behavior of xhtml served as text/html when css rules are contained inline and surrounded by comments. ...
...- xmlguru). note that netscape 7.x, mozilla and opera all agree that css rules contained inline inside of comments are to be ignored. ...
...And 4 more matches
XForms Select1 Element - Archive of obsolete content
introduction allows the user to choose a single value from a list of pre-defined values (see the spec). the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements. you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select1 element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - this attribute, when set to 'open', allows the user to provide free entry to the list. possible values ...
...ms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed (see #representations section to refer if the attribute is supported for every representation). incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select1 element can be bound to a node containing simple content. the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choice...
... widgets for the specified appearance attribute values: combobox - default representation (xhtml/xul) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). ...
...And 4 more matches
Audio for Web games - Game development
we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible. mobile audio caveats by far the most difficult platforms to provide web audio support for are mobile platforms. unfortunately these are also the platforms that people often use to play games. there are a couple of differences between desktop and mobile browsers that may have caused browser vendors to make choices that can make web audio difficult for game developers to work with. let's look at these now. autoplay browser autoplay policy now affects desktop and mobile browser...
...on required before playing can commence. concurrent audio playback a requirement of many games is the need to play more than one piece of audio at the same time; for example, there might be background music playing along with sound effects for various things happening in the game. ...
...e, there might be background music playing along with sound effects for various things happening in the game. although the situation is soon going to get better with the adoption of the web audio api, the current most widely-supported method — using the vanilla <audio> element — leads to patchy results on mobile devices. element — results in patchy results on mobile devices. testing and support here's a table that shows what mobile platforms support the features talked about above. ...
...And 4 more matches
WAI-ARIA basics - Learn web development
en">skip to navigation</a> but this is still not very precise, and can only be used when the screenreader is reading from the top of the page. as another example, apps started to feature complex controls like date pickers for choosing dates, sliders for choosing values, etc. html5 provides special input types to render such controls: <input type="date"> <input type="range"> these are not well-supported across browsers, and it is also difficult to style them, making them not very useful for integrating with website designs. as a result, developers quite often rely on javascript libraries that generate such controls as a series of nested <div>s or table elements with classnames, which are then styled using css and controlled using javascript. the problem here is that visually they work, bu...
...tributes can be useful for selecting elements by css. note: you can find a useful list of all the aria roles and their uses, with links to futher information, in the wai-aria spec — see definition of roles. the spec also contains a list of all the properties and states, with links to further information — see definitions of states and properties (all aria-* attributes). where is wai-aria supported? this is not an easy question to answer. it is difficult to find a conclusive resource that states what features of wai-aria are supported, and where, because: there are a lot of features in the wai-aria spec. there are many combinations of operating system, browser, and screenreader to consider. this last point is key — to use a screenreader in the first place, your operating syst...
...first place, your operating system needs to run browsers that have the necessary accessibility apis in place to expose the information screenreaders need to do their job. most popular oses have one or two browsers in place that screenreaders can work with. the paciello group has a fairly up-to-date post that provides data for this — see rough guide: browsers, operating systems and screen reader support updated. next, you need to worry about whether the browsers in question support aria features and expose them via their apis, but also whether screenreaders recognise that information and present it to their users in a useful way. browser support is generally quite good — at the time of writing, caniuse.com stated that global browser support for wai-aria was around 88%. screenreader su...
...And 4 more matches
HTML Cheatsheet - Learn web development
a line break line 1<br>line 2 line 1 line 2 suggesting a line break it is used to suggest the browser to cut the text on this site if </wbr>there is not enough space to display it on the same line it is u...
... a line break line 1<br>line 2 line 1 line 2 suggesting a line break it is used to suggest the browser to cut the text on this site if </wbr>there is not enough space to display it on the same line it is used to ...
... <p>this text is in normal format.</p> <code>this text is in code format.</code> <pre>this text is in predefined format.</pre> this text is in normal format. this text is in code format. this text is in predefined format. embedded audio <audio controls="controls" src="https://udn.realityripple.com/samples/b7/193cb038d0.mp3">your browser does not support the html5 audio element.</audio> your browser does not support the html5 audio element. embedded audio with alternative sources <audio controls="controls"><source src="https://udn.realityripple.com/samples/b7/193cb038d0.mp3" type="audio/mpeg"><source src="https://udn.realityripple.com/samples/f7/14a4179ee6.ogg" type="audio/ogg"> your browser does not support audio. </a...
...And 4 more matches
Images in HTML - Learn web development
g> and <video> are sometimes referred to as replaced elements. this is because the element's content and size are defined by an external resource (like an image or video file), not by the contents of the element itself. note: you can find the finished example from this section running on github (see the source code too.) alternative text the next attribute we'll look at is alt. its value is supposed to be a textual description of the image, for use in situations where the image cannot be seen/displayed or takes a long time to render because of a slow internet connection. for example, our above code could be modified like so: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"> the easiest way to test ...
...nd would display the alt text instead: so, why would you ever see or need alt text? it can come in handy for a number of reasons: the user is visually impaired, and is using a screen reader to read the web out to them. in fact, having alt text available to describe images is useful to most users. as described above, the spelling of the file or path name might be wrong. the browser doesn't support the image type. some people still use text-only browsers, such as lynx, which displays the alt text of images. you may want to provide text for search engines to utilize; for example, search engines can match alt text with search queries. users have turned off images to reduce data transfer volume and distractions. this is especially common on mobile phones, and in countries where bandwidth...
...st provide accessible link text. in such cases you may, either, write it inside the same <a> element, or inside the image's alt attribute – whichever works best in your case. text. you should not put your text into images. if your main heading needs a drop shadow, for example, use css for that rather than putting the text into an image. however, if you really can't avoid doing this, you should supply the text inside the alt attribute. essentially, the key is to deliver a usable experience, even when the images can't be seen. this ensures all users are not missing any of the content. try turning off images in your browser and see how things look. you'll soon realize how helpful alt text is if the image cannot be seen. note: for more information, see our guide to text alternatives. wid...
...And 4 more matches
Responsive images - Learn web development
technologies were implemented recently to solve the problems indicated above by letting you offer the browser several image files, either all showing the same thing but containing different numbers of pixels (resolution switching), or different images suitable for different space allocations (art direction). note: the new features discussed in this article — srcset/sizes/<picture> — are all supported in release versions of modern desktop and mobile browsers (including microsoft's edge browser, although not internet explorer.) how do you create responsive images? in this section, we'll look at the two problems illustrated above and show how to solve them using html's responsive image features. you should note that we will be focusing on the html <img>s for this section, as seen in th...
...se attributes in place, the browser will: look at its device width. work out which media condition in the sizes list is the first one to be true. look at the slot size given to that media query. load the image referenced in the srcset list that has the same size as the slot or, if there isn't one, the first image that is bigger than the chosen slot size. and that's it! at this point, if a supporting browser with a viewport width of 480px loads the page, the (max-width: 600px) media condition will be true, and so the browser chooses the 480px slot. the elva-fairy-480w.jpg will be loaded, as its inherent width (480w) is closest to the slot size. the 800px picture is 128kb on disk, whereas the 480px version is only 63kb — a saving of 65kb. now, imagine if this was a page that had many ...
...sers have minimum sizes that they'll let you reduce the window width to, and they might be wider than you'd think. when testing it with a mobile browser, you can use tools like firefox's about:debugging page to inspect the page loaded on the mobile using the desktop developer tools. to see which images were loaded, you can use firefox devtools's network monitor tab. older browsers that don't support these features will just ignore them. instead, those browsers will go ahead and load the image referenced in the src attribute as normal. note: in the <head> of the example linked above, you'll find the line <meta name="viewport" content="width=device-width">: this forces mobile browsers to adopt their real viewport width for loading web pages (some mobile browsers lie about their viewport ...
...And 4 more matches
Making asynchronous programming easier with async and await - Learn web development
these features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. they make async code look more like old-school synchronous code, so they're well worth learning. this article gives you what you need to know. ...
... promise, we could use a .then() block: hello().then((value) => console.log(value)) or even just shorthand such as hello().then(console.log) like we saw in the last article. so the async keyword is added to functions to tell them to return a promise rather than directly returning the value. in addition, this lets synchronous functions avoid any potential overhead that comes with running with support for using await. by only adding the necessary handling when the function is declared async, the javascript engine can optimize your program for you. sweet! the await keyword the real advantage of async functions becomes apparent when you combine it with the await keyword — in fact, await only works inside async functions. this can be put in front of any async promise-based function to pau...
...r; this.interests = interests; } async greeting() { return await promise.resolve(`hi! i'm ${this.name.first}`); }; farewell() { console.log(`${this.name.first} has left the building. ...
...And 4 more matches
Deployment and next steps - Learn web development
in this final article we will look at how to deploy your application and get it online, and also share some of the resources that you should go on to, to continue your svelte learning journey. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. ...
...ans you have plenty of options to choose from. let's look at a couple of examples. note: the following section could be applied to any client-side static web site requiring a build step, not just svelte apps. deploying with vercel one of the easiest ways to deploy a svelte application is using vercel. vercel is a cloud platform specifically tailored for static sites, which has out-of-the-box support for most common front-end tools, svelte being one of them. to deploy our app, follow these steps. register for an account with vercel. navigate to the root of your app and run npx vercel; the first time you do it, you'll be prompted to enter your email address, and follow the steps in the email sent to that address, for security purposes. run npx vercel again, and you'll be...
...re, unsurprisingly, built with svelte. if you liked it, you will also enjoy the return of 'write less, do more' presentation, which rich harris gave at jscamp 2019. ...
...And 4 more matches
Getting started with Svelte - Learn web development
perience of the modern tooling ecosystem. svelte sticks closely to the classic web development model of html, css, and js, just adding a few extensions to html and javascript. it arguably has fewer concepts and tools to learn than some of the other framework options. it's main current disadvantages are that it is a young framework — its ecosystem is therefore more limited in terms of tooling, support, plugins, clear usage patterns, etc. than more mature frameworks, and there are also less job opportunities. but it's advantages should be enough to make you interested to explore it. note: recently svelte has added official typescript support, one of its most requested features. we'll look at it later on in this tutorial series. we encourage you to go through the svelte tutorial for a re...
...ent knowledge: svelte has a shallow learning curve. web developers with basic html, css, and javascript knowledge can easily grasp svelte specifics in a short time and start building web applications. moreover, with the help of sapper (a framework based on svelte), you can also develop applications with advanced features like server-side rendering, code splitting, file-based routing and offline support. and then there's also svelte native, which lets you build native mobile applications. how does svelte work? being a compiler, svelte can extend html, css, and javascript, generating optimal javascript code without any runtime overhead. to achieve this, svelte extends vanilla web technologies in the following ways: it extends html by allowing javascript expressions in markup and providin...
...will be mostly working with vanilla javascript. first steps with svelte being a compiler, you can't just add a <script src="svelte.js"> tag to your page and import it into your app. you'll have to set up your development environment in order to let the compiler do its job. requirements in order to work with svelte you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). note that you can also use the yarn package manager in place of npm, but we'll assume you are using npm in this set of tutorials. see package management basics for more information on npm and yarn. if you're using windows, you will need to install some software to give you parity with unix/macos t...
...And 4 more matches
Introducing a complete toolchain - Learn web development
through a complete toolchain case study. there really are unlimited combinations of tools and ways to use them, what you see in this article and the next is only one way that the featured tools can be used for a project. note: it's also worth repeating that not all of these tools need to be run on the command line. many of today's code editors (such as vs code and atom) have integration support for a lot of tools via plugins. introducing our case study the toolchain that we are creating in this article will be used to build and deploy a mini site that lists data (taken from one of nasa's open apis) concerning potentially hazardous space objects that threaten our existence on earth! it looks like this: you can see a live version of the site at near-misses.netlify.com. tools us...
...cated software requirements will likely benefit from the usage of tools to help simplify the development process. in addition, you should include tests before you deploy to your production server to ensure your software works as intended — this already sounds like a necessary toolchain. for our sample project, we'll be using a toolchain specifically designed to aid our software development and support the technical choices made during the software design phase. we will however be avoiding any superfluous tooling, with the aim of keeping complexity to a minimum. for example, we could have included a tool to minimize our svg file sizes during build. however, this project has only 4 svg images, which were manually minified using svgo before adding them to the project. a couple of prerequis...
...erefore very important, especially for larger projects. the go to tool for javascript linting is eslint. it's an extremely powerful and versatile tool but can be tricky to configure correctly and you could easily consume many hours trying to get a configuration just right! out of the box, eslint is going to complain that it can't find the configuration file if you run it. the configuration file supports multiple formats but for this project we'll use .eslintrc.json (the leading period means the file is hidden by default). eslint is installed via npm, so as per discussions in chapter 2, you have the choice to install this tool locally or globally. using both is recommended: for projects you intend to share, you should always include eslint as a local dependency so that anyone making thei...
...And 4 more matches
Chrome registration
of elements that are typically part of the chrome. mozilla locates and reads the root chrome.manifest file for extensions and themes. note: with gecko 1.9.2 and older, mozilla reads chrome/*.manifest files from applications. starting with gecko 2.0, the root chrome.manifest is the only manifest used; you can add manifest commands to that file to load secondary manifests. chrome providers a supplier of chrome for a given window type (e.g., for the browser window) is called a chrome provider. the providers work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, content, and appearance of the window itself. there are three basic types of chrome providers: content the main source file for a w...
...ath/to/files note: the characters @ # ; : ? / are not allowed in the packagename. firefox 2, thunderbird 2, and seamonkey 1.1 will not find the chrome when packagename is mixed case. if the above example had a packagename of camelcasepackage, you would get an error message similar to "no chrome registered for chrome://camelcasepackage/path/to/files". firefox 3, thunderbird 3, and seamonkey 2 support mixed case. bug resolved in mozilla 1.9; see bug 132183. manifest instructions comments # this line is a comment - you can put here whatever you want a line is a comment if it begins with the character '#'. any following character in the same line is ignored. manifest manifest subdirectory/foo.manifest [flags] this will load a secondary manifest file. this can be useful for separat...
...the flags match. the version string must conform to the toolkit version format. note: versions of gecko before gecko 1.8.0.13 and gecko 1.8.1.5 contained a bug where if you use the comparisons <, > or =, the version string had be two or more characters long. if not, you would get a message in the error console that the appversion flag was not recognized. see bug 380398. platformversion when supporting more then one application, it is often more convenient for an extension to specify which gecko version it is compatible with. this is particularly true for binary components. if there are chrome registration lines which only apply to a particular gecko version, the flag platformversion=version platformversion<version platformversion<=version platformversion>version platformversion>=versio...
...And 4 more matches
Obsolete Build Caveats and Tips
purpose of this page the mozilla build process and code base have evolved considerably over the past few years. this has resulted in many caveats and tips being added to the mdn documentation for building older versions of the code base or dealing with older build tools. these tips, while helpful, are jarring and superfluous to the majority of new mozilla builders who are mainly interested in building the latest version of firefox. therefore, instead of deleting all these nuggets of information, it's best to collect them all here and remove them from the majority happy path documentation. each piece of information should mention the page and the section it originally came from. you can copy in the original text and bold out what has been removed. obsolete caveats and tips from simp...
...ad of deleting all these nuggets of information, it's best to collect them all here and remove them from the majority happy path documentation. each piece of information should mention the page and the section it originally came from. you can copy in the original text and bold out what has been removed. ...
...rsions visual c++ 9 (vs2008) professional/express download and install the windows 7 sdk. note that you need service pack 1--for the express edition it is a separate download. visual c++ 8 (vs2005) professional download and install the windows 7 sdk. install this microsoft hotfix to allow linking to work correctly. visual c++ 7.1 or visual c++ 8 (vs2005) express these versions are not supported and the windows 7 sdk will not work with them. you need to upgrade to one of the newer visual c++ versions above. for gecko 11 or below: you could also download the windows vista sdk and follow the instructions there to allow you to build against it. starting with gecko 12.0, this sdk is necessary. note: while this configuration will probably build on mozilla-1.9.1 and mozilla-1.
...And 4 more matches
Overview of Mozilla embedding APIs
at the heart of xpcom's implementation is the service manager and the component manager. together, these two services provide a centralized point for gaining access to all of the public mozilla interfaces. ...
...llowing utility classes are available from the xpcom dll. they provide some basic functionality which should be leveraged when building new xpcom components. nscomptr<interface-type> these are templatized smart pointers which transparently deal with xpcom reference counting issues. see the nscomptr user's manual for more information. nsstring there are a collection of string classes which support both unicode and ascii strings. these classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference document for more information. public return codes ns_succeeded ns_error_...
...this must be the first function call made into gecko. ns_termembedding this function shuts down gecko and cleans up any remaining resources... currently, once gecko has been shutdown, it cannot be restarted in the same process space... this should change in the future. ...
...And 4 more matches
Fonts for Mozilla 2.0's MathML engine
will instead display a box containing the hexadecimal representation of the unicode code point for the character. some mathematical operators are also drawn by using glyphs for larger variants of the character (e.g. summation symbol) or by assembling glyphs for a few pieces of the character (e.g braces). these variant or part glyphs do not in general have unicode assignments, and so font-specific support is required for some characters. mozilla has general support for the common delimiters and arrows that have the necessary unicode assignments. for other characters, mozilla has font-specific support. in general, if the necessary glyphs are not available on the system then mozilla tries to stretch symbols using scale transforms, but that may result in a less pleasant rendering. to see mathml a...
...note that some web sites may provide the required mathematical fonts as web fonts. in that case, you will see the correct rendering on these pages if you use gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or greater. ...
... cover all the symbols in mathml and also contains glyphs to stretch mathematical operators. they are available under the sil open font license and should be installed for best mathml rendering. note that currently, only the fonts in /fonts/stix-general/ are used for stretching mathematical operators with stix fonts. asana math is also freely available under the sil open font license and has good support for mathematical characters. starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), mozilla can also use the glyphs contained in that font for stretchy operators. starting in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), mathjax fonts are used as the default fonts for mathematical text and symbol stretching. these fonts are freely available under the apache li...
...And 4 more matches
L20n Javascript API
create a special locale called i-default to be used as the default. availablelocales is an array of all locales available to the context instance. this array (with defaultlocale appended to it if it is not already present) will be used to negotiate the fallback chain for the user. ctx.registerlocalenegotiator(negotiator: function) register a function which will be used to negotiate the locales supported by the context instance. if you don't call this function, l20n will use the built-in intl.prioritizelocales negotiator. ctx.registerlocalenegotiator(function(available, requested, deflocale) { return intl.prioritizelocales(available, requested, deflocale); }); negotiator is a function which takes the following arguments: available - all locales available to the context instance, requ...
... preferred locales for the context instance to negotiate against and freeze the context instance. when a context instance is frozen, no more resources can be added or linked. all io related to fetching the resource files takes place when a context instance freezes. when all resources have been fetched, parsed and compiled, the context instance will emit a ready event. the final list of locales supported by the context instance will be negotiated asynchronously by the negotiator registered by registerlocalenegotiator. ctx.requestlocales('pl'); ctx.requestlocales('fr-ca', 'fr'); if requestedlocales argument list is empty or undefined, the default locale from registerlocales will be used. ctx.requestlocales('pl'); if registerlocales hasn't been called, the special i-default loca...
...means that the following minimal code is valid and will result in a fully operational context instance. var ctx = l20n.getcontext(); ctx.addresource('<hello "hello, world!">'); ctx.requestlocales(); requestlocales can be called multiple times after the context instance emitted the ready event, in order to change the current language fallback chain, for instance if requested by the user. ...
...And 4 more matches
nss tech note1
ing the sec_asn1_pointer modifier here is a description of the various tags and modifiers that apply to the <tt style="color: rgb(0,0,0);">kind field. asn.1 tags asn.1 tags are specified in the lower byte of the kind field of the template, as noted above. the following is not an attempt to explain asn.1 tags or their purposes. rather, the goal here is to explain what type of tags the decoder supports and which macros should be used when defining tags in decoder templates. it should be noted that we only support an older specification of asn.1; multibyte tags are not currently supported. the 8-bit asn.1 tags that we support are made of three parts : the asn.1 component class type. it is specified in the upper 2 tag bits (number 6 and 7). there are four classes of asn.1 tags : univer...
...nce between the two macros. the sub field of the template points to a callback function of type sec_asn1templatechooser that returns the subtemplate depending on the component data. sec_asn1_skip: specifies that the decoder should skip decoding of the component. sec_asn1decodeitem can only skip required components and will assert if you try to skip an optional component. sec_quickderdecodeitem supports skipping the decoding of optional components if you define the tag of the component in the template sec_asn1_inner: recurse into the component and saves its content, without the surrounding asn.1 tag and length sec_asn1_save: saves the component data, but does not proceed to the next component if within a sequence template array. this means the next template will reprocess the same com...
...ut the surrounding asn.1 tag and length sec_asn1_save: saves the component data, but does not proceed to the next component if within a sequence template array. this means the next template will reprocess the same component. sec_asn1_skip_rest: abort the decoding. this is used in a template array within a sequence, if you don't care about the fields at the end of it. sec_asn1decodeitem only supports this modifier in the top-level template. sec_quickderdecodeitem allows it at any nested sublevel. sec_asn1_choice: allows decoding of components that are of variable type. this must be the first template in a null-terminated array. the offset parameter specifies where to store the type identifier in the target data . subsequent templates specify a custom identifier for each possible compo...
...And 4 more matches
NSS tools : certutil
new certificate will derive its authenticity. use the exact nickname or alias of the ca certificate, or use the ca's email address. bracket the issuer string with quotation marks if it contains spaces. -d [prefix]directory specify the database directory containing the certificate and key database files. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). nss recognizes the following prefixes: · sql: requests the newer database · dbm: requests the legacy database if no prefix is specified the default type is ...
...critical-flag:filename]... add one or multiple extensions that certutil cannot encode yet, by loading their encodings from external files. · oid (example): 1.2.3.4 · critical-flag: critical or not-critical · filename: full path to a file containing an encoded extension -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -g keysize set a key size to use when generating new public and private key pairs. the minimum is 512 bits and the maximum is 16384...
...t file name for new certificates or binary certificate requests. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -p dbprefix specify the prefix used on the certificate and key database file. this argument is provided to support legacy servers. most applications do not use a database prefix. -p phone specify a contact telephone number to include in new certificates or certificate requests. bracket this string with quotation marks if it contains spaces. -q pqgfile or curve-name read an alternate pqg value from the specified file when generating dsa ke...
...And 4 more matches
JSAPI User Guide
with no methods or properties of its own. use js_newglobalobject to create a global object. use js_initstandardclasses to populate it with the standard javascript globals. this may seem like a lot of pieces for a simple application. it amounts to about 80 lines of code, as shown below. but the jsapi is designed to scale to applications that need many global objects. it is a fine-grained api, supporting many different combinations of the parts, and giving applications precise control over how spidermonkey behaves. here is the boilerplate code necessary for a minimal jsapi application. it contains everything described above. #include "jsapi.h" using namespace js; // the class of the global object. static jsclass globalclass = { "global", jsclass_global_flags, js_propertystu...
...that you do not need to call js_initclass to make a new instance of that class—otherwise there would be a chicken-and-egg problem making the global object—but you should call js_initclass if you require a constructor function for script authors to call via new, and/or a class prototype object (myclass.prototype) for authors to extend with new properties at run time. in general, if you want to support multiple instances that share behavior, use js_initclass. protoobj = js_initclass(cx, globalobj, nullptr, &my_class, /* native constructor function and min arg count */ myclass, 0, /* prototype object properties and methods -- these will be "inherited" by all instances through ...
...nctions /* call a global function named "foo" that takes no arguments. */ ok = js_callfunctionname(cx, globalobj, "foo", 0, 0, &rval); jsval argv[2]; /* call a function in obj's scope named "method", passing two arguments. */ argv[0] = . . .; argv[1] = . . .; ok = js_callfunctionname(cx, obj, "method", 2, argv, &rval); jscontext you should never create more than one jscontext per jsruntime. support for multiple jscontexts per jsruntime will be removed in the future. if your application creates multiple runtimes, the application may need to know which runtime a context is associated with. in this case, use js_getruntime. use js_setcontextprivate and js_getcontextprivate to associate application-specific data with a context. initializing built-in and global js objects for a complete l...
...And 4 more matches
SpiderMonkey 1.8.5
ox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.5 is supported on all the platforms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in-time compiler (jit) (several, actually) that compiles javascript to machine code, for a significant speed increase. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous vers...
...that compiles javascript to machine code, for a significant speed increase. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8 the following features in earlier versions of spidermonkey have been dropped. support for extended class methods (in particular, jsequalityop) has been removed. multithreaded js programs that race against the same objects are now explicitly not supported. multithreaded programs are allowed, but each thread must operate on objects in a separate compartment, isolated from the other threads. the old build system (using makefile.ref) is no longer supported. spidermonkey 1.8.5 in...
...pes, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative. all support for the slow native function type has been removed, and the fast signature has been renamed to jsnative. embeddings that defined jsnatives in previous versions must update all those functions to the new signature. getters and setters of type jspropertyop took an id parameter of type jsval. the type of the parameter has b...
...And 4 more matches
Implementation Details
introduction this article is a reference how gecko implements at apis. ...
... introduction this article is a reference how gecko implements at apis. ...
... introduction this article is a reference how gecko implements at apis. ...
...And 4 more matches
Accessing the Windows Registry Using XPCOM
ementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs. to this end, there exist xpcom interfaces to read and write registry data. this article will show you how to use the available interfaces in several mozilla products. the examples in this document are all written in javascript using xpcom. support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which provides extensive registry functionality. the interface follows the windows api fairly closely, but with many of the low-level details taken care of for you. if you are writing an extension that only needs to support firefox 1.5 or newer, then you only need to read this section. a simple example here's a ...
...action associated with the windows registry is reading values. the simple example above shows how to read an existing string value. however, windows registry values can have several data types, so you need to ensure that you read the correct type. you can check the type of a value using the method getvaluetype(). this method returns an integer indicating the data type of the value. ...
...e(value)) { case wrk.type_string: return wrk.readstringvalue(value); case wrk.type_binary: return wrk.readbinaryvalue(value); case wrk.type_int: return wrk.readintvalue(value); case wrk.type_int64: return wrk.readint64value(value); } // unknown type return null; } writing registry values writing registry values is quite similar to reading. for each supported data type, there is a write*value() method complementary to the read*value() method. don't forget that if you are writing a new value, you may need to create() the parent key first. this example demonstrates writing a new string value: var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.create(...
...And 4 more matches
Aggregating the In-Memory Datasource
ad-only reflection". that is, you want to reflect the contents of something as an rdf graph (presumably so that it can be aggregated with other information or displayed as styled content). technical details as before, have an nscomptr as your delegate, but this time around,don't derive from nsirdfdatasource. ...
... graph (presumably so that it can be aggregated with other information or displayed as styled content). technical details as before, have an nscomptr as your delegate, but this time around,don't derive from nsirdfdatasource. also, instead of keeping an nscomptr<nsirdfdatasource>, you'll just want an nscomptr<nsisupports>: class myclass : public nsimyinterface { ... private: nscomptr<nsisupports> minner; }; construct the datasource delegate when your object is constructed (or, at worst, when somebody qi's for it): rv = nscomponentmanager::createinstance( krdfinmemorydatasourcecid, this, /* the "outer" */ nscomtypeinfo<nsisupports>::getiid(), getter_addrefs(minner)); note passing this as the "outer" parameter. now, if the in-memory datasource's i...
...this preserves the symmetrical property of queryinterface(). ...
...And 4 more matches
Detailed XPCOM hashtable guide
mon usage pattern mapping a simple keytype to a simple datatype; client does not need to declare or manage an entry class; nsdatahashtable datatype is a scalar such as pruint32; nsinterfacehashtable datatype is an interface; nsclasshashtable datatype is a class pointer owned by the hashtable. ...
...nter owned by the hashtable. ...
...i use? ...
...And 4 more matches
Mozilla internal string guide
that are not required to have a null-terminator (nsa[c]string). nsa[c]string is the base of the string classes (since it imposes fewer requirements) and ns[c]string is a class derived from it. functions taking strings as parameters should generally take one of these four types. ...
...]string). nsa[c]string is the base of the string classes (since it imposes fewer requirements) and ns[c]string is a class derived from it. functions taking strings as parameters should generally take one of these four types. in order to avoid unnecessary copying of string data (which can have significant performance cost), the string classes support different ownership models. ...
.... conversions from these encodings to utf-8 and utf-16 are provided by mozilla::encoding. additonally, on windows the are some rare cases (e.g. drag&drop) where it's necessary to call a system api with data encoded in the windows locale-dependent legacy encoding instead of utf-16. in those rare cases, use multibytetowidechar/widechartomultibyte from kernel32.dll. do not use iconv on *nix. we only support utf-8-encoded file paths on *nix, non-path gtk strings are always utf-8 and cocoa and java strings are always utf-16. when working with existing code, it is important to examine the current usage of the strings that you are manipulating, to determine the correct conversion mechanism. when writing new code, it can be confusing to know which storage class and encoding is the most appropriate.
...And 4 more matches
Components.Constructor
summary creates a javascript function which can be used to create or construct new instances of xpcom components. syntax var func = [ new ] components.constructor(contractid [, interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components. it eliminates the clutter of typing components.classes, components.int...
...travel through the layer between the javascript engine and xpcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called. if only one argument is given, that argument is the contract id of the xpcom component to create. ...
...ript engine and xpcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called. if only one argument is given, that argument is the contract id of the xpcom component to create. ...
...And 4 more matches
nsIDocShell
do not create an instance directly. instead, retrieve an nsidocshell from a browser or other document container element. note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script. ...
... boolean isbeingdestroyed(); void loadstream(in nsiinputstream astream, in nsiuri auri...
...r nswebbrowser for their root docshell. shouldsavelayoutstate boolean indicates whether the current page can be cached. read only. useerrorpages boolean attribute to access whether error pages are enabled. zoom float set/get the document scale factor. when setting this attribute, a ns_error_not_implemented error may be returned by implementations not supporting zoom. implementations not supporting zoom should return 1.0 all the time for the get operation. 1.0 by the way is the default of zoom. this means 100% of normal scaling or in other words normal size no zoom. constants constant value description internal_load_flags_none 0x0 used as a placeholder when you don't want to explicitly specify flags. in...
...And 4 more matches
nsIHTMLEditor
editor/idl/nsihtmleditor.idlscriptable please add a summary to this article. ...
... getindentstate(out boolean acanindent, out boolean acanoutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer();...
...the created anonymous element. aanonclass contents of the _moz_anonclass attribute. aiscreatedhidden a boolean specifying if the class "hidden" is to be added to the created anonymous element. return value a dom element. createelementwithdefaults() return a new element with default attribute values. this does not rely on the selection, and is not sensitive to context. used primarily to supply new element for various insert element dialogs (image, link, table, and horizontalrule are the only returned elements as of 9/12/18); namedanchor was removed in firefox 63. nsidomelement createelementwithdefaults( in astring atagname ); parameters atagname the html tagname. special input value for links: use "href" to get a link node (an "a" tag with the "href" attribute set) return...
...And 4 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...istener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifi...
...rllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); void geturlforuri(in string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); void search(in nsimsgsearchsession asearchsession, in nsimsgwindow amsgwindow, in nsimsgfolder amsgfolder, in string asearchuri); nsiuri streammessage(in string amessageuri, in nsisupports aconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in boolean aconvertd...
...And 4 more matches
Component; nsIPrefBranch
component: nsiprefbranch modules/libpref/public/nsiprefbranch.idlscriptable this interface is used to manipulate the preferences data. this object may be obtained from the preferences service (nsiprefservice) and used to get and set default and/or user preferences across the application. inherits from: nsisupports last changed in gecko 58 (firefox 58 / thunderbird 58 / seamonkey 2.55) this object is created with a "root" value which describes the base point in the preferences "tree" from which this "branch" stems. preferences are accessed off of this root by using just the final portion of the preference. for example, if this object is created with the root "browser.startup.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_ov...
... constants constant value description pref_invalid 0 long ...
...es to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. the structure of aobserver is any object with an observe function. see nsiobserver and here is a quick snippet: var myobserver = { observe: function(asubject, atopic, adata) { //do stuff here } } aholdweak true holds a weak reference to aobserver. the object must implement the nsisupportsweakreference interface or this will fail. false holds a strong reference to aobserver. clearuserpref() called to clear a user set value from a specific preference. this will, in effect, reset the value to the default value. if no default value exists the preference will cease to exist. note: this method does nothing if the prefbranch it is called on is a default branch. void clearuserpr...
...And 4 more matches
nsIWindowWatcher
clients may expect this property to be always current, so to properly integrate this component the application will need to keep it current by setting the property as the active window changes. ...
...ndow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-float...
...ch. if null, each top level window will be searched. return value the nsidomwindow with the target name. getwindowenumerator() get an nsisimpleenumerator for currently open windows in the order they were opened, guaranteeing that each will be visited exactly once. nsisimpleenumerator getwindowenumerator(); parameters none. return value an nsisimpleenumerator which will itself return nsisupports objects which can be nsisupports.queryinterface() (queryinterfaced) to an nsidomwindow. openwindow() creates a new window. it will automatically be added to our list. note: this method may examine the javascript context stack for purposes of determining the security context to use for the search for a given window named aname. note: this method will try to set the default charset f...
...And 4 more matches
nsIXULTemplateBuilder
essor is expected to use this query to generate results when asked by the template builder. the template builder then generates output for each result based on the <rule> elements. this allows the query processor to be specific to a particular kind of input data or query syntax, while the template builder remains independent of the kind of data being used. due to this, the query processor will be supplied with the datasource and query which the template builder handles in an opaque way, while the query processor handles these more specifically. results implement the nsixultemplateresult interface and may be identified by an id which must be unique within a given set of query results. each query may be accompanied by one or more <rule> elements. these rules are evaluated by the template builde...
...e, the content within the action body is used to create the tree rows instead. a matching result must have its rulematched() method called. when a result no longer matches, the result's hasbeenremoved() method must be called. optionally, the rule may have a <bindings> section which may be used to define additional variables to be used within an action body. each of these declared bindings must be supplied to the query processor via its addbinding() method. the bindings are evaluated after a rule has matched. templates may generate content recursively, using the previous iteration's results as reference point to invoke the same queries. since the reference point is different, different output will typically be generated. the reference point nsixultemplateresult object for the first iteration i...
...output. the addresult, removeresult, replaceresult and resultbindingchanged methods may be called by the query processor to indicate that the set of valid results has changed, such that a different query may match. if a different match would become active, the content for the existing match is removed and the content for the new match is generated. ...
...And 4 more matches
Weak reference
allowed to dangle, therefore, the pointer should be a owning reference. this design, however, is flawed, as it holds the observer in existence longer than would otherwise be necessary. the observer may only need a short life compared to the thing being observed. it might go away after the first interesting event, even. but in this design, by hitching its life to the observable, it is kept on life-support long past any need or use. what is actually needed in this case, is either out-of-band signaling, where when the observer wants to go away, it unregisters itself from the observable, which then releases its owning reference, allowing the observer to die, or else a new kind of reference. this document describes an implementation ofweak references. a weak reference does not hold its referent i...
...order to report events. the nsobservable doesn't want to keep the observers alive just to prevent a dangling pointer, however. so, instead of holding an owning reference to an nsiobserver, it holds a weak reference. the weak reference doesn't artificially extend the life of the observer, and yet, it can never dangle. the following assumes that any nsiobserver that is passed in also implements nsisupportsweakreference. you can extrapolate from managing a single observer to managing a list of observers. class nsobservable { public: // ... nsresult addobserver( nsiobserver* ); nsresult notifyobservers( nsimessage* ); // ... private: nsweakptr mobserver; // ...or imagine a list of observers here }; // ... nsresult nsobservable::addobserver( nsio...
...that the weak reference can't be aggregated to the target object. hence, we can't use queryinterface to move between them. i know this sounds more convenient, but the global routine ns_getweakreference makes it easy to go from the target object to the weak reference; and nsiweakreference::queryreferent gives you the same functionality as queryinterface for getting back. ...
...And 4 more matches
Index
hunderbird thunderbird includes a new message indexing and search system (gloda) that improves search performance, provides sophisticated full-text search capabilities and categorized search results. "gloda" is short for the thunderbird "global database". 29 gloda debugging the gloda code has log4moz logging statements spread throughout. the following preferences are supported to control how this gets logged: 30 gloda examples thunderbird 3, thunderbird this page provides some examples for using gloda. see creating a gloda message query for more examples. 31 gloda indexing this page provides a big-picture summary of what the indexer does; please see the source for nitty-gritty details or if this page seems to be wrong. ...
... indexing this page provides a big-picture summary of what the indexer does; please see the source for nitty-gritty details or if this page seems to be wrong. glodaindexer provides the core indexing logic. glodamsgindexer has the message-specific stuff, although the actual attribute-providers are found in glodaexplicitattr and glodafundattr. glodaabindexer has the limited address book support. 32 index index found 72 pages: 33 ldap support administration, enterprise, thunderbird this document is intended to "fill in the gaps" about how enterprise customers can leverage and customize ldap support in mozilla thunderbird. it is not intended as an introduction to ldap and mozilla products. it assumes you are already familiar with configuring p...
...p, imap, smtp, and nntp) designed for use in automated tests. it can also be used in manual qa tests. 41 mailnews xpcshell-tests automated testing, developing mozilla, mailnews, seamonkey, thunderbird mailnews xpcshell-tests are written and run in the same manner as the core xpcshell-tests. this page describes additional resources and facilities that mailnews has developed to support the xpcshell-tests; see the core xpcshell-tests page for more information on how to develop these. 42 mailbox mailnews the mailbox protocol is used to read messages from a local folder berkeley mailbox. it consists of nsmailboxservice, nsmailboxurl, and nsmailboxprotocol. this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us t...
...And 4 more matches
Activity Manager examples
e this sample to nsiactivityretryhandler and nsiactivitypausehandler as well. showing a user-defined activity with undo capability (c++) ..... #include "nsiactivity.h" #include "nsiactivitymanager.h" ..... ...
...with undo capability (c++) ..... #include "nsiactivity.h" #include "nsiactivitymanager.h" ..... ...
...py event pruint32 length; nsivariant **subjectlist; rv = event->getsubjects(&length, &subjectlist); if(ns_failed(rv)) return rv; // first subject in the list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subjectlist[0]); // get the initiator nsivariant *initiator; event->getinitiator(&initiator); if (initiator) { nsisupports* ptr; rv = object->getasisupports(&ptr); if(ns_failed(rv)) return rv; nscomptr<nsimsgcopyservice> copyservice = do_queryinterface(ptr); if (copyservice) copyservice->undo(folder); } return (*result = ns_ok); } ///////////////////////////////////////////////////////////////////////////// //// creating an undoable copy event nscomptr<nsiactivityundohandler...
...And 4 more matches
Streams - Plugins
n. normal mode: the browser uses the npp_write method to "push" stream data to the instance incrementally as it is available. random-access mode: the plug-in calls the npn_requestread method to "pull" stream data. in general, this mode is more expensive, because the entire stream must be downloaded to a temporary file before use unless the stream comes from a local file or an http server that supports the byte-range extension to http. file mode: the browser saves the entire stream to a local file and passes the file path to the plug-in instance through the npp_streamasfile method. use this feature only as a last resort; plug-ins should implement an incremental stream-based interface wherever possible. streams sent by the plug-in to the browser are like normal-mode streams produced by t...
...type type, npstream *stream, npbool seekable, uint16* stype); the instance parameter refers to the plug-in instance receiving the stream; the type parameter represents the stream's mime type. the stream parameter is a pointer to the new stream, which is valid until the stream is destroyed. the seekable parameter specifies whether the stream is seekable (true) or not (false). seekable streams support random access (for example, local files or http servers that support byte-range requests). the plug-in can set the output parameter type to one of these transmission modes: np_normal: (default): the plug-in can process the data progressively as it arrives from the network or file system through a series of calls to npp_writeready and npp_write. np_asfileonly: this plug-in gets full rando...
...tance can accept for this stream. if the plug-in allocates memory for the entire stream at once, it can return a large number. this number tells the browser that it can pass as much data to the instance as possible in a single call to npp_write. the browser can write a smaller amount of data if desired or necessary (for example, if only 8k of data is available in a network buffer). for instance, suppose the plug-in allocates, in npp_newstream, an 8k buffer to hold the data written from that stream. in the first call, npp_writeready could return 8192, resulting in a call to npp_write with a buffer of up to 8k bytes. after this data is copied from the browser's buffer to the plug-in's buffer, the plug-in begins to process the data asynchronously. at the next npp_writeready call, only half of t...
...And 4 more matches
BudgetState.budgetAt - Web APIs
is page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ibute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rnet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudgetat experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ? ie ? opera no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? samsung inter...
...And 4 more matches
BudgetState.time - Web APIs
Web › API › BudgetState › time
n this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ontribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...internet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettime experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ? ie ? opera no support nosafari ? webview android no support nochrome android full support 60firefox android ? opera android no support nosafari ios ? samsung inter...
...And 4 more matches
Basic usage of canvas - Web APIs
ratio of the initial canvas, it will appear distorted. note: if your renderings seem distorted, try specifying your width and height attributes explicitly in the <canvas> attributes, and not using css. the id attribute isn't specific to the <canvas> element but is one of the global html attributes which can be applied to any html element (like class for instance). it is always a good idea to supply an id because this makes it much easier to identify it in a script. the <canvas> element can be styled just like any normal image (margin, border, background…). these rules, however, don't affect the actual drawing on the canvas. we'll see how this is done in a dedicated chapter of this tutorial. when no styling rules are applied to the canvas it will initially be fully transparent. fallb...
...t the actual drawing on the canvas. we'll see how this is done in a dedicated chapter of this tutorial. when no styling rules are applied to the canvas it will initially be fully transparent. fallback content the <canvas> element differs from an <img> tag in that, like for <video>, <audio>, or <picture> elements, it is easy to define some fallback content, to be displayed in older browsers not supporting it, like versions of internet explorer earlier than version 9 or textual browsers. you should always provide fallback content to be displayed by those browsers. providing fallback content is very straightforward: just insert the alternate content inside the <canvas> element. browsers that don't support <canvas> will ignore the container and render the fallback content inside it. browsers ...
...it, like versions of internet explorer earlier than version 9 or textual browsers. you should always provide fallback content to be displayed by those browsers. providing fallback content is very straightforward: just insert the alternate content inside the <canvas> element. browsers that don't support <canvas> will ignore the container and render the fallback content inside it. browsers that do support <canvas> will ignore the content inside the container, and just render the canvas normally. for example, we could provide a text description of the canvas content or provide a static image of the dynamically rendered content. this can look something like this: <canvas id="stockgraph" width="150" height="150"> current stock price: $3.15 + 0.15 </canvas> <canvas id="clock" width="150" heig...
...And 4 more matches
CustomElementRegistry.define() - Web APIs
-in element: these elements inherit from — and extend — built-in html elements. syntax customelements.define(name, constructor, options); parameters name name for the new custom element. note that custom element names must contain a hyphen. constructor constructor for the new custom element. options optional object that controls how the element is defined. ...
...ement names must contain a hyphen. constructor constructor for the new custom element. options optional object that controls how the element is defined. one option is currently supported: extends: string specifying the name of a built-in element to extend. used to create a customized built-in element. return value void. exceptions exception description 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. syntaxerror the provided name is not a valid custom element name. typeerror the re...
...ame 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. syntaxerror the provided name is not a valid custom element name. typeerror the referenced constructor is not a constructor. ...
...And 4 more matches
DOMHighResTimeStamp - Web APIs
g, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. properties this type has no properties. it is a double-precision floating-point value. value the value of a domhighrestimestamp is a double-precision floating-point number which describes the number of milliseconds (accurate to within 5 microseconds if the device supports it) elapsed between two points in time. the starting time can be either a specific time determined by the script for a site or app, or the time origin. the time origin the time origin is a standard time which is considered to be the beginning of the current document's lifetime. it's calculated like this: if the script's global object is a window, the time origin is determined as follows...
...ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
DOMTokenList.forEach() - Web APIs
e.textcontent inside the foreach() inner function. ...
...lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
DocumentFragment.querySelector() - Web APIs
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
EventTarget.dispatchEvent() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
FileSystemDirectoryEntry.removeRecursively() - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ontribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rowser-compat-data and send us a pull request. ...
...And 4 more matches
FileSystemEntry.isFile - Web APIs
cating whether or not the filesystementry is a file. example this example shows how this property might be used to determine whether to process the entry as a directory or file. if the entry is neither, an error handler is called with an appropriate message. if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isfile' in that specification. draft initial specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://g...
...ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
FileSystemFileEntry.createWriter() - Web APIs
le on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
HTMLImageElement.lowSrc - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
HTMLMediaElement.onwaitingforkey - Web APIs
he compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
HTMLOrForeignElement.nonce - Web APIs
e property of the htmlorforeignelement interface returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed. in later implementations, elements only expose their nonce attribute to scripts (and not to side-channels like css attribute selectors). examples retrieving a nonce value in the past, not all browsers supported the nonce idl attribute, so a workaround is to try to use getattribute as a fallback: let nonce = script['nonce'] || script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned). the idl property (script['nonce']) will be the only way to access nonces. nonce hiding helps preventing that attackers exfiltrate...
...ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
HTMLScriptElement.referrerPolicy - Web APIs
and send no header to a less secure destination (e.g. https→http). unsafe-url send a full url when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade. examples var scriptelem = document.createelement("script"); scriptelem.src = "/"; scriptelem.referrerpol...
...the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
The HTML DOM API - Web APIs
the html dom api is made up of the interfaces that define the functionality of each of the elements in html, as well as any supporting types and interfaces they rely upon. the functional areas included in the html dom api include: access to and control of html elements via the dom. access to and manipulation of form data. interacting with the contents of 2d images and the context of an html <canvas>, for example to draw on top of them. management of media connected to the html media elements (<audio> and <video>). dragging and dropping of content on webpages. access to the browser navigation history supporting and connective interfaces for other apis such as web components, web storage, web workers, websocket, and server-sent events. html dom concepts and usage in this article, ...
...wo elements, one of which has two more elements nested inside it: while the document interface is defined as part of the dom specification, the html specification significantly enhances it to add information specific to using the dom in the context of a web browser, as well as to using it to represent html documents specifically. ...
... event handlers for document events defined by the html standard to allow access to mouse and keyboard events, drag and drop, media control, and more. ...
...And 4 more matches
Recommended Drag Types - Web APIs
the html drag and drop api supports dragging various types of data, including plain text, urls, html code, files, etc. the document describes best practices for common draggable data types. caution: all methods and properties in this document with a moz prefix, such as mozsetdataat(), will only work with gecko-based browsers. dragging text for dragging text, use the text/plain type. the second data parameter should be the dragged string. for example: event.datatransfer.setdata("text/plain", "this is text to drag"); dragging text in textboxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself. ...
... type. the second data parameter should be the dragged string. for example: event.datatransfer.setdata("text/plain", "this is text to drag"); dragging text in textboxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself. it is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. always add this text/plain type last, as it is the least specific and shouldn’t be preferred. note: in older code, you may find text/unicode or the text types. these are equivalent to text/plain, and will store and retrieve plain text data. dragging links dragged hyperlinks should include data of two types: text/uri-list, and text...
... event.currenttarget.appenditem(file.leafname); } } </script> in this example, the event returns false only if the data transfer contains the application/x-moz-file type. during the drop event, the data associated with the file type is retrieved, and the filename of the file is added to the listbox. note that the instanceof operator is used here as the mozgetdataat() method will return an nsisupports that needs to be checked and converted into an nsifile. this is also a good extra check in case someone made a mistake and added a non-file for this type. updates to datatransfer.types the latest spec dictates that datatransfer.types should return a frozen array of domstrings rather than a domstringlist (this is supported in firefox 52 and above). as a result, the contains method no longe...
...And 4 more matches
MediaMetadata.album - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
MediaMetadata.artist - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
MediaMetadata.artwork - Web APIs
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
MediaMetadata.title - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
Using the Media Capabilities API - Web APIs
o to determine how well media is being handled, in real time. these features include: the ability to query the browser to determine its ability to encode or decode media given a specified set of encoding parameters. these parameters may include the codecs, resolutions, bit rates, frame rates, and other such details. with the media capabilities api, you can determine not just if the browser can support a given format, but whether or not it can do so efficiently and smoothly. in short, this api replaces—and improves upon—the mediasource method istypesupported() or the htmlmediaelement method canplaytype(). more and more finely-detailed information about the display's properties, so that informed decisions can be made when choosing the best format to play on the user's device. for exampl...
...one feature of this is the ability to detect when the device switches gpus, so you can make appropriate adjustments based on the new gpu's capabilities. ...
...mater of the decodinginfo() method to determine if a video matching this configuration would be decodable and if the playback would be smooth and power efficient. var promise = navigator.mediacapabilities.decodinginfo(videoconfiguration); the decodinginfo() and encodinginfo() methods both return promises. ...
...And 4 more matches
NodeList.prototype.forEach() - Web APIs
Web › API › NodeList › forEach
); let list = node.childnodes; list.foreach( function(currentvalue, currentindex, listobj) { console.log(currentvalue + ', ' + currentindex + ', ' + this); }, 'mythisarg' ); the above code results in the following: [object htmlparagraphelement], 0, mythisarg [object text], 1, mythisarg [object htmlspanelement], 2, mythisarg polyfill this polyfill adds compatibility to all browsers supporting es5: if (window.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } or if (window.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = array.prototype.for...
...ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
PointerEvent.getCoalescedEvents() - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ke to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...n/browser-compat-data and send us a pull request. ...
...And 4 more matches
PushSubscription.getKey() - Web APIs
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
RTCRtpContributingSource.source - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsourcechrome full support 59edge full support ≤79firefox full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true). to change prefer...
...ll support ≤79firefox full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true). ...
... full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true). ...
...And 4 more matches
SVGAnimatedPoints - Web APIs
additionally, the points attribute on the original element accessed via the xml dom (e.g., using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut. ...
...generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ebviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedpointschrome ? edge full support ≤18firefox ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? ...
...And 4 more matches
SVGAnimatedString.animVal - Web APIs
animval attribute or animval property contains the same value as the baseval property.if the given attribute or property is being animated, contains the current animated value of the attribute or property. if the given attribute or property is not currently being animated, then it contains the same value as baseval the animval property is a read only property. internet explorer 9 supports script-based svg animation but it does not support declarative-based svg animation. as a result, the animval property contains the same value as the baseval property. syntax var = object.animval specifications specification status comment scalable vector graphics (svg) 1.1 (second edition) recommendation scalable vector graphics (svg) 2 candidate recommenda...
...ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
Using the Screen Capture API - Web APIs
in this article, we will examine how to use the screen capture api and its getdisplaymedia() method to capture part or all of a screen for streaming, recording, or sharing during a webrtc conference session. note: it may be useful to note that recent versions of the webrtc adapter.js shim include implementations of getdisplaymedia() to enable screen sharing on browsers that support it but do not implement the current standard api. this works with at least chrome, edge, and firefox. capturing screen contents capturing screen contents as a live mediastream is initiated by calling navigator.mediadevices.getdisplaymedia(), which returns a promise that resolves to a stream containing the live screen contents. starting screen capture: async/await style async function startcapture(displayme...
...straints the constraints object passed into getdisplaymedia() is a displaymediastreamconstraints object which is used to configuring the resulting stream. note: unlike most uses of constraints in media apis, here it's solely used to define the stream configuration, and not to filter the available choices. there are three new constraints added to mediatrackconstraints (as well as to mediatracksupportedconstraints and mediatracksettings) for configuring a screen capture stream: cursor indicates whether or not to capture the mouse cursor, and if so, whether to do so all the time or only while the mouse is in motion. the possible values are: always the mouse cursor should always be captured in the generated stream. motion the cursor should only be visible while moving, and, ...
...e capture of audio along with the video content. the source of this audio might be the selected window, the entire computer's audio system, or the user's microphone (or a combination of all of the above). before starting a project that will require sharing of audio, be sure to check the browser compatibility in mediadevices.getdisplaymedia() to see if the browsers you wish compaibility with have support for audio in captured screen streams. to request that the screen be shared with included audio, the options passed into getdisplaymedia() might look like this: const gdmoptions = { video: true, audio: true } this allows the user total freedom to select whatever they want, within the limits of what the user agent supports. this could be refined further by specifying additional informat...
...And 4 more matches
Using Service Workers - Web APIs
d idea because it allowed you to specify assets to cache really easily. however, it made many assumptions about what you were trying to do and then broke horribly when your app didn’t follow those assumptions exactly. read jake archibald's (unfortunately-titled but well-written) application cache is a douchebag for more details. note: as of firefox 44, when appcache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use service workers instead (bug 1204581.) service workers should finally fix these issues. service worker syntax is more complex than that of appcache, but the trade off is that you can use javascript to control your appcache-implied behaviors with a fine degree of granularity, allowing you to handle this p...
... cached assets first, thus providing a default experience even when offline, before then getting more data from the network (commonly known as offline first). this is already available with native apps, which is one of the main reasons native apps are often chosen over web apps. setting up to play with service workers many service workers features are now enabled by default in newer versions of supporting browsers. if however you find that demo code is not working in your installed versions, you might need to enable a pref: firefox nightly: go to about:config and set dom.serviceworkers.enabled to true; restart browser. chrome canary: go to chrome://flags and turn on experimental-web-platform-features; restart browser (note that some features are now enabled by default in chrome.) opera...
...find that demo code is not working in your installed versions, you might need to enable a pref: firefox nightly: go to about:config and set dom.serviceworkers.enabled to true; restart browser. chrome canary: go to chrome://flags and turn on experimental-web-platform-features; restart browser (note that some features are now enabled by default in chrome.) opera: go to opera://flags and enable support for serviceworker; restart browser. microsoft edge: go to about:flags and tick enable service workers; restart browser. you’ll also need to serve your code via https — service workers are restricted to running across https for security reasons. github is therefore a good place to host experiments, as it supports https. in order to facilitate local development, localhost is considered a...
...And 4 more matches
SubtleCrypto.unwrapKey() - Web APIs
ey may be used to unwrap a key return value result is a promise that fulfills with the unwrapped key as a cryptokey object. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the unwrapping key is not a key for the requested unwrap algorithm or if the cryptokey.usages value of that key doesn't contain unwrap. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised when trying to use an invalid format. supported algorithms the unwrapkey() method supports the same algorithms as the wrapkey() method. examples note: you can try...
...e pbkdf2 and some salt to derive the aes-kw unwrapping key. the salt needs to be the same as the salt that was used to derive the original aes-kw key wrapping key. once we have the unwrapping key we pass it into unwrapkey() with the wrapped key and other parameters. see the complete code on github. /* salt that is to be used in derivation of the key-wrapping key, alongside the password the user supplies. this must match the salt value that was originally used to derive the key. */ const saltbytes = [89,113,135,234,168,204,21,36,55,93,1,132,242,242,192,156]; /* the wrapped key itself. */ const wrappedkeybytes = [171,223,14,36,201,233,233,120,164,68,217,192,226,80, 224,39,199,235,239,60,212,169,100,23,61,54,244,197,160,80,109,230,207, 225,57,197,175,71,80,209]; /* convert an array o...
...7, 225,57,197,175,71,80,209]; /* convert an array of byte values to an arraybuffer. */ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as input to the derivekey method. the key material is a password supplied by the user. */ function getkeymaterial() { let password = window.prompt("enter your password"); let enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* derive an aes-kw key using pbkdf2. */ async function getunwrappingkey() { // 1. get the key material (user-s...
...And 4 more matches
Using the User Timing API - Web APIs
n at some location in an application. the mark is a timestamp in the browser's performance timeline. creating a performance mark the performance.mark() method is used to create a performance mark. the method takes one argument, the name of the mark, as shown in the following example. function create_marks(ev) { if (performance.mark === undefined) { log("create marks: performance.mark not supported", 0); return; } else { log("create marks", 0); // create several performance marks including two with the same name performance.mark("mark-1"); do_work(50000); performance.mark("mark-2"); do_work(50000); performance.mark("mark-2"); var marks = ["mark-1", "mark-2", "mark-2"]; for (var i=0; i < marks.length; i++) log("... created mark = " + marks[i], 0); } retrie...
... performance interface has three methods to retrieve marks. the following examples shows how to use each of these methods (performance.getentries(), performance.getentriesbytype(entrytype), and performance.getentriesbyname(name, entrytype) ) to retrieve one or more marks. function display_marks(ev) { if (performance.getentries === undefined) { log("display marks: performance.getentries not supported", 0); return; } log("display marks", 0); // display each mark using getentries() var entries = performance.getentries(); var j=0; for (var i=0; i < entries.length; i++) { if (entries[i].entrytype == "mark") { if (j == 0) { log("= getentries()", 0); j++ } log("... [" + i + "] = " + entries[i].name, 0); } } // display each mark using getentriesbytype(...
...ecific mark name is given to this method, only the mark(s) with that name will be removed. however, if no argument is given, then all performance entries of type "mark" will be removed from the performance timeline. the following example demostrates both uses of this method. function clear_marks(obj) { if (performance.clearmarks === undefined) { log("clear marks: performance.clearmarks not supported", 0); return; } log("clear marks", 0); if (typeof obj == "string") { log("... cleared '" + obj + "' mark(s)", 0); performance.clearmarks(obj); } else { // no argument specified so clear all marks log("... cleared all marks", 0); performance.clearmarks(); } } performance measures a measure performance entry type is named by the application and its timest...
...And 4 more matches
WebRTC API - Web APIs
other third-party software. webrtc consists of several interrelated apis and protocols which work together to achieve this. the documentation you'll find here will help you understand the fundamentals of webrtc, how to set up and use both data and media connections, and more. interoperability because implementations of webrtc are still evolving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library provided by google before you begin to write your code. adapter.js uses shims and polyfills to smooth over the differences among the webrtc implementations across the environments supporting it. adapter.js also handles prefixes and other naming differences to make the entire webrtc development p...
...ke the entire webrtc development process easier, with more broadly compatible results. the library is also available as an npm package. to learn more about adapter.js, see improving compatibility using webrtc adapter.js. webrtc concepts and usage webrtc serves multiple purposes; together with the media capture and streams api, they provide powerful multimedia capabilities to the web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending dtmf (touch-tone dialing) signals. connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the...
...iation is a design pattern which is recommended for your signaling process to follow, which provides transparency in negotiation while allowing both sides to be either the offerer or the answerer, without significant coding needed to differentiate the two. signaling and two-way video calling a tutorial and example which turns a websocket-based chat system created for a previous example and adds support for opening video calls among participants. the chat server's websocket connection is used for webrtc signaling. codecs used by webrtc a guide to the codecs which webrtc requires browsers to support as well as the optional ones supported by various popular browsers. included is a guide to help you choose the best codecs for your needs. using webrtc data channels this guide covers how you ...
...And 4 more matches
Inputs and input sources - Web APIs
a full webxr experience isn't just about showing the user a wholly virtual scene or augmenting reality by adding to or altering the world around them. in order to make an experience that's fulfilling and engaging, the user needs to be able to interact with it. to that end, webxr provides support for a variety of kinds of input devices. in this guide, we'll look at how to use webxr's input device management features to determine what input sources are available and how to then monitor those sources for inputs in order to handle user interactivity with your virtual or augmented environment. inputs in webxr fundamentally, inputs in webxr fall into two basic categories: targeting and actions. targeting is the specification of a point in space by the user's input. this may involve the user ...
...e a cursor. actions include both selection actions, such as clicking on a button, and squeeze actions, such as pulling a trigger or tightening your grip while wearing haptic gloves. by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you can create an interactive simulated environment. input device types webxr supports a variety of different types of devices to handle targeting and action inputs. these devices include but aren't limited to: screen taps (particularly but not necessarily only on phones or tablets) can be used to simultaneously perform both targeting and selection. motion-sensing controllers, which use accelerometers, magnetometers, and other sensors for motion tracking and targeting and ...
...device only has the primary movement sensors, a squeeze control, and a button, it may not have a gamepad record. if, however, the gamepad is present, you can use it to identify and poll the buttons and axes available on the controller. while the gamepad record is defined by the gamepad api specification, it's not actually managed by the gamepad api, and doesn't function exactly the same way. see supporting advanced controllers and gamepads in webxr applications for more detailed information. profile strings each input source can have zero or more input profile name strings, found in the array profiles, each of which describes a preferred visual representation of the input source within the 3d world as well as how the input source functions. the use of these profiles is briefly described un...
...And 4 more matches
Window.requestFileSystem() - Web APIs
his page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...gefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestfilesystem experimentalnon-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤18prefixed full support ≤18prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support ...
...And 4 more matches
Window.restore() - Web APIs
Web › API › Window › restore
ibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
:defined - CSS: Cascading Style Sheets
Web › CSS › :defined
nstance of a specific custom element */ simple-custom:defined { display: block; } syntax :defined examples hiding elements until they are defined the following snippets are taken from our defined-pseudo-class demo (see it live also). ...
...ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
:read-only - CSS: Cascading Style Sheets
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
:read-write - CSS: Cascading Style Sheets
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
background-position-x - CSS: Cascading Style Sheets
patibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
background-position-y - CSS: Cascading Style Sheets
patibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
border - CSS: Cascading Style Sheets
Web › CSS › border
utline: 0.5rem solid khaki; box-shadow: 0 0 0 2rem skyblue; border-radius: 12px; font: bold 1rem sans-serif; margin: 2rem; padding: 1rem; outline-offset: 0.5rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border' in that specification. candidate recommendation removes specific support for transparent, as it is now a valid <color>; this has no practical impact. though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none). css level 2 (revision 1)the definition of 'border' in that specification. recommendation accepts the inherit keyword. also accepts transparent as a valid color. css le...
...bility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
<integer> - CSS: Cascading Style Sheets
Web › CSS › integer
e or negative. integers can be used in numerous css properties, such as column-count, counter-increment, grid-column, grid-row, and z-index. syntax the <integer> data type consists of one or several decimal digits, 0 through 9 inclusive, optionally preceded by a single + or - sign. there is no unit associated with integers. note: there is no official range of valid <integer> values. opera 12.1 supports values up to 215-1, ie up to 220-1, and other browsers even higher. during the css3 values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in april 2012 during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also proposed. however, the latest spec doesn't specify a range anymore. interpolation when animated, v...
...ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
Guide to scroll anchoring - CSS: Cascading Style Sheets
es it work? scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. this means that the point in the document the user is looking at remains in the viewport, which may mean their scroll position actually changes in terms of how far they have moved through the document. how do i turn on scroll anchoring? you don't! the feature is enabled by default in supporting browsers. in most cases anchored scrolling is exactly what you want — content jumping is a poor experience for anyone. what if i need to debug it? if your page is not behaving well with scroll anchoring enabled, it is probably because some scroll event listener is not handling well the extra scrolling to compensate for the anchor node movement. you can check whether disabling scroll a...
...e an anchor, you can exclude it using overflow-anchor, as described below. what if i need to disable it? the specification provides a new property, overflow-anchor, which can be used to disable scroll anchoring on all or part of the document. it's essentially a way to opt out of the new behavior. the only possible values are auto or none: auto is the initial value; as long as the user has a supported browser the scroll anchoring behavior will happen, and they should see fewer content jumps. none means that you have explicitly opted the document, or part of the document, out of scroll anchoring. to opt out the entire document, you can set it on the <body> element: body { overflow-anchor: none; } to opt out a certain part of the document use overflow-anchor: none on its container e...
...ment use overflow-anchor: none on its container element: .container { overflow-anchor: none; } note: the specification details that once scroll anchoring has been opted out of, you cannot opt back into it from a child element. for example, if you opt 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. ...
...And 4 more matches
Content categories - Developer guides
a few other elements belong to this category, but only if a specific condition is fulfilled: <area>, if it is a descendant of a <map> element <link>, if the itemprop attribute is present <meta>, if the itemprop attribute is present <style>, if the scoped attribute is present sectioning content eleme...
...tly defined by the heading content itself. elements belonging to this category are <h1>, <h2>, <h3>, <h4>, <h5>, <h6> and <hgroup>. though likely to contain heading content, the <header> is not heading content itself. note: the <hgroup> element was removed from the w3c html specification prior to html 5 being finalized, but is still part of the whatwg specification and is at least partially supported by most browsers. phrasing content phrasing content defines the text and the mark-up it contains. runs of phrasing content make up paragraphs. 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>...
...make up paragraphs. 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>, <noscript>, <object>, <output>, <picture>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters). a few other elements belong to this category, but only if a specific condition is fulfilled: <a>, if it contains only phrasing content <area>, if it is a descendant of a <map> element <del>, if it contains only phrasing content <ins>, if it contains only phrasing content <li...
...And 4 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
json. for security reasons, browsers restrict cross-origin http requests initiated from scripts. for example, xmlhttprequest and the fetch api follow the same-origin policy. this means that a web application using those apis can only request resources from the same origin the application was loaded from unless the response from other origins includes the right cors headers. the cors mechanism supports secure cross-origin requests and data transfers between browsers and servers. modern browsers use cors in apis such as xmlhttprequest or fetch to mitigate the risks of cross-origin http requests. who should read this article? everyone, really. more specifically, this article is for web administrators, server developers, and front-end developers. modern browsers handle the client side of c...
...this article is for web administrators, server developers, and front-end developers. modern browsers handle the client side of cross-origin sharing, including headers and policy enforcement. but the cors standard means servers have to handle new request and response headers. another article for server developers discussing cross-origin sharing from a server perspective (with php code snippets) is supplementary reading. what requests use cors? this cross-origin sharing standard can enable cross-site http requests for: invocations of the xmlhttprequest or fetch apis, as discussed above. web fonts (for cross-domain font usage in @font-face within css), so that servers can deploy truetype fonts that can only be cross-site loaded and used by web sites that are permitted to do so. webgl text...
...gin resource sharing standard works by adding new http headers that let servers describe which origins are permitted to read that information from a web browser. additionally, for http request methods that can cause side-effects on server data (in particular, http methods other than get, or post with certain mime types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with the http options request method, and then, upon "approval" from the server, sending the actual request. servers can also inform clients whether "credentials" (such as cookies and http authentication) should be sent with requests. cors failures result in errors, but for security reasons, specifics about the error are not available to javascript. all the code kno...
...And 4 more matches
Number.prototype.toLocaleString() - JavaScript
of numbers, it is better to create a numberformat object and use the function provided by its numberformat.format property. examples using tolocalestring in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(number.tolocalestring()); // displays "3,500" if in u.s. ...
...d by its numberformat.format property. examples using tolocalestring in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(number.tolocalestring()); // displays "3,500" if in u.s. english locale checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. ...
...amples using tolocalestring in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(number.tolocalestring()); // displays "3,500" if in u.s. english locale checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. ...
...And 4 more matches
Using custom elements - Web Components
one of the key features of the web components standard is the ability to create custom elements that encapsulate your functionality on an html page, rather than having to make do with a long, nested batch of elements that together provide a custom page feature. this article introduces the use of the custom elements api. note: custom elements are supported by default in firefox, chrome, and edge (76). opera and safari so far support only autonomous custom elements. high-level view the controller of custom elements on a web document is the customelementregistry object — this object allows you to register a custom element on the page, return information on what custom elements are registered, etc. to register a custom element on the page, you use the customelementregistry.define() metho...
...unt element like this: customelements.define('word-count', wordcount, { extends: 'p' }); the element is called word-count, its class object is wordcount, and it extends the <p> element. a custom element's class object is written using standard es 2015 class syntax. for example, wordcount is structured like so: class wordcount extends htmlparagraphelement { constructor() { // always call super first in constructor super(); // element functionality written in here ... } } this is just a simple example, but there is more you can do here. it is possible to define specific lifecycle callbacks inside the class, which run at specific points in the element's lifecycle. for example, connectedcallback is invoked each time the custom element is appended into a document-connect...
...e example). this takes an image icon and a text string, and embeds the icon into the page. when the icon is focused, it displays the text in a pop up information box to provide further in-context information. to begin with, the javascript file defines a class called popupinfo, which extends the generic htmlelement class. class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } the preceding code snippet contains the constructor() definition for the class, which always starts by calling super() so that the correct prototype chain is established. inside the constructor, we define all the functionality the element will have when an instance of it is instantiated. in this case ...
...And 4 more matches
Using templates and slots - Web Components
flexible template that can then be used to populate the shadow dom of a web component. the truth about templates when you have to reuse the same markup structures repeatedly on a web page, it makes sense to use some kind of a template rather than repeating the same structure over and over again. this was possible before, but it is made a lot easier by the html <template> element (which is well-supported in modern browsers). this element and its contents are not rendered in the dom, but it can still be referenced using javascript. let's look at a trivial quick example: <template id="my-paragraph"> <p>my paragraph</p> </template> this won't appear in your page until you grab a reference to it with javascript and then append it to the dom, using something like the following: let templat...
...ough trivial, you can already start to see how this could be useful. using templates with web components templates are useful on their own, but they work even better with web components. let's define a web component that uses our template as the content of its shadow dom. we'll call it <my-paragraph>: customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template content to the shadow root, created using the node.clonenode() method. and because we a...
...lated inside the custom element. this wouldn't work if we just appended it to the standard dom. so for example: <template id="my-paragraph"> <style> p { color: white; background-color: #666; padding: 5px; } </style> <p>my paragraph</p> </template> now we can use it by just adding it to our html document: <my-paragraph></my-paragraph> note: templates are well-supported in browsers; the shadow dom api is supported by default in firefox (version 63 onwards), chrome, opera, safari, and edge (starting with version 79). adding flexibility with slots so far so good, but the element isn't very flexible. we can only display one bit of text inside it, meaning that at the moment it is even less useful than a regular paragraph! we can make it possible to display ...
...And 4 more matches
ui/frame - Archive of obsolete content
experimental create html iframes, using bundled html, css and javascript, that can be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. usage this module exports the frame constructor, which can be used to create frame components. right now it can be used in conjunction with a toolbar: you create a frame, then supply it to the toolbar's constructor, and the content is then displayed inside the toolbar. constructing frames the frame constructor takes one mandatory option, which is a url pointing to an html document supplied under your add-ons "data" directory. for example, this html document defines a <select> element and a couple of <span> elements, and includes a css file to style the content and a javascript s...
...ar self = require("sdk/self"); var frame1 = new frame({ url: require("sdk/self").data.url("content1.html") }); var frame2 = new frame({ url: "./content2.html" }); optional options: name type name string the frame's name. this must be unique within your add-on. this is used to generate an id to to keep track of the frame. if you don't supply a name, the id is derived from the frame's url, meaning that if you don't supply a name, you may not create two frames with the same url. onattach function assign a listener to the frame's attach event. ondetach function assign a listener to the frame's detach event. onload function assign a listener to the frame's load ev...
...ign a listener to a frame event: var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong) function pong(e) { if (e.data == "ping") { // message only the sender, and not any frames attached to other browser windows e.source.postmessage("pong", "*"); } } parameters event : string the name of the event to listen to. frame supports the following events: attach, detach, load, ready, and message. listener : function the listener function. this is passed an event object which always contains a source property, which has a postmessage() function modeled after window.postmessage(). you can use this to communicate only with the specific frame instance that generated the event, and not to any frame instance attached to oth...
...And 3 more matches
cfx to jpm - Archive of obsolete content
.js" and move it from "lib" to the top level or add a main field to package.json with the value "lib/main.js". loading modules the jpm tool uses the same logic as node.js to determine how to resolve the argument to require(). in most respects this is the same as the old cfx logic. however there are a few differences, because old compatibility shims have been removed. ...
...ant to use the "utils" module in "main.js", you should use a path relative to "main.js", and prefix the path with "./" to indicate that it's a relative path: var utils = require("./utils"); however, with cfx you are also allowed to omit the "./": var utils = require("utils"); // this will not work with jpm! this second form will not work with jpm. ...
... in jpm the old way to use third-party modules no longer works. instead, jpm expects third-party modules to be hosted on npm, and you can use them by installing them from np...
...And 3 more matches
package.json - Archive of obsolete content
e package.json may contain the following keys: author the name of the package's original author; this could be the name of a person or a company. defaults to an empty string. it may include a optional url in parentheses and an email address in angle brackets. this value will be used as the add-on's em:creator element in the install.rdf file generated by cfx. note: jpm supports nodejs people fields. contributors an array of additional author strings, identifying other contributors to the add-on. these values will be used as the add-on's em:contributor elements in its install.rdf. note: this is deprecated along with cfx; it's not available when using jpm. dependencies a string or an array of strings specifying the ...
... of strings specifying the names of packages that this add-on requires in order to function properly. description the add-on's description; this is a human-readable message describing what the add-on does. this defaults to the text "a basic add-on". this value will be used as the add-on's em:description element in its install.rdf. engines object with supported applications (key) and required version numbers (value). the version number can both specify a minimum and maximum version separated by a space. firefox: firefox desktop fennec: firefox for android thunderbird: thunderbird seamonkey: seamonkey any application uuid example: "engines": { "firefox": ">= 38.0a1", "fennec": ">= 38.0a1" } ...
...n its install.rdf. packages note: this is deprecated along with cfx and is not available when using jpm. a string pointing to a directory containing additional packages. defaults to "packages". permissions an object describing the set of permissions that the add-on needs. private-browsing: a boolean indicating whether or not the add-on supports private browsing. if this value is not true or is omitted, then the add-on will not see any private windows or objects, such as tabs, that are associated with private windows. see the documentation for the private-browsing module. cross-domain-content: a list of domains for which content scripts are given cross-domain privileges to access content in iframes or to make xmlhttprequests. s...
...And 3 more matches
Drag & Drop - Archive of obsolete content
elem.addeventlistener("dragdrop", _dragdrop, true); here, elem could be a window or an xul element. ...
...ragdrop, true); here, elem could be a window or an xul element. ...
...a window or an xul element. ...
...And 3 more matches
Install Manifests - Archive of obsolete content
specify a maxversion of 3.5.*, so that they are automatically compatible with security and stability updates. for firefox 3.0, a maxversion of 3.0.* should be used. extensions compatible only with firefox or thunderbird 2 should specify a maxversion of 2.0.0.*. the install manifest must specify at least one of these objects, and may specify more if the add-on targets multiple applications that support the add-on manager (e.g. firefox and thunderbird). examples <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!--firefox--> <em:minversion>1.5</em:minversion> <em:maxversion>3.0.*</em:maxversion> </description> </em:targetapplication> gecko 1.9 based applications allow you to use the special targetapplication id toolkit@mozilla.org ...
...on. 2 extensions 4 themes 8 locale 32 multiple item package 64 spell check dictionary 128 telemetry experiment 256 webextension experiment examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes. firefox 2 and previous supported a value of 16 to represent plug-ins. in firefox 3 this has been removed. version a version string identifying the version of the add-on being supplied. for firefox/thunderbird 1.0, the format must conform to the rules specified in extension versioning, update and compatibility. for firefox/thunderbird 1.5, see toolkit version format. examples <em:version>2.0</em:version> <em:version>1...
...4.1.2005090112</em:version> firefox 1.5 / xulrunner 1.8 - add-ons that do not use a valid version format will not be installed. the version format is different from, although backwards-compatible with, 1.0's. for add-ons hosted on addons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. abouturl the chrome:// url of the extension's about dialog box. this is only useful to extensions. if this property is specified, in the about:addons extensions list, the about... link in the extension's context menu will show this dialog, rather than the default. note: as of gecko 2.0, the dialog receives the addon object re...
...And 3 more matches
Observer Notifications - Archive of obsolete content
case. let's see the following example code on how to send out a notification from non-chrome code. /** * notifies all the registered observers with the test notification topic. */ notifytest : function() { let observerservice = components.classes["@mozilla.org/observer-service;1"]. ...
...tification from non-chrome code. /** * notifies all the registered observers with the test notification topic. */ notifytest : function() { let observerservice = components.classes["@mozilla.org/observer-service;1"]. getservice(components.interfaces.nsiobserverservice); let subject = components.classes["@mozilla.org/supports-string;1"]. createinstance(components.interfaces.nsisupportsstring); // assign some text to data attribute subject.data = "this is a test."; // notify all registered observers observerservice.notifyobservers( subject, "xulschoolhello-test-topic", "hello"); } in the notifytest method, the notifyobservers call is used to notify all registered observers about the notification topic "xulschoolhello-test-topic". the input parameter is an i...
... // assign some text to data attribute subject.data = "this is a test."; // notify all registered observers observerservice.notifyobservers( subject, "xulschoolhello-test-topic", "hello"); } in the notifytest method, the notifyobservers call is used to notify all registered observers about the notification topic "xulschoolhello-test-topic". the input parameter is an instance of nsisupportsstring with some text and the last input parameter is a string "hello". in a chrome browser overlay file, we register an observer to listen to the notification topic "xulschoolhello-test-topic" when the window loads. keep in mind that you have to remove observers that are not longer needed. not doing so will result in memory leaks. therefore, the registered observer is unregistered when the ...
...And 3 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
ation the hypertext approach to developing web pages, in which developers format text layouts into pages and link those pages to related content, is analogous to a book or a magazine: readers view pages, go to other pages for more information, and view resources listed as references on that page. html and web standards have evolved and now offer flexible and fine-grained control to layout as well supporting dhtml, powerful programming languages like javascript, and additional media through embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to different browsers. despite all the evolution, we still see the underpinnings of the original model in modern web sites. we still connect t...
... used to rotate news or stock quotes updates. a simple ticker element implemented in dhtml statically includes the data in the page. if the data changes, it will not update unless you reload the web page. this article includes a ticker example demonstrating that the inner-browsing model can be used to dynamically request new data from the server side and provide updates to the ticker. spell check suppose you have a web publishing system for a portal, and a spell check application on your server. today, this publishing system allows your users to modify content for the portal, but in order to have their text spell checked they must click somewhere and wait for the response page. the inner-browsing model is able to provide users with automatic spell check without leaving the page being edited, ...
...est to the server. you receive a new page with the next block of message headers. on slow speed connections, this process can be slow and frustrating. with inner browsing, a simple request to retrieve the next set of message headers that replace the currently viewed message headers can dramatically improve user experience. implementing inner-browsing on top of html pages modern browsers have good support for the w3c dom and javascript allowing fine-grained control over page content. instead of forcing the reader to follow links to new pages, the javascript code can act as the mediator for information access. if the user clicks on a link item, the script will be responsible to load the information from the data source and to apply that into the current document. there are basically two steps i...
...And 3 more matches
Source code directories overview - Archive of obsolete content
developers to the directory structure of the mozilla source code tree. it gives a bird's eye view of the source code so a developer can get a good idea what is in mozilla and where to find things. it is a good document for a new mozilla developer to start learning about the mozilla code base. this document contains material for seamonkey, firefox, and toolkit. it is a living document which is (supposed to be) updated monthly according to changes in the mozilla source tree. see also similar information in mozilla source code directory structure, and also see the more detailed overview of how the parts of gecko fit together. introduction: common subdirectories a common naming scheme is used throughout the mozilla source trees. at the top level is the name of the product (e.g. seamonkey). ...
...beos. qt contains source code for the qt toolkit, a c class library which runs on x-windows on unix, windows 95, windows 98 and window nt 4.0. photon contains source code for photon, a microkernel windowing system used in several real-time operating systems from qnx software systems ltd. seamonkey seamonkey is the development name for the mozilla browser suite. accessible contains code to support microsoft active accessibility and sun's atk accessibility api for linux. browser contains the code for firefox. this will be covered below. build contains scripts (usually perl) and programs used by the mozilla build team for building and managing the mozilla code base. these programs coordinate the running of makefiles and the creation of the dist directory. calendar contains the code fo...
... for code level things instead of build level things (which are a stored in the build directory). content was split off from layout and contains objects as they are exposed to the dom. db contains c code for the mdb/mork database which is a low-level, general-purpose and cross-platform file library. it is used to store mail box data, news data and global history data. it has not been updated to support xpcom yet. this code originated in the mozilla classic code base. dbm contains c code for managing, reading and writing hash tables. it is used for the auto-completion feature on the url edit box (stored in netscape.hst in mozilla classic) and for the cached pages index (stored in fat.db in mozilla classic). this code originated at uc berkeley. directory contains the ldap sdk. docshell con...
...And 3 more matches
Introduction to XUL - Archive of obsolete content
ly need to change the the mime type to something like "text/x-xul".) these files are processed using the same parser as "text/xml" files (and therefore subject to xml syntax rules, as they should be). it's possible to load a xul document from an xml file (one named *.xml). the resulting ui will be created using an xml content model. a xul content model is generated from *.xul files. xml documents support the basic dom level 1 core apis. xul documents support an extended set, much as html documents support dom level 1 html apis. mozilla's xul content models also support nifty features like local/remote merging; see the xul and rdf document for details. in general, you will want to store xul in *.xul files. a xul file can contain xml elements and html elements, as well as special elements uniq...
...relegated to the contents of a cdata section, to prevent the xml parser from choking on javascript which may look like xml content (a < character, for instance.) <html:script type="application/javascript"> <![cdata[ function lesser(a,b) { return a < b ? ...
...at this time these additional dom methods are available, though the code is of course the most accurate place to look for this information. ...
...And 3 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
1, this attribute is now always specified in lower case. autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the input. if false, only the text that hasn't been entered yet will be filled in. the textbox.autofill attribute must be set to true to use this feature. as of gecko 1.9.1, this attribute is superseded by the completedefaultindex attribute. autofill new in thunderbird 3 requires seamonkey 2.0 type: boolean if set to true, the best match will be filled into the textbox as the user types. if false, the default, the value will not be filled in until the user selects an item. completedefaultindex new in thunderbird 3 requires seamonkey 2.0 type: boolean if...
...te: applies to: thunderbird and seamonkeyif false, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results. the default value is true, hiding the dropdown button. this attribute only works correctly in seamonkey 1.x; for thunderbird and seamonkey 2.0 you should also set the enablehistory attribute; as of gecko 2.0 this attribute is completely superseded by it. note: for seamonkey 2.0 and all versions of thunderbird prior to 3.0 you also need to provide the disablehistory attribute. enablehistory new in thunderbird 1requires seamonkey 2.0 type: boolean if true, an arrow button will appear on the end of the textbox which, when pressed, will open a dropdown menu of all available results. focused type: boolea...
... onsearchcomplete new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the autocomplete search is finished and results are available. ontextcommand obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkeythis event handler is called when a result is selected for the textbox. as of gecko 1.9.1, this attribute is superseded by the ontextentered attribute. ontextentered new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when a result is selected for the textbox. ontextrevert obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkey this event handler is called when the user presses escape to revert the textbox to its original ...
...And 3 more matches
Commands - Archive of obsolete content
element had selected text or not, and for paste operations, whether there is something suitable on the clipboard to paste. as you can see, this becomes complicated. by using commands, much of the work is handled for you. you can use a command for any operation. mozilla uses them for almost every menu command. in addition, text fields and other widgets have a number of commands which they already support that you can invoke. you should use them when the operation depends on which element is focused. a command is identified by its id attribute. mozilla uses the convention that command id's start with 'cmd_'. you will probably want to use the same id if a command is already being used, however, for your own commands, you can use any command id you wish. to avoid conflicts, you may wish to incl...
...or a window. the command dispatcher contains methods for retrieving controllers for commands and for retrieving and modifying the focus. adding controllers you can implement your own controllers to respond to commands. you could even override the default handling of a command with careful placement of the controller. a controller is expected to implement four methods, which are listed below: supportscommand (command) this method should return true if the controller supports a command. if you return false, the command is not handled and command dispatcher will look for another controller. a single controller may support multiple commands. iscommandenabled (command) this method should return true if the command is enabled, or false if it is disabled. corresponding buttons will be disabl...
...ample below isn't completely polished. really, we should ensure that the selection and focus is adjusted appropriately after a deletion. ...
...And 3 more matches
richlistbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...ed ] this element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
... 3, rich list boxes support only single selection. firefox 3 introduced multiple selection to rich list boxes. ...
...And 3 more matches
What XULRunner Provides - Archive of obsolete content
the goal of xulrunner is to provide a solution for deploying xul applications (primarily firefox and thunderbird), as well as providing an embedding mechanism. ...
...tions (primarily firefox and thunderbird), as well as providing an embedding mechanism. ...
...see the wikimo:xul:installation story. extension manage...
...And 3 more matches
nsIContentPolicy - Archive of obsolete content
d() or shouldprocess() (for example, by launching a dialog to prompt the user for something).") note: in reality, much of this interface is defined in the nsicontentpolicybase interface, but for now is documented here until someone has time to split things up. ...
...ialog to prompt the user for something).") note: in reality, much of this interface is defined in the nsicontentpolicybase interface, but for now is documented here until someone has time to split things up. ...
... someone has time to split things up. method overview short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal arequestprincipal); constants content types constant value description type_other 1 indicates content whose type is unknown, or is not interesting outside a limited use case. in general, you should try not to use this type unless none of the others is a fit. type_script ...
...And 3 more matches
SSL and TLS - Archive of obsolete content
xchange of messages called the ssl handshake, initial communication between the server and client. the handshake allows the server to authenticate itself to the client using public-key techniques, then allows the client and the server to cooperate in the creation of symmetric keys used for rapid encryption, decryption, and tamper detection during the session that follows. both of these protocols support using a variety of different cryptographic algorithms, or ciphers, for operations such as authenticating the server and client, transmitting certificates, and establishing session keys. clients and servers may support different cipher suites, or sets of ciphers. among other functions, the ssl handshake determines how the server and client negotiate which cipher suite they will use to authenti...
... determines how the server and client negotiate which cipher suite they will use to authenticate each other, to transmit certificates, and to establish session keys. key-exchange algorithms like rsa and elliptic curve cryptography (ecc) govern the way the server and client determine the symmetric keys to use during an ssl session. the most common ssl cipher suites use rsa key exchange, while tls supports ecc cipher suites as well as rsa. note: longer rsa keys are required to provide security as computing capabilities increase. the recommended rsa key-length is 2048 bits. though many web servers continue to use 1024-bit keys, web servers should migrate to at least 2048 bits. for 64-bit machines, consider using stronger keys. all cas should use at least 2048-bit keys, and stronger keys (such ...
...-length is 2048 bits. though many web servers continue to use 1024-bit keys, web servers should migrate to at least 2048 bits. for 64-bit machines, consider using stronger keys. all cas should use at least 2048-bit keys, and stronger keys (such as 3072 or 4096 bits) if possible. as pkis using rsa keys and certificates transition to other cryptographic systems like ecc, servers should continue to support rsa. supported cipher suites for rsa cipher suites with the rsa key exchange that are commonly supported include the following: aes and sha message authentication. advanced encryption standard (aes) ciphers have a fixed block size of 128-bits, and the keys can be either 128-bit or 256-bit. there are 3.4 x 1038 possible 128-bit keys and 1.1 x 1077 possible 256-bit keys. there are more pos...
...And 3 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
rosoft ensures common behavior across applications. for example, in word, excel, and other windows applications, we know that pressing ctl+c within any microsoft product means copy. the behavior is consistent and predictable and has subsequently become the de-facto standard. ...
... the reason it is consistent and predictable is because microsoft has established a corporate set of usability standards and supports the relevant international standards. accessibility no organization can afford to overlook or ignore accessibility standards. within the web environment, the accessibility standards are closely tied to html, xml, xhtml, and other w3c standards. by integrating and supporting the accessibility guidelines, an organization can offer their product lines or services to a larger and more diverse user base. interchangeability if a user experiences consistent behavior across a range of products, they can predict how a particular action or function will work or respond. as a product provider, the goal should be the element of least surprise. by instilling a set of gl...
...owing divergence across applications is that information must be replicated, altered, or massaged to be processed across the divergent applications. this also creates issues in regard to authoring tools for these various applications. for example, let us say we have multiple application offerings that can be used to browse the web. each of these applications has followed their own development and support standards. they each may support some or part of the international standards, but not fully. what authoring tool should we use? would it be fiscally prudent to develop proprietary authoring tools for each application? what would the market adoption rate be for the suite of applications in this case? how can an organization consistently win market share if their product offerings are not integ...
...And 3 more matches
Popup Window Controls - Archive of obsolete content
how to detect popup controls, how to ask your readers to enable popups for your site and how to get the benefits of popup windows without using popup windows. ...
... ask your readers to enable popups for your site and how to get the benefits of popup windows without using popup windows. ...
...s except for sites which the user has explicity denied permission what popup windows are suppressed? mozilla will attempt to suppress all calls to window.open() which occur in the following circumstances: global script which is executed as the document is loading script executed as part of a onload event handler script executed in settimeout() or setinterval() what popup windows are not suppressed? any attempt to open a popup window that is the direct result of user action, such as clicking on a hyperlink, should succeed in opening popup windows even if the user has popup controls enabled on your site. detecting suppressed popups windows if a user has popup controls enabled for your site, any attempt to call window.open in global script, in an onload handler or in settimeout() or...
...And 3 more matches
Web fonts - Learn web development
ternatives, followed by the default system font, but this adds overhead in terms of testing to make sure that your designs look ok with each font, etc. web fonts but there is an alternative, which works very well, right back to ie version 6. web fonts are a css feature that allows you to specify font files to be downloaded along with your website as it is accessed, meaning that any browser that supports web fonts can have exactly the fonts you specify available to it. amazing! the syntax required looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src: url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply you...
...font"; src: url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. ...
...d inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. there are two important things to bear in mind about web fonts: browsers support different font formats, so you'll need multiple font formats for decent cross-browser support. for example, most modern browsers support woff/woff2 (web open font format versions 1 and 2), the most efficient format around, but older versions of ie only support eot (embedded open type) fonts, and you might need to include an svg version of the font to support older versions of iphone and android browsers. we'll show you below how to generate the required code. fonts generally aren't f...
...And 3 more matches
What text editors are available? - Learn web development
tors as you can and get a feel for what suits your workflow. but we'll give you some pointers for getting started. here are the primary questions you should consider: which os (operating system) do i want to work with? what kind of technologies do i want to manipulate? what kind of basic features do i expect from my text editor? do i want to add extra features to my text editor? do i need support/help while using my text editor? does my text editor's look-and-feel matter to me? notice we didn't mention price. obviously, that matters too, but a product's cost has little connection with its quality or capability. there's a big chance you'll find a suitable text editor for free. here are some popular editors: editor licence price os support doc. extensible...
...you will learn more about customizing your editors and tools as you gain experience, and more importantly you will learn what features are more useful to your purposes. dig deeper choice criter...
...ystem) do i want to work with? of course it's your choice. however, some editors are only available for certain oss, so if you like switching back and forth, that would narrow down the possibilities. any text editor can get the job done, if it runs on your system, but a cross-platform editor eases migration from os to os. so first find out which os you're using, and then check if a given editor supports your os. most editors specify on their website whether they support windows or mac, though some editors only support certain versions (say, only windows 7 or later and not vista). if you're running ubuntu, your best bet is to search within the ubuntu software center. in general, of course, the linux/unix world is a pretty diverse place where different distros work with different, incompatibl...
...And 3 more matches
UI pseudo-classes - Learn web development
inate state (neither checked or not checked), and the default selected option when the page loads (e.g. an <input type="checkbox"> with the checked attribute set, or an <option> element with the selected attribute set). there are many others too, but the ones listed above are the most obviously useful. some of the others are aimed at solving very specific niche problems, or simply not very well supported in browsers yet. the ones listed above all have pretty good browser support, but of course, you should test your form implementations carefully to make sure they work for your target audience. note: a number of the pseudo-classes discussed here are concerned with styling form controls based on their validation state (is their data valid, or not?) you'll learn much more about setting and c...
...ting label (see it live here, and see the source code here). first of all, we'll add a paragraph to the top of the form to say what you are looking for: <p>required fields are labelled with "required".</p> screenreader users will get "required" read out as an extra bit of information when they get to each required input, which sighted users will get our label. ...
...tted when the form is submitted. we've styled the form controls using the :read-only and :read-write pseudo-classes, like so: input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } firefox only supported these pseudo-classes with a prefix up to version 78; at which point it started to support the unprefixed version. the full example looks like so: note: :enabled and :read-write are two more pseudo-classes that you'll probably rarely use, given that they describe the default states of input elements. radio and checkbox states — checked, default, indeterminate as we've seen in earlie...
...And 3 more matches
Adding vector graphics to the Web - Learn web development
ia css or scripted via javascript. so why would anyone want to use raster graphics over svg? well, svg does have some disadvantages: svg can get complicated very quickly, meaning that file sizes can grow; complex svgs can also take significant processing time in the browser. svg can be harder to create than raster images, depending on what kind of image you are trying to create. svg is not supported in older browsers, so may not be suitable if you need to support older versions of internet explorer with your web site (svg started being supported as of ie9.) raster graphics are arguably better for complex precision images such as photos, for the reasons described above. note: in inkscape, save your files as plain svg to save space. also, please refer to this article describing how t...
...loading times for any page that uses the image loaded in the future. cons you cannot manipulate the image with javascript. if you want to control the svg content with css, you must include inline css styles in your svg code. (external stylesheets invoked from the svg file take no effect.) you cannot restyle the image with css pseudoclasses (like :focus). ...
...ses the image loaded in the future. cons you cannot manipulate the image with javascript. if you want to control the svg content with css, you must include inline css styles in your svg code. (external stylesheets invoked from the svg file take no effect.) you cannot restyle the image with css pseudoclasses (like :focus). ...
...And 3 more matches
From object to iframe — other embedding technologies - Learn web development
ch content into webpages such as videos and animations, which just weren't available through html alone. embedding these technologies was achieved through elements like <object>, and the lesser-used <embed>, and they were very useful at the time. they have since fallen out of fashion due to many problems, including accessibility, security, file size, and more; these days most mobile devices don't support such plugins anymore, and desktop support is on the way out. finally, the <iframe> element appeared (along with other ways of embedding content, such as <canvas>, <video>, etc.) this provides a way to embed an entire web document inside another one, as if it were an <img> or other such element, and is used regularly today. with the history lesson out of the way, let's move on and see how to...
...s explore the code in a bit more detail. say you wanted to include the mdn glossary on one of your web pages — you could try something like this: <iframe src="https://udn.realityripple.com/docs/glossary" width="100%" height="500" frameborder="0" allowfullscreen sandbox> <p> <a href="https://udn.realityripple.com/docs/glossary"> fallback link for browsers that don't support iframes </a> </p> </iframe> this example includes the basic essentials needed to use an <iframe>: allowfullscreen if set, the <iframe> is able to be placed in fullscreen mode using the full screen api (somewhat beyond scope for this article.) frameborder if set to 1, this tells the browser to draw a border between this frame and other frames, which is the default behaviour. 0 rem...
...is attribute, as with <video>/<img>, contains a path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback content between the opening and closing <iframe></iframe> tags that will appear if the browser doesn't support the <iframe>. in this case, we have included a link to the page instead. it is unlikely that you'll come across any browser that doesn't support <iframe>s these days. sandbox this attribute, which works in slightly more modern browsers than the rest of the <iframe> features (e.g. ie 10 and above) requests heightened security settings; we'll say more about this in the next section. note: ...
...And 3 more matches
Introduction to web APIs - Learn web development
apis, what they can do, and how you can use them in your code. what are apis? application programming interfaces (apis) are constructs made available in programming languages to allow developers to create complex functionality more easily. they abstract more complex code away from you, providing some easier syntax to use in its place. as a real-world example, think about the electricity supply in your house, apartment, or other dwellings. if you want to use an appliance in your house, you simply plug it into a plug socket and it works. you don't try to wire it directly into the power supply — to do so would be really inefficient and, if you are not an electrician, difficult and dangerous to attempt. image source: overloaded plug socket by the clear communication people, on flic...
... (say c or c++) that directly controls the computer's gpu or other graphics functions. note: see also the api glossary entry for further description. apis in client-side javascript client-side javascript, in particular, has many apis available to it — these are not part of the javascript language itself, rather they are built on top of the core javascript language, providing you with extra superpowers to use in your javascript code. they generally fall into two categories: browser apis are built into your web browser and are able to expose data from the browser and surrounding computer environment and do useful complex things with it. for example, the web audio api provides javascript constructs for manipulating audio in the browser — taking an audio track, altering its volume, ap...
...antly without having to reload the whole entire page from the server can make the site or app feel much more responsive and "snappy". apis that make this possible include xmlhttprequest and the fetch api. you may also come across the term ajax, which describes this technique. find out more about such apis in fetching data from the server. apis for drawing and manipulating graphics are now widely supported in browsers — the most popular ones are canvas and webgl, which allow you to programmatically update the pixel data contained in an html <canvas> element to create 2d and 3d scenes. for example, you might draw shapes such as rectangles or circles, import an image onto the canvas, and apply a filter to it such as sepia or grayscale using the canvas api, or create a complex 3d scene with li...
...And 3 more matches
Software accessibility: Where are we today?
lighted. special keyboards exist to make data entry easier. however, any special features are generally handled in the keyboard itself, so that no special programming is required. speech recognition technology lets people talk to the computer. this technology has come a long way, but still needs to be more integrated into mainstream software. consistent keyboard support and hotkeys many people can't use a mouse. extremely consistent keystroke support is a very important consideration. blind testers have knack for finding ways to improve keystroke support in almost any given piece of software. testing with people that have disabilities generally benefits everyone. use the accessible toolkit checklist to make sure your ui controls adhere to standards. ...
...nd productivity applications are not open source, this forced disabled people to rely on the companies which produce this software to make it accessible. these companies were often reluctant for various reasons including the large amount of time required to do so. on a positive note, recent federal purchasing rules such as section 508 have caused many companies to pay attention and implement msaa support. enter open source software microsoft was on the right track with microsoft active accessibility, but because the source code to most popular desktop applications which are used in large corporations is not publicly available, they were never made fully accessible. in open source, however, making the necessary modifications to make them accessible is very possible. open source software is an ...
...dware is required, why should a disabled person pay extra money to use the same software as everyone else? that said, there is still an important role for adaptive technology vendors in creating special services and hardware, or even proprietary software on platforms where that is appropriate. . the ideal situation would be for adaptive technology professionals to make money on rehab, trainingand support - something there is currently not enough of. each end user has a unique set problems, and in the open source world, providing highly customized solutions can be a business in itself. right now, gui's on linux are mostly not accessible. microsoft windows is still far more accesible. gnome, kde, staroffice, koffice, mozilla and all other gui software packages in linux are unuseable by large nu...
...And 3 more matches
Creating localizable web applications
the locale correctly be smart about detecting the user's locale correctly. you can use one or more of the following techniques: http accept-language headers, the ua string, ip geolocation. see examples of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config class expects arrays of valid languages & supported languages. always give the user a possibility to change the locale (e.g. by adding locale dropdown menu at bottom of page) and remember this choice for the future visits. use the locale code in the urls depending on how you detect user's locale, you may want to provide a way of overriding the autodetection. you can achieve this by setting a cookie when the user changes the locale with th...
...alizers' work with repeating content. this is useful for strings occurring in the webapp multiple times, like "return to top", "comments", "click to see larger image" etc. might be also helpful for headers and footers, if you're not using templates to display them. in most of the cases though, you should use gettext whenever technically possible (i.e. the server's php has been built with gettext support). localize the date format localizing the date format is as easy as localizing any other string. just let the localizers localize the format specification string. snippet 1. bad: $persona['date'] = date("n/j/y", strtotime($persona['approve'])); snippet 2. good: $persona['date'] = date(_("n/j/y"), strtotime($persona['approve'])); localize the number format you can make the number for...
...zilla labs personas") . "\" /></a>", $locale_conf->url('/'));?> </h1> snippet 10. better: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= /* l10n: link title attribute */ _("mozilla labs personas"); ?> " /> </a> </h1> ...but don't sacrifice flexibility don't sacrifice flexibility trying to satisfy the rule above. make sure the content supports changing the order of the sentence, which may be required by some grammars. snippet 1. bad: <p class="added"><?= _("<strong>added:</strong>") . $persona['date']; ?></p> snippet 2. bad: <p class="added"><strong><?= _("added:") ?></strong><?= $persona['date']; ?></p> snippet 3. good: <p class="added"><? printf( /* l10n: %s is a date */ _("<strong>added:</strong> %s"), $persona['date']);?
...And 3 more matches
An overview of NSS Internals
software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules...
...txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to initialize nss with the required parameters (such as a database), and nss will then transparently manage the database files. most of the time certificates and keys are supposed to be stored in the nss database. therefore, after initial import or creation, the programmer usually doesn't deal with their raw bytes. instead, the programmer will use lookup functions, and nss will provide an access handle that will be subsequently used by the application's code. those handles are reference counted. nss will usually create an in-memory (ram) presentation of certificates, ...
... to make it easier to review code for security. the less code that has access to raw secret keys, the less code that must be reviewed. nss has only limited functionality to look up raw keys. the preferred approach is to use certificates, and to look up certificates by properties such as the contained subject name (information that describes the owner of the certificate). for example, while nss supports random calculation (creation) of a new public/private key pair, it's difficult to work with such a raw key pair. the usual approach is to create a certificate signing request (csr) as soon as an application is done with the creation step, which will have created a handle to the key pair, and which can be used for the necessary related operations, like producing a proof-of-ownership of the pr...
...And 3 more matches
NSS API Guidelines
andle certificate management message format (cmmf) and certificate request message format (crmf, see rfc 2511) data. cmmf no longer exists as a proposed standard; cmmf functions have been incorporated into the proposal for certificate management protocols (cmp). same level as ssl lib/crmf cmmf.h, crmf.h, crmft.h, cmmft.h, crmffut.h cryptohi provides high-level cryptographic support operations: such as signing, verifying signatures, key generation, key manipulation, hashing; and data types. this code is above the pkcs #11 layer. sign/verify lib/cryptohi cryptohi.h, cryptoht.h, hasht.h, keyhi.h, keythi.h, key.h, keyt.h, sechash.h fort provides a pkcs #11 interface, to fortezza crypto services. fortezza is a set of security algorithms, used by the u.s.
...curity algorithms, used by the u.s. government. there is also a swft library that provides a software-only implementation of a pkcs #11 fortezza token. pkcs #11 lib/fortcrypt cryptint.h, fmutex.h, fortsock.h, fpkcs11.h, fpkcs11f.h, fpkcs11t.h, fpkmem.h, fpkstrs.h, genci.h, maci.h freebl provides the api to actual cryptographic operations. the freebl is a wrapper api. you must supply a library that implements the cryptographic operations, such as bsafe from rsa security. this is also known as the "bottom layer" api, or blapi. within pkcs #11, wraps crypto lib/freebl blapi.h, blapit.h jar provides support for reading and writing data in java archive (jar) format, including zlib compression. port lib/jar jar-ds.h, jar.h, jarfile.h nss ...
...le. pkcs #11: implementation lib/softoken keydbt.h, keylow.h, keytboth.h, keytlow.h, secpkcs5.h, pkcs11.h, pkcs11f.h, pkcs11p.h, pkcs11t.h, pkcs11u.h ssl provides an implementation of the ssl protocol using nss and nspr. ssl lib/ssl ssl.h, sslerr.h, sslproto.h, preenc.h secutil provides utility functions and data types used by other libraries. the library supports base-64 encoding/decoding, reader-writer locks, the secitem data type, der encoding/decoding, error types and numbers, oid handling, and secure random number generation. utility for any layer lib/util base64.h, ciferfam.h, nssb64.h, nssb64t.h, nsslocks.h, nssrwlk.h, nssrwlkt.h, portreg.h, pqgutil.h, secasn1.h, secasn1t.h, seccomon.h, secder.h, secdert.h, secdig.h, secdigt.h, secitem...
...And 3 more matches
Shell global objects
n the same zone as the given object (defaults to a new zone) invisibletodebugger the global will be invisible to the debugger (default false) principal if present, its value converted to a number must be an integer that fits in 32 bits; use that as the new compartment's principal. shell principals are toys, meant only for testing; one shell principal subsumes another if its set bits are a superset of the other's. thus, a principal of 0 subsumes nothing, while a principals of ~0 subsumes all other principals. the absence of a principal is treated as if its bits were 0xffff, for subsumption purposes. if this property is omitted, supply no principal. createmappedarraybuffer(filename, [offset, [size]]) create an array buffer that mmaps the given file. addpromisereactions(promise, o...
... objectemulatingundefined() return a new object obj for which typeof obj === "undefined", obj == null and obj == undefined (and vice versa for !=), and toboolean(obj) === false. iscachingenabled() return whether js caching is enabled. ...
...ntent. the cache entry is filled and read by the evaluate function by using it in place of the source, and by setting savebytecode and loadbytecode options. printprofilerevents() register a callback with the profiler that prints javascript profiler events to stderr. callback is only registered if profiling is enabled. enablesinglestepprofiling() this function will fail on platforms that don't support single-step profiling (currently everything but arm-simulator). when enabled, at every instruction a backtrace will be recorded and stored in an array. adjacent duplicate backtraces are discarded. disablesinglestepprofiling() return the array of backtraces recorded by enablesinglestepprofiling. enablespsprofiling() enables sps instrumentation and corresponding assertions, with slow assert...
...And 3 more matches
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
t constructor and copy constructor no yes yes* no can hold objects directly, in which case it owns them. when holding pointers, doesn't own the pointer. nsautotarray<t,n> any that has a default constructor and copy constructor no yes yes* yes can hold objects directly, in which case it owns them. when holding pointers, doesn't own the pointer. nsisupportsarray xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const. for example: // handlelist cannot modify the array because of const void handlelist(const nstarray<t>&); in-place enumeration most of the arrays presented here provide callback-style means to enumerate members of an array. instea...
... position in the array. enumerators are used to access the elements in an ordered way, without relying on the underlying array type. these enumerators include: nsisimpleenumerator - an enumerator for com objects. nsistringenumerator / nsiutf8stringenumerator - enumerators for strings obsolete arrays / enumerators there are some deprecated classes which should not be used by new code. nsisupportsarray - obsoleted by nsiarray and nsimutablearray, use those instead. nsienumerator - obsoleted by nsisimpleenumerator, use that instead. nsibidirectionalenumerator - obsoleted by nsisimpleenumerator, use that instead. which array should i use? do not use nsisupportsarray; it is deprecated. does your array need to be scriptable? if so, use nsiarray. example: an array attribute in...
...lls the same method on each member: void notifyobservers(const nscomarray<nsimyobserver>& observers) { // using [] doesn't leak! for (print32 i = observers.count() - 1; i >= 0 ; i--) observers[i]->observe(); } be careful with this though, you could end up with a weak pointer if you're converting from non-nscomarray code. ...
...And 3 more matches
nsICachingChannel
for example a http form submission. ...
...for example a http form submission. ...
...for example a http form submission. ...
...And 3 more matches
nsICategoryManager
xpcom/components/nsicategorymanager.idlscriptable this interface provides access to a data structure that holds a list of name-value pairs, called categories, where each value is a list of strings. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/categorymanager;1. to use this service, use: var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); method overview string addcategoryentry(in string acategory, in string aentry, in string avalue, in boolean apersist, in boolean areplace); void deletecategory(in string acategory); void deletecategoryentry(in string acategory, in st...
...e created if they do not exist. string addcategoryentry( in string acategory, in string aentry, in string avalue, in boolean apersist, in boolean areplace ); parameters acategory the name of the category being modified. ("protocol") aentry the name of the category entry being modified. ("http") avalue the value for the category entry. ("moz.httprulez.1") apersist no longer supported. category entries never persist across application sessions. you must pass false for this parameter. areplace a flag indicating whether or not to overwrite the value of an existing category entry. return value the previous value for the given category entry (if any). exceptions thrown ns_error_invalid_arg this error is returned if areplace is false and the category entry already h...
...ategory being modified. ("protocol") aentry the name of the category entry being deleted. ("http") apersist ignored. category entries never persist across sessions. you should always pass false for this parameter. enumeratecategories() enumerate all existing categories. nsisimpleenumerator enumeratecategories(); parameters none. return value a simple enumerator, each result qis to nsisupportscstring. enumeratecategory() enumerate the entries in a category. nsisimpleenumerator enumeratecategory( in string acategory ); parameters acategory the category to be enumerated. return value a simple enumerator, each result qis to nsisupportscstring. getcategoryentry() get the value for the given category's entry. string getcategoryentry( in string acategory, in string ...
...And 3 more matches
nsIComponentManager
xpcom/components/nsicomponentmanager.idlscriptable this interface provides methods to access factory objects and instantiate instances of classes. ...
...ptable this interface provides methods to access factory objects and instantiate instances of classes. ...
...rits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void addbootstrappedmanifestlocation(in nsilocalfile alocation); void createinstance(in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void createinstancebycontractid(in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobject(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobjectbycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void removebootstrappedmanifestlocation(in nsilocalfile alocation); ...
...And 3 more matches
nsILoginManager
implemented by: @mozilla.org/login-manager;1. ...
... note: de...
...oking for logins that might be applicable to a given form or authentication request. void findlogins( out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array. javascript callers can simply use the array's length property and supply a dummy argument for this parameter. ahostname the hostname to restrict searches to, formatted as a url. for example, "http://www.bar.com". aactionurl for form logins, this parameter should specify the url to which the form will be submitted. for protocol logins, specify null. an empty string ("") will match any value (except null). ahttprealm for protocol logins, specify the http realm ...
...And 3 more matches
nsIMutableArray
e effect of insertelementat(). conversely, if insertelementat() is never used, and null elements are never explicitly added to the array, then it is guaranteed that nsiarray.queryelementat() will never return a null value. any of these methods may throw ns_error_out_of_memory when the array must grow to complete the call, but the allocation fails. method overview void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long index, in boolean weak); void removeelementat(in unsigned long index); void replaceelementat(in nsisupports element, in unsigned long index, in boolean weak); methods appendelement() append an element at the end of the array. void appendelement( ...
...element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long index, in boolean weak); void removeelementat(in unsigned long index); void replaceelementat(in nsisupports element, in unsigned long index, in boolean weak); methods appendelement() append an element at the end of the array. void appendelement( in nsisupports element, in boolean weak ); parameters element the element to append. weak whether or not to store the element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. clear() clear the entire array, releasing all stored objects. void clear(); parameters none. insertelemen...
... index the position in the array: if the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up. ...
...And 3 more matches
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable provides an interface to implement when you have code that converts data from one type to another. inherits from: nsistreamlistener last changed in gecko 1.7 suppose you had code that converted plain text into html. you could implement this interface to allow everyone else to use your conversion logic using a standard api. stream converter users there are currently two ways to use a stream converter: synchronous: stream to stream. ...
...ode that converts data from one type to another. inherits from: nsistreamlistener last changed in gecko 1.7 suppose you had code that converted plain text into html. you could implement this interface to allow everyone else to use your conversion logic using a standard api. stream converter users there are currently two ways to use a stream converter: synchronous: stream to stream. you can supply the service with a stream of type x and it will convert it to your desired output type and return a converted (blocking) stream to you. asynchronous: nsistreamlistener to nsistreamlistener. you can supply data directly to the converter by calling it's nsistreamlistener.ondataavailable() method. it will then convert that data from type x to your desired output type and return converted data to...
...first of all the stream converter implementation must register itself with the component manager using a contractid in the format below. second, the stream converter must add the contractid to the registry. ...
...And 3 more matches
nsITreeView
further information about creating treeviews is given in the xul tutorial. ...
...long index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long index); obsolete since gecko 1.8 void cyclecell(in long row, in nsitreecolumn col); void cycleheader(in nsitreecolumn col); void drop(in long row, in long orientation, in nsidomdatatransfer datatransfer); astring getcellproperties(in long row, in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getcelltext(in long row, in nsitreecolumn col); astring getcellvalue(in long row, in nsitreecolumn col); astring getcolumnproperties(in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getimagesrc(in long row, in nsitreecolumn col); long getlevel(in long index); ...
...lumn col); astring getcolumnproperties(in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getimagesrc(in long row, in nsitreecolumn col); long getlevel(in long index); long getparentindex(in long rowindex); long getprogressmode(in long row, in nsitreecolumn col); astring getrowproperties(in long index, in nsisupportsarray properties obsolete since gecko 22); boolean hasnextsibling(in long rowindex, in long afterindex); boolean iscontainer(in long index); boolean iscontainerempty(in long index); boolean iscontaineropen(in long index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); ...
...And 3 more matches
XUL Overlays
Mozilla › Tech › XUL › Overlays
ays overlays are xul files used to describe extra content in the ui. though overlays often define ui elements that have been added as a result of an update or enhancement of some kind, they can be used in many different ways. overlays provide a general mechanism for: adding ui for additional components, as described in the example above overriding small pieces of a xul file without having to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document. though there is no formal restriction on what kind of xul content is located in "base" xul files and what kind should be put in overlays, xul overlays generally define items that are not present in the basic versions of the ui, such as additional components. when plug-i...
...se elements should be defined in overlay files. the installation of a media plug-in, for example, may add new icons and menu items to the interface: in the navigatoroverlay.xul file or in a separate navigatorsspoverlay.xul file (where navigator.xul defines the basic ui for the navigator package), these new plug-in elements would be defined as a collection of elements or subtrees: <menuitem name="super stream player"/> <menupopup name="ss favorites"> <menuitem name="wave" src="mavericks.ssp"/> <menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute. thus, given the following base: ...
...ew"/> <menuitem name="open"/> <menuitem name="save"/> <menuitem name="close"/> </menupopup> </menu> ... and given the following overlay: <?xml version="1.0"?> <overlay id="singleitemex" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="menu_filepopup"> <menu id="file_menu"> <menuitem name="super stream player"/> </menu> </menupopup> </overlay> the result will be: ... <menu id="file-menu"> <menupopup id="menu_filepopup"> <menuitem name="new"/> <menuitem name="open"/> <menuitem name="save"/> <menuitem name="close"/> <menuitem name="super stream player"/> </menupopup> </menu> ... if you are developing a mozilla extension, note that the id namespace is shared by all the exte...
...And 3 more matches
The libmime module
.h" and "mimetext.c".) each header file follows the following boiler-plate form: typedefs these come first to avoid circular dependencies. typedef struct foobarclass foobarclass; typedef struct foobar foobar; class declaration theis structure defines the callback routines and other per-class data of the class defined in this module. struct foobarclass { parentclass superclass; ...any callbacks or class-variables... }; class definition this variable holds an instance of the one-and-only class record; the various instances of this class point to this object. (one interrogates the type of an instance by comparing the value of its class pointer with the address of this variable.) extern foobarclass foobarclass; instance declaration theis struc...
... struct foobar { parent parent; ...any instance variables... }; then, in the corresponding .c file, the following structure is used: class definition first we pull in the appropriate include file (which includes all necessary include files for the parent classes) and then we define the class object using the mimedefclass macro: #include "foobar.h" #define mime_superclass parentlclass mimedefclass(foobar, foobarclass, foobarclass, &mime_superclass); the definition of mime_superclass is just to move most of the knowlege of the exact class hierarchy up to the file's header, instead of it being scattered through the various methods; see below. method declarations we will be putting function pointers into the class object, so we declare them here. they...
... class-initialization function having been run first.) each class object will only be initialized once. static int foobarclassinitialize(foobarclass *class) { class->method = foobarmethod. ...etc... } method definitions next come the definitions of the methods we referred to in the class-init function. the way to access earlier methods (methods defined on the superclass) is to simply extract them from the superclass's object. but note that you cannot get at methods by indirecting through object->class->superclass: that will only work to one level, and will go into a loop if some subclass tries to continue on this method. the easiest way to do this is to make use of the mime_superclass macro that was defined at the top of the file, as shown below. the al...
...And 3 more matches
AudioContext.baseLatency - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
AudioContext.getOutputTimestamp() - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...browser-compat-data and send us a pull request. ...
...And 3 more matches
CSSStyleRule.selectorText - Web APIs
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
DOMException() - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...'d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...meedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdomexception() constructorchrome full support yesedge full support 79firefox ? ie ? opera full support yessafari ? webview android full support yeschrome android full support yesfirefox android ? opera android full support yessafari ios ? samsu...
...And 3 more matches
DataTransferItem.webkitGetAsEntry() - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
DirectoryEntrySync - Web APIs
ctory. example the getfile() method returns a fileentrysync, which represents a file in the file system. the following creates an empty file called seekrits.txt in the root directory. var fileentry = fs.root.getfile('seekrits.txt', {create: true}); the getdirectory() method returns a directoryentrysync, which represents a file in the file system. ...
...sents a file in the file system. the following creates an empty file called seekrits.txt in the root directory. var fileentry = fs.root.getfile('seekrits.txt', {create: true}); the getdirectory() method returns a directoryentrysync, which represents a file in the file system. the following creates a new directory called superseekrit in the root directory. ...
...false (exclusive is ignored) path doesn't exist an error is thrown. create: false (exclusive is ignored) path exists, but is a directory an error is thrown. returns fileentrysync represents a file in a file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the path supplied is invalid. not_found_err the path was structurally correct, but refers to a resource that does not exist. no_modification_allowed_err this is a permission issue. the target directory or file is not writable. path_exists_err the file already exists. you cannot create another one with the same path. quota_exceeded_error the operation would c...
...And 3 more matches
DirectoryReaderSync - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...lechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdirectoryreadersync non-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support ...
...And 3 more matches
Document - Web APIs
Web › API › Document
opens a document stream for writing. document.querycommandenabled() returns true if the formating command can be executed on the current range. document.querycommandindeterm() returns true if the formating command is in an indeterminate state on the current range. document.querycommandstate() returns true if the formating command has been executed on the current range. document.querycommandsupported() returns true if the formating command is supported on the current range. document.querycommandvalue() returns the current value of the current range for a formating command. document.write() writes text in a document. document.writeln() writes a line of text in a document. methods included from documentorshadowroot the document interface includes the following methods defined on...
... documents. document.querycommandtext()obsolete since gecko 14 this method never did anything but throw an exception, and was removed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11). internet explorer notes microsoft defines some non-standard properties: document.filesize* returns size in bytes of the document. ...
...ince gecko 14 this method never did anything but throw an exception, and was removed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11). internet explorer notes microsoft defines some non-standard properties: document.filesize* returns size in bytes of the document. starting with internet explorer 11, that property is no longer supported. see msdn. ...
...And 3 more matches
Element.currentStyle - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Element.runtimeStyle - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Element.scrollLeftMax - Web APIs
ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileEntrySync - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...opmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfileentrysync non-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support ...
...And 3 more matches
FileReaderSync.readAsArrayBuffer() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileReaderSync.readAsDataURL() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileReaderSync.readAsText() - Web APIs
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystem.name - Web APIs
Web › API › FileSystem › name
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystem.root - Web APIs
Web › API › FileSystem › root
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemEntry.getParent() - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemEntry.isDirectory - Web APIs
g whether or not the filesystementry is a directory. example this example shows how this property might be used to determine whether to process the entry as a directory or file. if the entry is neither, an error handler is called with an appropriate message. if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isdirectory' in that specification. draft initial specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out http...
...ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemEntry.name - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FileSystemFileEntry.file() - Web APIs
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...eck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
FontFaceSetLoadEvent.fontfaces - Web APIs
atibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLAnchorElement.referrerPolicy - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLAreaElement.referrerPolicy - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLElement.offsetParent - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLElement.offsetTop - Web APIs
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLIFrameElement.referrerPolicy - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLImageElement.referrerPolicy - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLInputElement.webkitEntries - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLInputElement.webkitdirectory - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...m/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLMediaElement.controlsList - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...opmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontrolslistchrome full support 58edge full support ≤79firefox ? ie ? opera full support 45safari ? webview android full support 58chrome android full support 58firefox android ? opera android full support 43safari ios ? samsung i...
...And 3 more matches
HTMLMediaElement.onencrypted - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ed data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLMediaElement.setMediaKeys() - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
HTMLSlotElement.assignedElements() - Web APIs
ty table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
History.back() - Web APIs
Web › API › History › back
tibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
History.forward() - Web APIs
Web › API › History › forward
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
History.scrollRestoration - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
IDBTransaction.commit() - Web APIs
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
InputEvent.dataTransfer - Web APIs
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
MediaCapabilitiesInfo - Web APIs
the mediacapabilitiesinfo interface of the media capabilities api is made available when the promise returned by the mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, providing information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient. properties the mediacapabilitiesinfo interface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all? if yes, supported is true. otherwise, it is false. smooth: given the properties defined in the mediaconfiguration, ...
...properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all? ...
... is false. smooth: given the properties defined in the mediaconfiguration, will the playback of the specified piece of media be high quality? will it be smooth? if supported is true, and playback will be smooth, smooth is true, otherwise, is it false. powerefficient: given the properties defined in the mediaconfiguration, will the playback of the specified piece of media be power efficient? if supported is true, and playback will be power efficient, powerefficient is true, otherwise, is it false. browsers will report a supported media configuration as smooth and powerefficient until stats on this device have been recorded. all supported audio codecs are reported to be power efficient. example // mediaconfiguration to be tested const mediaconfig = { type : 'file', audio : { ...
...And 3 more matches
Transcoding assets for Media Source Extensions - Web APIs
when working with media source extensions, it is likely that you need to condition your assets before you can stream them. this article takes you through the requirements and shows you a toolchain you can use to encode your assets appropriately. getting started the first and most important step is to ensure that your files are comprised of a container and codec that users' browsers support. depending on the codec, you might need to fragment the file to comply with the iso bmff spec. (optional) if you decide to use dynamic adaptive streaming over http (dash) for adaptive bitrate streaming, you need to transcode your assets into multiple resolutions. most dash clients expect a corresponding media presentation description (mpd) manifest file, which is typically generated while gene...
...these installed successfully before moving to the next step. sample media should be placed in the bento4 utils directory and worked here. note: the prebuilt ffmpeg does not include libfdk_aac due to licensing reasons. bento4 uses this by default, so you need to compile ffmpeg if necessary. if you don't need it, add --audio-codec=aac to the mp4-dash-encode.py command line. ...
...in the bento4 utils directory and worked here. note: the prebuilt ffmpeg does not include libfdk_aac due to licensing reasons. bento4 uses this by default, so you need to compile ffmpeg if necessary. if you don't need it, add --audio-codec=aac to the mp4-dash-encode.py command line. container and codec support as specified in section 1.1 of the mse spec: goals, mse is designed not to require support for any particular media format or codec. ...
...And 3 more matches
Metadata.modificationTime - Web APIs
this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...compat-data and send us a pull request. ...
...And 3 more matches
Metadata.size - Web APIs
Web › API › Metadata › size
ty table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
OfflineAudioCompletionEvent.renderedBuffer - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
PaymentRequest: shippingaddresschange event - Web APIs
(since if they choose to have you ship products to them, you'll need their address). example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application. ...
...ss). example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application. ...
...e event is set up to validate that the address meets requirements set by the web application. const paymentrequest = new paymentrequest(methoddata, details, options); paymentrequest.addeventlistener("shippingaddresschange", event => { let detailsupdate = checkaddress(paymentrequest.shippingaddress); event.updatewith(detailsupate); }, false); const checkaddress = theaddress => { let detailsupdate = {}; // check the address, return a paymentdetailsupdate object // with any changes or errors. ...
...And 3 more matches
PaymentRequest.show() - Web APIs
request's show() method has been called, any other call to show() will by rejected with an aborterror until the returned promise has been concluded, either by being fulfilled with a paymentresponse indicating the results of the payment request, or by being rejected with an error. note: in reality, despite the fact that the specification says this can't be done, some browsers, including firefox, support multiple active payment requests at a time. if your architecture doesn't necessarily have all of the data ready to go at the moment it instantiates the payment interface by calling show(), specify the detailspromise parameter, providing a promise that is fulfilled once the data is ready. if this is provided, show() will not allow the user to interact with the payment interface until the pro...
...results are validated and so forth. syntax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can provide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it. the promise should resolve with a paymentdetailsupdate object containing the updated information. return value a promise that eventually resolves with a paymentresponse. the promise is resolved when the user accepts the payment request (such as by clicking a "pay" button in the browser's payment sheet). exceptions aborterror the returned promise rejects with an aborterror if the user agent is already showing a payment panel. only one pa...
...owing a payment panel. only one payment panel may be visible at a time across all documents loaded by the user agent. the promise is also rejected with aborterror if the user cancels the payment request. invalidstateerror the promise rejects with an invalidstateerror if the same payment has already been shown for this request (its state is interactive because it is being shown already). notsupportederror the promise rejects with a notsupportederror if the user agent does not support the payment methods specified when the paymentrequest constructor was called. securityerror the promise rejects with a securityerror if the call to show() was not in response to a user action, such as a click or keyup event. other reasons a securityerror may be thrown are at the discretion of the user ag...
...And 3 more matches
Using Performance Timeline - Web APIs
the standard also includes interfaces that allow an application to be notified when specific performance events occur. together, these interfaces can be used to help identify an application's performance bottlenecks. performance extensions performance timeline extends the performance object with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria. the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). ...
...<br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === undefined) { log("... ...
...the following examples show the use of this method. ...
...And 3 more matches
PushSubscription.expirationTime - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ttps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
PushSubscription.subscriptionId - Web APIs
the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
RTCRtpReceiver.track - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
SVGAElement.target - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
SVGAnimatedString.baseVal - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
SVGImageElement.decoding - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...r androidopera for androidsafari on iossamsung internetdecoding experimentalchrome full support 65edge full support ≤79firefox ? ie ? opera ? safari ? webview android full support 65chrome android full support 65firefox android ? opera android ? safari ios ? ...
...And 3 more matches
SVGStylable - Web APIs
ge is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...roid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgstylablechrome ? edge full support ≤18firefox ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? ...
...safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...And 3 more matches
SVGTransformable - Web APIs
generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgtransformablechrome ? edge full support ≤18firefox ? ie ? opera ? safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? ...
...safari ? webview android no support nochrome android ? firefox android ? opera android ? safari ios ? samsung internet android ? ...
...And 3 more matches
ScreenOrientation.angle - Web APIs
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
ScreenOrientation.lock() - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
ScreenOrientation.onchange - Web APIs
ity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
ScreenOrientation.type - Web APIs
ibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
ScreenOrientation.unlock() - Web APIs
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
ServiceWorkerRegistration.navigationPreload - Web APIs
y table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
UIEvent.initUIEvent() - Web APIs
ble on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...rowser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.hash - Web APIs
he compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethash experimentalchrome no support noedge no support nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded. this has been fixed to match the spec.ie ...
... noedge no support nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded. ...
... nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded. ...
...And 3 more matches
URLUtilsReadOnly.host - Web APIs
he compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.hostname - Web APIs
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.href - Web APIs
he compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.origin - Web APIs
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.pathname - Web APIs
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.port - Web APIs
he compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.protocol - Web APIs
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.search - Web APIs
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
URLUtilsReadOnly.toString() - Web APIs
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...//github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Fundamentals of WebXR - Web APIs
hardware such as vr headsets and glasses with integrated augmented reality features. this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement. webxr additionally provides support for accepting inputs from control devices such as handheld vr controllers or specialized mixed reality gamepads. webxr is not a rendering technology, and provides no features for actually managing 3d data or rendering it to the display. this is an important fact to keep in mind; while webxr manages the timing, scheduling, and the various points of view relevant when drawing the scene, it doe...
...is entirely up to you. fortunately, webgl and the various webgl-based frameworks and libraries are available to make it much easier to deal with all of that. how is webxr different from webvr? webvr was generally considered to be an experimental api designed to help specification writers determine the best approaches to creating an api for virtual reality on the web. ...
...roaches to creating an api for virtual reality on the web. as browser developers built support for webvr and allowed developers to experiment, it became clear that in order to finish an api for virtual environments on the web, it would make more sense to start a new specification than to try to "fix" webvr. thus, webxr was created. the most obvious difference, at the highest level, is that webxr supports not just virtual reality applications, but also augmented reality, which blends virtual objects with the user's true physical environment. another key difference is that webxr has integrated support for the advanced input controllers that are used with most mixed reality headsets, while webvr relied on the gamepad api to support the controllers. in webxr, the primary select and squeeze acti...
...And 3 more matches
Window.devicePixelRatio - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Window.stop() - Web APIs
Web › API › Window › stop
tibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tructured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Using XMLHttpRequest - Web APIs
into sending binary data. these involve utilizing the overridemimetype() method on the xmlhttprequest object and is a workable solution. var oreq = new xmlhttprequest(); oreq.open("get", url); // retrieve data unprocessed as a binary string oreq.overridemimetype("text/plain; charset=x-user-defined"); /* ... */ however, more modern techniques are available, since the responsetype attribute now supports a number of additional content types, which makes sending and receiving binary data much easier. for example, consider this snippet, which uses the responsetype of "arraybuffer" to fetch the remote content into a arraybuffer object, which stores the raw binary data. var oreq = new xmlhttprequest(); oreq.onload = function(e) { var arraybuffer = oreq.response; // not responsetext /* ...
... // not responsetext /* ... */ } oreq.open("get", url); oreq.responsetype = "arraybuffer"; oreq.send(); for more examples check out the sending and receiving binary data page monitoring progress xmlhttprequest provides the ability to listen to various events that can occur while the request is being processed. this includes periodic progress notifications, error notifications, and so forth. support for dom progress event monitoring of xmlhttprequest transfers follows the specification for progress events: these events implement the progressevent interface. the actual events you can monitor to determine the state of an ongoing transfer are: progress the amount of data that has been retrieved has changed. load the transfer is complete; all data is now in the response var oreq = ne...
...axsubmit - the form is now serialized. ...
...And 3 more matches
ARIA: textbox role - Accessibility
a <textarea> element for multi-line input. description 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. the default is a single line input, in which return or enter submits the form; in this case, it is preferable to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. <!-- simple text input field --> <div id="txtboxlabel">enter your five-digit zipcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="t...
... <label for="txtbox">enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" id="txtbox"/> <!-- multi-line text area --> <label for="txtboxmultiline">enter the tags for the article</label> <textarea id="txtboxmultiline" required></textarea> where a text field is read-only, indicated this by setting aria-readonly="true" on the element. ...
...obox, focus may remain on the textbox while the value of aria-activedescendant on the textbox element refers to a descendant of a popup listbox that is controlled by the textbox.this attribute must be updated programmatically as the focus changes. aria-autocomplete attribute indicates whether and how the user's input into the field could trigger display of a prediction of the intended value. it supports the following values: inline: predicted text is inserted after the caret. list: predicted text is presented as a collection of values. both: predicted text is presented as a collection of values, with the text needed to complete one value inserted after the caret. none (default): predicted text is not offered. if list or both is set, the aria-controls and aria-haspopup attribut...
...And 3 more matches
:link - CSS: Cascading Style Sheets
Web › CSS › :link
bility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
xis. the reason that the box alignment properties remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types. there is a note in the flexbox spec stating that in the future, once it is completed, the definitions in box alignment level 3 will supersede those of flexbox: "note: while the alignment properties are defined in css box alignment [css-align-3], flexible box layout reproduces the definitions of the relevant ones here so as to not create a normative dependency that may slow down advancement of the spec. these properties apply only to flex layout until css box alignment level 3 is finished and defines their effect for other layou...
...vant ones here so as to not create a normative dependency that may slow down advancement of the spec. these properties apply only to flex layout until css box alignment level 3 is finished and defines their effect for other layout modes. additionally, any new values defined in the box alignment module will apply to flexible box layout; in otherwords, the box alignment module, once completed, will supercede the definitions here." in a later article in this series — aligning items in a flex container — we will take a thorough look at how the box alignment properties apply to flex items. the gap properties a recent addition to the box alignment specification has been the row-gap and column-gap properties, along with the shorthand gap. these properties were initially defined in the css gr...
...r that they can be used in all layout methods — this will ultimately include flexbox. until browsers implement the gap properties for flexbox, margins have to be used to create gaps between items. writing modes in the basic concepts of flexbox article, i explained that flexbox is writing mode aware. writing modes are fully detailed in the css writing modes specification, which details how css supports the various different writing modes that exist internationally. we need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out in our document. understanding block and inline directions is key to new layout methods. it is worth noting that we might want to change the writing mode of our document for reasons other than publishing c...
...And 3 more matches
OpenType font features guide - CSS: Cascading Style Sheets
okoro (all available and free to use, most are on google fonts and other services). kerning (font-kerning) this refers to the spacing between specific glyph pairings. this is generally on by default (as recommended by the opentype specification). it should be noted that if letter-spacing is also set on your text, that is applied after kerning. alternates (font-variant-alternates) fonts can supply a number of different alternatives for various glyphs, such as different styles of lower case 'a' or more or less elaborate swashes in a script typeface. this property can activate an entire set of alternates or just a specific one, depending on the values supplied.the example below is showing several different aspects of working with alternate characters. fonts with alternate glyphs can make ...
...ures', 'historical ligatures', and 'contextual alternates'. while these last ones are not technically ligatures, they are generally similar in that they replace specific combinations of letters when they appear together. while more common in script typefaces, in the below example they are used to create arrows: position (font-variant-position) position variants are used to enable typographic superscript and subscript glyphs. these are designed to work with the surrounding text without altering the baseline or line spacing. this is one of the key benefits over using the <sub> or sup elements. capitals (font-variant-caps) one of the more common use cases for opentype features is proper small caps. these are capital letters sized to fit better amongst lower case letters and are generall...
...to be used inline with copy so the numerals visually blend with the surrounding glyphs in a similar fashion to small caps. there is also the notion of spacing. proportional spacing is the normal setting, whereas tabular spacing lines up numerals evenly regardless of character width, making it more appropriate for lining up tables of numbers in financial tables. there are two types of fractions supported through this property: diagonal slashed fractions. vertically stacked fractions. ordinals are also supported (such as '1st' or '3rd'), as is a slashed zero if present in the font. lining and oldstyle figures fractions, ordinals, and slashed zero east asian (font-variant-east-asian) this allows access to various alternate forms of glyphs within a font. the example below shows a...
...And 3 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
these extensions are prefixed with -moz-. mozilla-only properties and pseudo-classes (avoid using on websites) note: these properties and pseudo-classes will only work in mozilla applications such as firefox, and are not on a standards track. some of them apply only to xul elements. ...
... [prefixed version still accepted] -moz-animation-play-state [prefixed version still accepted] -moz-animation-timing-function [prefixed version still accepted] -moz-appearance b -moz-backface-visibility [prefixed version still accepted] -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 ver...
...zeobsolete 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-border-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 accepted] c clip-path [ap...
...And 3 more matches
border-bottom-width - CSS: Cascading Style Sheets
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
border-left-style - CSS: Cascading Style Sheets
compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-left-stylechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. this has been fixed in...
...dge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
...efox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid. ...
...And 3 more matches
border-left - CSS: Cascading Style Sheets
y the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
border-right - CSS: Cascading Style Sheets
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...red data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
border-top - CSS: Cascading Style Sheets
ty the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
direction - CSS: Cascading Style Sheets
Web › CSS › direction
ty the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ut https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
empty-cells - CSS: Cascading Style Sheets
y the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
orphans - CSS: Cascading Style Sheets
Web › CSS › orphans
lity the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
outline-offset - CSS: Cascading Style Sheets
the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...tps://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
paint() - CSS: Cascading Style Sheets
Web › CSS › paint
ility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...uctured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...k out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
right - CSS: Cascading Style Sheets
Web › CSS › right
ibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ck out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
<acronym> - HTML: Hypertext Markup Language
Web › HTML › Element › acronym
y table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dn/browser-compat-data and send us a pull request. ...
...And 3 more matches
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
e browser may opt to provide stepper arrows to let the user increase and decrease the value using their mouse or by simply tapping with a fingertip. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. on browsers that don't support inputs of type number, a number input falls back to type text. value any floating-point number, or empty. events change and input supported common attributes autocomplete, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. yo...
...te, list, placeholder, readonly idl attributes list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. ...
...s list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. ...
...And 3 more matches
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-formatted url before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. ...
...form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. on browsers that don't support inputs of type url, a url input falls back to being a standard text input. value a domstring representing a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax. mo...
...roperly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. ...
...And 3 more matches
Expressions and operators - JavaScript
defined. to actually manipulate the array, use the various array methods such as splice. typeof the typeof operator is used in either of the following ways: typeof operand typeof (operand) the typeof operator returns a string indicating the type of the unevaluated operand. operand is the string, variable, keyword, or object for which the type is to be returned. the parentheses are optional. ...
...l expressions in javascript. left-hand-side expressions: left values are the destination of an assignment. primary expressions basic keywords and general expressions in javascript. this use the this keyword to refer to the current object. in general, this refers to the calling object in a method. ...
...edence // addition before multiplication (a + b) * c // 9 // which is equivalent to a * c + b * c // 9 left-hand-side expressions left values are the destination of an assignment. ...
...And 3 more matches
Introduction - JavaScript
s). inside a host environment (for example, a web browser), javascript can be connected to the objects of its environment to provide programmatic control over them. javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements. core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom). for example, client-side extensions allow an application to place elements on an html form and respond to user events such as mouse clicks, form input, and page navigation. server-side javascript extends the core lan...
...for example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server. ...
...amentally different in some others. the javascript language resembles java but does not have java's static typing and strong type checking. javascript follows most java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from livescript to javascript. ...
...And 3 more matches
constructor - JavaScript
es you to provide any custom initialization that must be done before any other methods can be called on an instantiated object. ...
... } const otto = new person('otto'); otto.introduce(); if you don't provide your own constructor, then a default constructor will be supplied for you. ...
...w error; } } the validationerror class doesn't need an explicit constructor, because it doesn't need to do any custom initialization. the default constructor then takes care of initializing the parent error from the argument it is given. ...
...And 3 more matches
WebAssembly.Global() constructor - JavaScript
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ike to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...dn/browser-compat-data and send us a pull request. ...
...And 3 more matches
WebAssembly.compileStreaming() - JavaScript
ty table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../mdn/browser-compat-data and send us a pull request. ...
...And 3 more matches
WebAssembly.instantiateStreaming() - JavaScript
able on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../browser-compat-data and send us a pull request. ...
...And 3 more matches
Strict mode - JavaScript
you'll see the default, non-strict mode referred to as "sloppy mode". this isn't an official term, but be aware of it, just in case. javascript's strict mode, introduced in ecmascript 5, is a way to opt in to a restricted variant of javascript, thereby implicitly opting-out of "sloppy mode". strict mode isn't just a subset: it intentionally has different semantics from normal code. browsers not supporting strict mode will run strict mode code with different behavior from browsers that do, so don't rely on strict mode without feature-testing for support for the relevant aspects of strict mode. strict mode code and non-strict mode code can coexist, so scripts can opt into strict mode incrementally. strict mode makes several changes to normal javascript semantics: eliminates some javascrip...
...cessible. still, this hiding makes little sense and is probably undesirable (it might hide a typo, for example), so in strict mode duplicate argument names are a syntax error: function sum(a, a, c) { // !!! syntax error 'use strict'; return a + a + c; // wrong if this code ran } sixth, a strict mode in ecmascript 5 forbids octal syntax. the octal syntax isn't part of ecmascript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%". in ecmascript 2015 octal number is supported by prefixing a number with "0o". i.e. var a = 0o10; // es2015: octal novice developers sometimes believe a leading zero prefix has no semantic meaning, so they use it as an alignment device — but this changes the number's meaning! a leading zero synta...
...the original arguments when the function was invoked. arguments[i] does not track the value of the corresponding named argument, nor does a named argument track the value in the corresponding arguments[i]. function f(a) { 'use strict'; a = 42; return [a, arguments[0]]; } var pair = f(17); console.assert(pair[0] === 42); console.assert(pair[1] === 17); third, arguments.callee is no longer supported. in normal code arguments.callee refers to the enclosing function. this use case is weak: simply name the enclosing function! moreover, arguments.callee substantially hinders optimizations like inlining functions, because it must be made possible to provide a reference to the un-inlined function if arguments.callee is accessed. arguments.callee for strict mode functions is a non-deletable p...
...And 3 more matches
<mmultiscripts> - MathML
pends on the dimensionality of a representative array. for example, a number is a 0-dimensional array, or a 0th-order tensor. a 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. to learn more about the mathematical background of tensors refer to the entry on wikipedia. mathml uses a special syntax to describe subscripts and superscripts for both, postscripts and prescripts, attached to a base expression: <mmultiscripts> base (subscript superscript)* [ <mprescripts/> (presubscript presuperscript)* ] </mmultiscripts> after the base expression you can specify a postsubscript and a postsuperscript. prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is...
...ef used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. subscriptshift the minimum space by which to shift the subscript below the baseline of the expression, as a css length. this property is deprecated and will be removed in the future. superscriptshift the minimum space by which to shift the superscript above the baseline of the expression, as a css length. this property is deprecated and will be removed in the future. examples using <mprescripts/> sample rendering: rendering in your browser: x d c b a <math> <mmultiscripts> <mi>x</mi> <!-- base expression --> <mi>d</mi> <!-- postsub...
...to shift the superscript above the baseline of the expression, as a css length. this property is deprecated and will be removed in the future. ...
...And 3 more matches
Media type and format guide: image, audio, and video content - Web media technologies
Web › Media › Formats
since nearly its beginning, the web has included support for some form of visual media presentation. originally, these capabilities were limited, and were expanded organically, with different browsers finding their own solutions to the problems around including still and video imagery on the web. the modern web has powerful features to support the presentation and manipulation of media, with several media-related apis supporting various types of content. generally, the media formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a web developer. this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web. ...
...resentation and manipulation of media, with several media-related apis supporting various types of content. generally, the media formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a web developer. this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web. it also provides browser support information for various combinations of these, and suggestions for prioritization of formats, as well as which formats excel at specific types of content. ...
...rk of a web developer. this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web. it also provides browser support information for various combinations of these, and suggestions for prioritization of formats, as well as which formats excel at specific types of content. references images image file type and format guide covers support of image file types and content formats across the major web browsers, as well as providing basic information about each type: benefits, limitations, and use cases of interest to web designers and developers. image file types for web designers fundamental information about the various image file types that may be useful for web designers, including best practices and use cases for each type...
...And 3 more matches
Add to Home screen - Progressive web apps (PWAs)
dvantage of it. why a2hs? a2hs is thought to be part of the progressive web app philosophy — giving web apps the same user experience advantages as native apps so they can compete in today's ecosystem wars. part of this is the simple gesture of accessing an app by tapping its icon on your home screen, and then having it appear neatly in its own window. a2hs makes this possible. what browsers support a2hs? a2hs is supported in all mobile browsers, except ios webview. it's also supported in some chromium desktop browsers. firefox has had mobile support since v58 and is working on desktop support. see caniuse.com for exact details. how do you use it? we've written a very simple example web site (see our demo live, and also see the source code) that doesn't do much, but was developed wi...
...hould be placed somewhere inside your app directory (in the root is probably best) with the name somefilename.webmanifest (we've chosen manifest.webmanifest). it contains multiple fields that define certain information about the web app and how it should behave. note: the .webmanifest extension is specified in the media type registration section of the specification, but generally browsers will support manifests with other appropriate extensions, e.g. .json. the fields needed for a2hs are as follows: background_color: specifies a background color to be used in some app contexts. the most relevant one to a2hs is the splash screen displayed when the app icon on the home screen is tapped and it first starts to load (this currently appears only when apps have been added to the home screen ...
...url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app. you can include more sizes if you want; android will choose the most appropriate size for each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp format). note that the type member in each icon's object specifies the icon's mimetype, so the browser can quickly read what type the icon is, and then ignore it and move to a different icon if it doesn't support it. in terms of how to design the icon, you should follow the same best practices you'd follow for any android icon (see the android icon design guidelines). link the ht...
...And 3 more matches
l10n - Archive of obsolete content
lize strings appearing in content scripts or html files, but you can share the localized strings you want by assigning it's values to a json serializable object. globals functions get(identifier, count, placeholder1...n) this function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for firefox. localized strings are supplied by the add-on developer in .properties files stored in the add-ons "locale" directory. the gettext tools uses "_" for the name of the function that retrieves localized strings. for compatibility with tools that expect this syntax, you can assign this function to "_": var _ = require("sdk/l10n").get; given a .properties file for the current locale containing an entry like: hello_string= h...
...entifier itself. this enables you to write functional, localizable code without localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. ...
... make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. if you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a second integer parameter which indicates the number of items there are. you can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. parameters identifier : string a identifier for the localization of a particular string in the current local...
...And 2 more matches
simple-prefs - Archive of obsolete content
on's code will still be able to access and modify it, just like any other preference you define. type-specific attributes these are settings that are only applicable to certain preference types. they are documented along with the preference types themselves. preference types the setting types map to the inline settings types used by the add-on manager. all the inline preferences are supported. type description example specification bool displayed as a checkbox and stores a boolean. { "description": "does it have tentacles?", "type": "bool", "name": "hastentacles", "value": true, "title": "tentacles" } boolint displayed as a checkbox and stores an integer. a boolint is presented to the user as a che...
...s" } boolint displayed as a checkbox and stores an integer. a boolint is presented to the user as a checkbox, but instead of storing true or false, the "on" or "off" checkbox states are mapped to integers using "on" or "off" properties in the specification. to provide this mapping the boolint requires two mandatory attributes called "on" and "off", both of which are supplied as strings. note that even so, the "value" property is supplied as an integer. { "type": "boolint", "name": "myboolint", "on": "1", "off": "2", "value": 1, "title": "my boolint" } integer displayed as a textbox and stores an integer. { "description": "how many eyes?", "type": "integer", "name": "eyecount", "valu...
... "type": "directory", "name": "mydirectory", "title": "select a directory" } menulist displayed as a drop-down list. the type of the stored value depends on the default value. the options are specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "label" attributes is used verbatim as labels. { "name": "typeofbreath", "type": "menulist", "title": "type of breath", "value": 0, "options": [ ...
...And 2 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
he content area is chrome. extensions also can be considered xul applications with chrome. three kinds of packages make up chrome the content package this package is used to contain the main xul and javascript source files. most extensions consist of a single content package2 the locale package this package is used to contain language data that can be translated. to make an extension’s gui support multiple languages, you can include multiple locale packages, one for each language. the skin package this is used to include source files used as visual elements in the gui, including style sheets and images. most extensions include only one skin package, but you can include multiple skin packages to allow the gui to change with different themes. chrome url use a file called a “chrome ...
...layed on the errors panel of the error console. if you set things up as recommended in the section “setting up your development environment”, xul and javascript errors will appear here. see the part “javascript debugging techniques” for useful tips on that subject5. if firefox freezes up, you’ll need to terminate the firefox process from the task manager. ...
...nvironment”, xul and javascript errors will appear here. see the part “javascript debugging techniques” for useful tips on that subject5. if firefox freezes up, you’ll need to terminate the firefox process from the task manager. phase 3: adding multilingual support the clock window that we created in phase 2 displays everything in english. in phase 3, we’re going to add multilingual support, making it so that it users running firefox in a french environment will see “heure actuelle”, and those running it in english will see “current time” (figure 7). fixme: figure 7: clock window after phase 3 directory structure to add multilingual support to this extension, we’ll add a locale package to the chrome. create a new locale folder with subfolders and files within the he...
...And 2 more matches
XPCOM Objects - Archive of obsolete content
ces. in this case you may also find it easier to implement your component using jsm and the xpcomutils module. download this version of the hello world project with xpcom to see how xpcom files are structured in the project and built. (your build will probably break, we'll cover this later on.) in the components directory, the file xsihellocounter.idl has the following contents: #include "nsisupports.idl" /** * counter for the hello world extension. keeps track of how many times the * hello world message has been shown. */ [scriptable, uuid(bd46f689-6c1d-47d0-bc07-bb52b546b8b5)] interface xsihellocounter : nsisupports { /* the maximum allowed count. */ const short max_count = 100; /* the current count. */ readonly attribute short count; /** * increments the display cou...
...s been shown. */ [scriptable, uuid(bd46f689-6c1d-47d0-bc07-bb52b546b8b5)] interface xsihellocounter : nsisupports { /* the maximum allowed count. */ const short max_count = 100; /* the current count. */ readonly attribute short count; /** * increments the display count and returns the new count. * @return the incremented count. */ short increment(); }; the bits about nsisupports are common to most xpcom interface definitions. nsisupports is the base interface for all interfaces, so it should always be included, except for cases where your interface extends another interface. in those cases you just need to replace nsisupports with the interface you're extending. you can also extend from multiple interfaces, by including a comma-separated list of interfaces instead o...
...hese constants are used at the bottom, in the component registration code. they specify the details of the component, such as a unique uuid (you have to generate it too and it must be different from the idl uuid), a descriptive name (this isn't used anywhere that we know of), and the contract id, which is the string you use to get a reference to the component. the ";1" at the end of the string is supposed to indicate the version of the component, although it shouldn't change much. it can be useful if there are multiple incompatible versions of the component installed at the same time. the implementation object itself should be easy to understand. the only aspects to take into account are that methods and attributes must have the same names as their idl counterparts, and that the queryinterfa...
...And 2 more matches
Underscores in class and ID Names - Archive of obsolete content
summary: the use of the underscore character in css can lead to major display problems in multiple browsers. learn why this is so, and how to keep your sites from being bitten by this problem. this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances. it is a fairly common practice in many programming languages to use the underscore character (_) in the place of a "space" in variable and function names. ...
...as of this writing, technically permitted in class and id names, there are many historical and practical reasons why they should be avoided. ...
... netscape 6.x permits underscores and escaped underscores. ...
...And 2 more matches
Drag and Drop Example - Archive of obsolete content
an example of implementing drag and drop will be implemented in this section. dragging elements around here, we'll create a simple board where items from a palette can be dragged onto the board. the user can click on one of several xul elements on the palette and drag it onto a stack element to create an element of a particular type. first, we'll add the wrapper scripts: <script src="chrome://global/content/nsdraganddrop.js"/> <script src="chrome://global/content/nstransferable.js"/> <script src="dragboard.js"/> an additional script file dragboard.js is included which will contain the code we will write ourselves. ...
...n has been defined, ondragstart, which will be called by the nsdraganddrop object when necessary. the function adds the data to be dragged to the transfer object. the elem attribute is retrieved from the target of the drag event. the target will be the element that had the drag start on. we'll use the value of this attribute as the data of the drag. ...
...e is retrieved from the target of the drag event. the target will be the element that had the drag start on. we'll use the value of this attribute as the data of the drag. the boardobserver will need three functions, getsupportedflavours, ondragover and ondrop. the ondrop function will grab the data from the drag session and create a new element of the appropriate type. ...
...And 2 more matches
Plug-n-Hack - Archive of obsolete content
rectly then the browser will typically fail to connect to any website – debugging such problems can be frustrating and time-consuming. without integration between security tools and browsers, a user must often switch between the tool and their browser several times to perform a simple task, such as intercepting an http(s) request. pnh allows security tools to declare the functionality that they support which is suitable for invoking directly from the browser. a browser that supports pnh can then allow the user to invoke such functionality without having to switch to and from the tool. while some of the pnh capabilities do have a fixed meaning, particularly around proxy configuration, most of the capabilities are completely generic, allowing tools to expose whatever functionality they want. ...
...as a result we have designed and developed the pnh protocol to be both browser and tool independent. ...
...l and firefox implementation are released under the mozilla public license 2.0 which means it can be incorporated in commercial tools without charge. ...
...And 2 more matches
File object - Archive of obsolete content
os pipelines. creating a pipeline involves spawning arbitrary processes; this means that giving a script access to the file object is exactly equivalent to giving the script access to the unix shell or dos command interpreter. filesystem access is implemented with nspr i/o functions, and as such shares many semantics. pipelines are implemented with the popen() system call. there is currently no support for p2open()-like semantics. here is the original proposal for this object, and a status update from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe ...
... created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol. description filenames are specified as strings that have an implementation defined format. use of standard "file:" urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. when a file is constructed, leading and trailing spaces are removed from the filename, so new file(" abc.txt ") just creates a file called abc.
...is constructed, leading and trailing spaces are removed from the filename, so new file(" abc.txt ") just creates a file called abc.txt. filenames starting and ending with the pipe symbol (|) are interpreted as pipes. readable pipelines (i.e. pipe to programs generating output on stdout) begin with the pipe symbol; writeable pipelines end with the pipe symbol. bi-directional pipelines are not supported. properties static properties file.input a file object that represents the standard input (stdin). file.currentdir a file object that represents the standard output (stdout). file.currentdir a file object that represents the standard error (stderr). file.currentdir a file object referring to the current directory; this property may be set. file.separator the system name separa...
...And 2 more matches
Static Analysis for Windows Code under Linux - Archive of obsolete content
this document will describe how to run mozilla static check for windows code under linux platform by creating a cross-compiler with dehydra support for mingw. we highly recommend you to read the cross compiling manual and the dehydra build manual before you start the following reading. build gcc corss-compiler with plugin support by default gcc does not support plugins. dehydra requires patching gcc such that it can load plugins as shared libraries: # prepare a directory mkdir $home/dehydra cd $home/dehydra #obtain gcc 4.3 sources wget ftp://mirrors.kernel.org/gnu/gcc/gcc...-4.3.0.tar.bz2 tar jxvf gcc-4.3.0.tar.bz2 # get the patches which enable plugins cd gcc-4.3.0/ # create an hg repository. this makes it easy to apply patches, they can be applied manually hg init . hg clone ht...
...nable plugins cd gcc-4.3.0/ # create an hg repository. this makes it easy to apply patches, they can be applied manually hg init . hg clone http://hg.mozilla.org/users/tglek_mo...-moz-plugin-mq .hg/patches # apply gty.diff and plugin.diff # if you have mq setup, do hg qpush -a (for file in `cat .hg/patches/series`; do cat .hg/patches/$file; done) |patch -p1 cd .. now, the gcc source with plugin supports is ready, we should now build a cross compiler from this source. and the instructions are exactly the same with the one here. follow that instructions strictly for making a cross compiler. build dehydra for cross-compiler build the dehydra plugin dehydra is a shared library which will be loaded by the above plugin-support gcc. build dehydra for a cross compiler has nothing difference wi...
...just follow this and this to compile both dehydra and treehydra shared libraries. ...
...And 2 more matches
Actionscript Acceptance Tests - Archive of obsolete content
rsion) there are a couple of requirements: you must use system.swfversion when looking up the swfversion. the test file can not be wrapped in a package or define classes as the file will be wrapped in a function when used in the ats. if you must use classes, define them in a sub-dir with the same name as the test. you must create a testname.as.avm_args file with the uses_swfversion directive. support files: there are a variety of support files available for non-standard actionscript tests. testname.as.asc_args this file specifies additional arguments to pass to asc when compiling the test: # asc args for file # two modes are available: # override| all command line arguments (except builtin.py) are ignored and replaced by these # merge| merge these args in with the current args # specifiy ...
...ersion 11 -swfversion 12 ... any additional args on the uses_swfversion line will be passed to each run of the vm. (see bug 587093 for details.) specifying multiple .abcs: if you desire to run a test with multiple .abc files (e.g: avmshell a.abc b.abc testname.abc) there is a special avm_args directive called multiabc that is specified surrounded by two pipe (|) symbols: |multiabc| $dir/testname_support/a.abc $dir/testname_support/b.abc the extra abc files will usually be placed in a _support dir (see additional files below). any avm arguments can be placed before the |multiabc| directive, or the line can start with the directive. any test arguments (--) must be placed after the multiabc file listings. here is a more complicated example that passes both avm args, multiple abcs and test ar...
...bc the extra abc files will usually be placed in a _support dir (see additional files below). any avm arguments can be placed before the |multiabc| directive, or the line can start with the directive. any test arguments (--) must be placed after the multiabc file listings. here is a more complicated example that passes both avm args, multiple abcs and test args: -ojit |multiabc| $dir/testname_support/a.abc -- test_args a dir.avm_args file can also be created with the same contents that will apply to the entire directory. testname.as.avm_args files will take precedence over the dir.avm_args file testname.as.tz if a test is only valid for certain timezones, the timezones can be specified in this support file. below is a sample file that covers the 4 main us timezones: # place all timezone...
...And 2 more matches
The new nsString class implementation (1999) - Archive of obsolete content
string class is a wide character string class used throughout all of gecko (and other modules) as the default implementation. however, it suffers from a few implementation details which need to be addressed and that are the subject of this document. ...
... used throughout all of gecko (and other modules) as the default implementation. however, it suffers from a few implementation details which need to be addressed and that are the subject of this document. ...
...as the default implementation. however, it suffers from a few implementation details which need to be addressed and that are the subject of this document. ...
...And 2 more matches
URIs and URLs - Archive of obsolete content
may require the use of more than one protocol (e.g., both dns and http are typically used to access an "http" url's resource when it can't be found in a local cache). in necko every uri scheme is represented by a protocol handler. sometimes a protocol handler represents more than one scheme. the protocol handler provides scheme specific information and methods to create new uris of the schemes it supports. one of the main necko goals is to provide a "plug able" protocol support. this means that it should be possible to add new protocols to necko just by implementing nsiprotocolhandler and nsichannel. it also might be necessary to implement a new urlparser for a new protocol but that might not be necessary because necko already provides uri implementations that can deal with a number of scheme...
...ssimpleuri which is the basis for protocols like "about". nssimpleuri contains setters and getters for the uri and the components of an uri: scheme and path (non-scheme). there are no pre written urlparsers for simple uris, because of it's simple structure. nsstandardurl the most important implementation of nsiurl is nsstandardurl which is the basis for protocols like http, ftp, ... these schemes support a hierarchical naming system, where the hierarchy of the name is denoted by a "/" delimiter separating the components in the path. nsstandardurl also contains the facilities to parse these typ of urls, to break the specification of the url "spec" down into the most basic segments. the spec consists of prepath and path. the prepath consists of scheme and authority. the authority consists of pr...
...uthority the urls have an authority segment, like "http". noauthority these urls have no or a degenerated authority segment, like the "file" scheme. also this parser can identify drives if possible depending on the platform. standard it is not known if an authority segment exists or not, less syntax correction can be applied in this case. noteable differences necko does not support certain deprecated forms of relative urls, based on the following part of rfc 2396: if the scheme component is defined, indicating that the reference starts with a scheme name, then the reference is interpreted as an absolute uri and we are done. otherwise, the reference uri's scheme is inherited from the base uri's scheme component. due to a loophole in prior specifications (rfc1630), ...
...And 2 more matches
Elements - Archive of obsolete content
note: the normal same-origin policy is used for web sites; they can only link to xbl files on ...
... note: the normal same-origin policy is used for web sites; they can only link to xbl files on the same domain, or within the chrome. ...
...nts the name of the corresponding class that is constructed for the implementation. if no name attribute is specified then the binding's document uri and id are used to uniquely reference the binding's implementation. implements - the implements attribute can be used to describe the set of interfaces that are implemented by the binding. its value is a comma-separated list of named interfaces. if supported, in strongly typed languages the bound element can be referenced not only as any of the interfaces that the element might already support (e.g., htmlelement) but also as any of the interfaces described by this attribute. support of this capability is optional. constructor the code inside the constructor is called when a binding has just been attached to an element. so full access to anon...
...And 2 more matches
XUL Changes for Firefox 1.5 - Archive of obsolete content
ner> a <scrollcorner> element is added which is used to create the small box in the intersection of the horizontal and vertical scrollbars. <richlistbox> and <richlistitem> the <richlistbox> and <richlistitem> elements are used for creating lists containing arbitrary content. this element works similarly to the <listbox> which is designed primarily for lists of textual items. ...
...a set of icons will appear across the top of the dialog allowing the user to switch panels. ...
...ile the load and unload events are used only when the page is loaded or unloaded. for more information see using firefox 1.5 caching. tabindex the tabindex property is now applied to most elements. <radiogroup> setting the value property on the <radiogroup> element selects the <radio> element in the group with the corresponding value. dialog: defaultbutton property the <dialog> binding now supports the defaultbutton property. setting this property changes the default button of the dialog. it can be set either to one of the buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="he...
...And 2 more matches
The Implementation of the Application Object Model - Archive of obsolete content
ing that file just to get rid of the button (even though the user might wish that he or she could!). what the user needs to be able to do is make a local annotation to the remote file, e.g., to save somewhere on the local hard drive the fact that the aol instant messenger button shouldn't be on the toolbar. when the remote file is subsequently downloaded, these local annotations are sucked in and superimposed on top of the structure described by the file. the resulting structure is what the user actually ends up viewing. forget xul! let's just use serialized rdf! well, that's just plain cool! i say forget xul! let's just use serialized rdf to represent the ui! that would be an unwise decision for a variety of reasons. rdf is a graph structure, and windows and dialogs are actually content...
...applications, and the other for describing documents that can be used by those applications. it does not make sense to confuse or obscure the purpose of html by adding in a whole slew of new functionality that hasnothing to do with the display of web pages. what content developers want from the next release of mozilla is a standards-compliant browser. if we ship a browser that does not have 100% support for css2, for example, but we've extended html by adding 20-30 new tags, people are going to put down their blinders and see only the fact that we were off adding a whole slew of new stuff to html when we could have been firming up our standards story. by making xul a separate beast, this is less of an issue. since an aom tree cannot be placed inside a dom tree, xul applications don't ever oc...
... all content node implementations be the same kind of object, and that those objects communicate with their pluggable content through this new streamlined interface we talked about earlier. we'll call this new interface a pluggable data source. just in case you still aren't convinced that all content nodes should be the same kind of element, consider another problem: how to implement aggregation. suppose that a bookmarks folder contains a mailbox folder, a composer page template, and a bookmark. in order to achieve aggregation of data, a content node implementation cannot make any assumptions about what kind of children it holds. it can only refer to its child nodes through the various content tree interfaces. what we run into now is the problem of how one local content node knows how to inst...
...And 2 more matches
listbox - Archive of obsolete content
a listbox is expected to contain listitem elements. all the rows in the listbox are the same height, which is the height of the tallest item in the list. if you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...non-text content, you should instead use the richlistbox element. see list controls for more information. ...
...selected at a time. (default in listbox and richlistbox.) multiple multiple rows may be selected at once. (default in tree.) for trees, you can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. suppressonselect type: boolean if this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods. if set to true, the select event is never fired. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a hi...
...And 2 more matches
calICalendarView - Archive of obsolete content
itatuations. it also fueled the development, however, of the more predictable, but less flexible calidecoratedview, which usually contains an embedded calicalendarview. calendar/base/public/calicalendarview.idlscriptable please add a summary to this article. ...
...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 calidatetime selectedday; attributes displaycalendar the displaycalendar is an i...
...tension's loading process. startdate returns a calidatetime corresponding to the first date shown by the view enddate returns a calidatetime corresponding to the last date shown by the view. note that this date is typically not immediately useful for querying for the events and tasks shown in the calicalendarview. typically, one more day must be added to it, in order to make it exclusive. supportsdisjointdates consumers of calicalendarview should check this attribute to determine whether or not the implementation allows for calls to setdatelist. if an implementation returns true for this attribute, it must allow for any arbitrary set of dates to be displayed. hasdisjointdates returns false if the dates being displayed represent a continuous list, and true if certain dates in betwe...
...And 2 more matches
External resources for plugin creation - Archive of obsolete content
ill a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. ...
...n provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. platforms supported include windows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all platforms rely on cmake for easy cross-platform builds. project: nixysa project home page description (f...
...atform builds. project: nixysa project home page description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but is flexible enough to support a wide range of use cases. project: juce project home page description (from the home page): juce (jules' utility class extensions) is an all-encompassing c++ class library for developing cross-platform applications. it contains pretty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised uis and for handling graphics and ...
...And 2 more matches
Using IO Timeout And Interrupt On NT - Archive of obsolete content
e overlapped buffer will be pointing to freed memory. this is problematic. canceling overlapped io by closing the file descriptor therefore, we need to cancel the outstanding overlapped io request before the thread exits. nt's <tt>cancelio()</tt> function would be ideal for this purpose. unfortunately, <tt>cancelio()</tt> is not available on nt 3.51. so we can't go this route as long as we are supporting nt 3.51. the only reliable way to cancel outstanding overlapped io request that works on both nt 3.51 and 4.0 is to close the file descriptor, hence the rule of thumb stated at the beginning of this memo. limitations this seemingly harsh way to force the completion of outstanding overlapped io request has the following limitations: it is difficult for threads to shared a file descript...
...the only reliable way to cancel outstanding overlapped io request that works on both nt 3.51 and 4.0 is to close the file descriptor, hence the rule of thumb stated at the beginning of this memo. limitations this seemingly harsh way to force the completion of outstanding overlapped io request has the following limitations: it is difficult for threads to shared a file descriptor. for example, suppose thread a and thread b call <tt>pr_accept()</tt> on the same socket, and they time out at the same time. following the rule of thumb, both threads would close the socket. the first <tt>pr_close()</tt> would succeed, but the second <tt>pr_close()</tt> would be freeing freed memory. a solution that may work is to use a lock to ensure only one thread can be using that socket at all times. once t...
...ey time out at the same time. following the rule of thumb, both threads would close the socket. the first <tt>pr_close()</tt> would succeed, but the second <tt>pr_close()</tt> would be freeing freed memory. a solution that may work is to use a lock to ensure only one thread can be using that socket at all times. once there is a timeout or interrupt error, the file descriptor is no longer usable. suppose the file descriptor is intended to be used for the life time of the process, for example, the logging file, this is really not acceptable. a possible solution is to add a <tt>pr_disableinterrupt()</tt> function to turn off interrupts when accessing such file descriptors. a related known bug is that timeout and interrupt don't work for <tt>pr_connect()</tt> on nt. this bug is due to a differe...
...And 2 more matches
GetObject - Archive of obsolete content
non-standard. do not use! ...
...]) parameters pathname full path and name of the file containing the object to retrieve. if pathname is omitted, class is required. class optional class of the object. the class argument uses the syntax appname.objectype and has these parts: appname name of the application providing the object. objectype type or class of object to create. remarks the getobject function is not supported in internet explorer 9 standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows store apps or later. use the getobject function to access an automation object from a file. assign the object returned by getobject to the object variable. for example: var cadobject; cadobject = getobject("c:\\cad\\schema.cad"); when this code is executed, the ap...
...tion you might have multiple layers to a drawing stored in a file. you could use the following code to activate a layer within a drawing called schema.cad: var layerobject = getobject("c:\\cad\\schema.cad!layer3"); if you do not specify the object's class, automation determines which application to start and which object to activate, based on the file name you provide. some files, however, may support more than one class of object. for example, a drawing might support three different types of objects: an application object, a drawing object, and a toolbar object, all of which are part of the same file. to specify which object in a file you want to activate, use the optional class argument. for example: var myobject; myobject = getobject("c:\\drawings\\sample.drw", "figment.drawing"); in...
...And 2 more matches
XForms Custom Controls - Archive of obsolete content
ollowing categories: custom presentation - xforms controls as rendered by the mozilla xforms processor do not provide the right look and feel for you. custom data types - existing xforms controls are not able to work properly with your data type advanced xforms controls - you need your controls to be able to do more things than traditional xforms controls can do new host language - you'd like to support xforms in host languages other than xhtml or xul custom presentation the mozilla xforms extension cannot anticipate all of the possible use cases that will evolve in web applications and web pages as xforms matures and the user base grows. and with these new uses, more and more flexibility will be desired from the controls. introducing custom controls into your environment may be just the so...
...controls there may be times where you need a control that is very specific to your task, but you also want it to work with xforms models and instance nodes just like a regular xforms control. the xforms specification provides for a nice way to do this using xforms binding attributes (like ref, or nodeset) on your custom control element. however, the mozilla xforms implementation currently doesn't support this approach. but there is a way for you to achieve the same result. you can put the xforms controls inside your xbl binding. note you should take care to make sure that the embedded xforms controls are able to work with the data type of the instance node that your control is bound to. to give you an idea of what we are talking about, it could look something like this: <content> <xf:input ...
...the xforms implementation has base xbl bindings for every xforms control. you can write implementation bindings that will inherit from these base bindi...
...And 2 more matches
Mozilla XForms Specials - Archive of obsolete content
introduction this article gives an overview of where the mozilla xforms extension deviates from the official xforms 1.0 specification . this covers both limitations in the extension, and custom extensions. limitations repeat using attributes the specifications mentions "creating repeating structures via attributes", this is partially supported. ...
...peat and table or ul it is not possible to mix repeats with either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. ...
...it is not possible to mix repeats with either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you wi...
...And 2 more matches
XUL Parser in Python - Archive of obsolete content
with new widgets and attributes landing all the time, i wanted to get some quicker way of looking at the xul--at particular builds, at particular widgets, at which elements had which attributes, etc. ...
...es (i.e. new "packages") on the fly using search and replace. as i adapt the script in these ways and try to further generalize the actual code as i get time, i will make it available here. in the explanation section below, i try to say a little something about how this script works. it's really just a wrapper around python's xmllib xml parser, but i had to sort of fool around with it. python's support for xml (and potential with xul) is extensive, and so it's more a matter of choosing an approach and hooking things up than anything else. source code the source code for the xul parser is available. it only runs as a hard-coded script right now, so if you want to use it you have to go in and changes some of the stuff like chrome_dir and which information you want out. it also, i'm afraid,...
...ailable. it only runs as a hard-coded script right now, so if you want to use it you have to go in and changes some of the stuff like chrome_dir and which information you want out. it also, i'm afraid, only works on the win32 platform, where the <tt>dir</tt> command it depends on gets you your xul files. again, you can easily use <tt>ls</tt> instead, as i should have done, and pick up some extra support. i will make these adjustments and change it into a real module when i get a second, so that someone can instantiate the parser from their own scripts and use it more flexibly: >>> import xultool >>> myxp = xulparser() >>> chrome_dir = 'd:\src\mozilla\xpfe' >>> res = myxp.parsexul(chrome_dir, 'window', 'id') where something like the above would write out all the xul window ids in the build...
...And 2 more matches
Archive of obsolete content
n in a living product, it may not be appropriate to move it here. in general, it may be best to discuss it in the mdn web docs room on matrix before moving content here. .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. 2015 mdn fellowship program add-ons archived add-ons documentation. adding preferences to an extension this article takes the creating a dynamic status bar extension sample to the next level, adding a popup menu that lets you quickly switch between multiple stocks to watch. it also adds a preference ...
... likely to be incomplete since we think there are many dark matter projects that we don't know about. if you have information about a new project or extra information about an existing project, please feel free to update this page. localizing an extension this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. makefile - .mk files misc top level these pages were moved from the top level of mdn in a spate of furious reorganization. mmgc ...
...e following instructions are for obtaining and building the tamarin tracing source code. for instructions on tamarin central, please see the basics of web services summary: a current hot topic on the web right now are web services. this short guide will allow you to learn more about web services. themes archived theme documentation. updating an extension to support multiple mozilla applications this article shows how to take an existing extension and update it so that it can be used in additional mozilla applications. we'll build upon the stock watcher extension created in earlier articles in this series, updating it so it can also be used in thunderbird and sunbird (previous versions worked only in firefox). ...
...And 2 more matches
Desktop mouse and keyboard controls - Game development
we'll look at this below. it's also easier to test control-independent features like gameplay on desktop if you develop it there, so you don't have to push the files to a mobile device every time you make a change in the source code. ...
...we'll look at this below. it's also easier to test control-independent features like gameplay on desktop if you develop it there, so you don't have to push the files to a mobile device every time you make a change in the source code. ...
... keyboard the whole game can be controlled with just the keyboard and nothing else. the built in this.game.input.keyboard object manages the input from the keyboard and has a few helpful methods like addkey() and isdown(). there's also the phaser.keycode object, which contains all the available keyboard keys: in the main menu of the game we can add an extra ...
...And 2 more matches
Implementing controls using the Gamepad API - Game development
in the browser. now in the era of html5, we finally have the gamepad api, which gives us the ability to play browser-based games using gamepad controllers without any plugins. the gamepad api achieves this by providing an interface exposing button presses and axis changes that can be used inside javascript code to handle the input. these are good times for browser gaming. ...
...ut any plugins. the gamepad api achieves this by providing an interface exposing button presses and axis changes that can be used inside javascript code to handle the input. these are good times for browser gaming. api status and browser support the gamepad api is still at the working draft stage in the w3c process, which means its implementation might still change, but saying that the browser support is already quite good. firefox 29+ and chrome 35+ support it out of the box. opera supports the api in version 22+ (not surprising given that they now use chrome's blink engine.) and microsoft implemented support for the api in edge recently, which means four main browsers now supporting the gamepad api. which gamepads are best? the most popular gamepads right now are those from the xbox 36...
...he "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act quickly. the second, hidden "change" implementation is the ability to transform the static fridge into a full-blown moving, shooting and eating machine. when you connect the controller, the game significantly changes (hungry fridge turns into the super turbo hungry fridge) and you're able to control the armored fridge using the gamepad api. you have to shoot down the food, but once again you also have to find the type of food the fridge wants to eat at each point, or else you'll lose energy. the game encapsulates two totally different types of "change" — good food vs. bad food, and mobile vs. desktop. demo the full version of the hungry ...
...And 2 more matches
Advanced form styling - Learn web development
nce property was created as a way to control what os- or system-level styling was applied to web form controls. unfortunately, the behavior of this property's original implementations was very different across browsers, making it not very usable. newer implementations are more consistent in behavior; interestingly enough, both chromium-based browsers (chrome, opera, edge), safari, and firefox all support the -webkit- prefixed version (-webkit-appearance). firefox settled on this because web developers mostly seemed to be using the -webkit- prefixed version, so it was better for compatibility. if you look at the reference page you'll see a lot of different possible values listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this...
...vated it. :disabled — the checkbox (or radio button) is in a disabled state — it cannot be interacted with. you can see the live result: we've also created a couple of other examples to give you more ideas: styled radio buttons: custom radio button styling. toggle switch example: a checkbox styled to look like a toggle switch. if you view these checkboxes in a browser that doesn't support appearance, your custom design will be lost, but they will still look like checkboxes and be usable. note: while internet explorer doesn't support any version of appearance, the input[type=checkbox]::-ms-check enables the targeting of checkboxes in ie only. this technique works for radio buttons too, despite the name -ms-check. what can be done about the "ugly" elements? now let's turn o...
... the style of the range control's drag handle — to get full control over range styling you'll need to use a whole bunch of complex css code, including multiple non-standard, browser-specific pseudo-elements. check out styling cross-browser compatible range inputs with css on css tricks for a detailed write up of what's needed. color input types input controls of type color are not too bad. in supporting browsers, they tend to just give you a block of solid color with a small border. you can remove the border, just leaving the block of color, using something like this: input[type="color"] { border: 0; padding: 0; } however, a custom solution is the only way to get anything significantly different. file input types inputs of type file are generally ok — as you saw in our example,...
...And 2 more matches
Basic native form controls - Learn web development
implement them using html. you've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>. this article covers: the common input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are common to all form controls. note: the features discussed in this article are supported in all browsers, which is not the case for all form controls. we cover newer form controls added in html5 in the next two articles. if you want a more advanced reference, you should consult our html forms element reference, and in particular our extensive <input> types reference. text input fields text <input> fields are the most basic form widgets. they are a very convenient way to let ...
... of the form data). they can have a placeholder; this is text that appears inside the text input box that should be used to briefly describe the purpose of the box. they can be constrained in size (the physical size of the box) and maxlength (the maximum number of characters that can be entered into the box). they can benefit from spell checking (using the spellcheck attribute), if the browser supports it. note: the <input> element is unique amongst html elements because it can take many different forms depending on its type attribute value. it is used for creating most types of form widgets including single line text fields, time and date controls, controls without text input like checkboxes, radio buttons, and color pickers, and buttons. single line text fields a single line text f...
...le line text fields a single line text field is created using an <input> element whose type attribute value is set to text, or by omitting the type attribute altogether (text is the default value). the value text for this attribute is also the fallback value if the value you specify for the type attribute is unknown by the browser (for example if you specify type="color" and the browser doesn't support native color pickers). note: you can find examples of all the single line text field types on github at single-line-text-fields.html (see it live also). here is a basic single line text field example: <input type="text" id="comment" name="comment" value="i'm a text field"> single line text fields have only one true constraint: if you type text with line breaks, the browser removes those...
...And 2 more matches
Introduction to cross browser testing - Learn web development
eb developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, device, or additional assistive tools they are using. you need to think about: different browsers other than the one or two that you use regularly on your devices, including slightly older browsers that some people might still be using, which don't support all the latest, shiniest css and javascript features. different devices with different capabilities, from the latest greatest tablets and smartphones, through smart tvs, right down to cheap tablets and even older feature phones that may run browsers with limited capabilities. people with disabilities, who use the web with the aid of assistive technologies like screenreaders, or don't use a ...
...be; back when ie4 and netscape 4 were competing to be the dominant browser in the 1990s, browser companies deliberately implemented things differently to each other to try to gain competitive advantage, which made life hell for developers. browsers are much better at following standards these days, but differences and bugs still creep through sometimes. some browsers may have different levels of support for technology features than others. this is inevitable when you are dealing with bleeding edge features that browsers are just getting round to implementing, or if you have to support really old browsers that are no longer being developed, which may have been frozen (i.e. no more new work done on them) a long time before a new feature was even invented. as an example, if you want to use cutt...
... some devices may have constraints that cause a web site to run slowly, or display badly. ...
...And 2 more matches
Adding a new event
d aname. aprefix defines prefix of event class name which should be widget or internal. widget should be used if the event class is dispatched from widget. otherwise, i.e., the event class is just used for internal event class of a dom event class, it should be internal. aname defines its event class specific name and it must end with "event" or "eventbase". the latter is used only for abstruct super event class whose instance will never be created. please note that aname must not be same as other event classes even if aprefix is different. i.e., defining both widgetfooevent and internalfooevent is invalid. define and implement an event class then, you need to define and implement an event class. you should choose a good header file from what your event class represents. basicevents.h...
...other event classes even if aprefix is different. i.e., defining both widgetfooevent and internalfooevent is invalid. define and implement an event class then, you need to define and implement an event class. you should choose a good header file from what your event class represents. basicevents.h this header file should be used only for defining generic purpose event class such as a common super class of various event classes. probably, you shouldn't use this for your class. contentevents.h this header file should be used for defining internal event classes which are dispatched in content and do not represent user action. typically, events in this header file never cross process boundary. mouseevents.h this header file should be used for defining input events from pointing devices ...
...ue for acopytargets. and also, mflags should be just copied since assignfooeventdata() doesn't copy mflags. this method is basically used for duplicating an internal event class instance of a dom event when the dom event is stored by content. void assignfooeventdata(const internalfooevent* aevent, bool acopytargets) this method should copy members from aevent. first, this method should call its super class's this method. then, copy the additional members which are defined in the class. if acopytargets is false, don't copy its event target related members. all new member variables of event classes must be with "m" prefix. although, a lot of existing members don't have "m" prefix, but you shouldn't use the legacy local rules. if you need to add methods, it's okay to implement them as inlin...
...And 2 more matches
Testopia
code from the git repository. this would also let us get some early feedback in case you find regressions. if you find bugs in the code available from the git repository, please report it to us so that we can fix most critical ones on time for testopia 3.0. do not ask when we plan to release 3.0, because we really don't know. "as soon as possible" is our best answer. testopia 2.5 this versions supports bugzilla 4.2 and 4.4, and the best news is that it no longer requires a patch for bugzilla. if you are upgrading, please reverse the existing version's patch before installing. a fresh install only requires that you untar the tarball in your bugzilla root directory and run checksetup. thanks go to lpsolit from the bugzilla team for his work in making this possible. testopia 2.4 this versio...
...rts bugzilla 4.2 and 4.4, and the best news is that it no longer requires a patch for bugzilla. if you are upgrading, please reverse the existing version's patch before installing. a fresh install only requires that you untar the tarball in your bugzilla root directory and run checksetup. thanks go to lpsolit from the bugzilla team for his work in making this possible. testopia 2.4 this version supports bugzilla 3.6. important notice: if you are upgrading on a case sensitive filesystem you must remove the existing testopia folder in the extensions directory. if you have made modifications to the testopia source code, you will need to merge them into the new testopia folder (capital t). if you are on windows or another case insensitive file system you should first rename the folder (testopi...
...you should first rename the folder (testopia-old for example) and then unzip the tarball. you can then merge your changes before deleting the old version. api users take note: positional parameters are now deprecated. all params should now be sent in a hash (struct, dict, hashmap or whatever your language of choice calls key, value pairs). ...
...And 2 more matches
Embedding Tips
ct, creates a listener and starts the operation. as the operation progresses, methods on the listener such as onstatechange, onprogresschange etc. are called, allowing the embedder to know what is happening. when the operation is completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags. you may also use the progress listener to query the request supplied in onstatechange for more information. for example, if you wanted to check the server response headers, you might check onstatechange for state_start | state_is_request flags, and from the nsirequest argument qi fornsihttpchanne and call methods on that to determine response codes and other information from the server. it is left as an exercise to make this sample synchronous, i.e. wait for...
...ion from the server. it is left as an exercise to make this sample synchronous, i.e. wait for persistence to complete before returning. hint, add a native message processing loop after the call to saveuri that terminates when onstatechange indicates persistence has finished.. how do i print a page? query the web browser object for nsiwebbrowserprint. call the nsiwebbrowserprint::print() method supplying a print settings object (e.g. that returned from nsiwebbrowserprint::getglobalprintsettings) that you wish to print the page with. how do i print preview a page? query the web browser object for the nsiwebbrowserprint interface. call the nsiwebbrowserprint::printpreview() method supplying a print settings object (e.g. that returned from nsiwebbrowserprint::getglobalprintsettings()) that y...
... etc.) how do i implement tool tips? make your chrome object implement the nsitooltiplistener interface. methods to hide or show the tool tips will automatically be called upon it when the user hovers over an item with title text. the contract id is defined here. for an example, see browserimpl.cpp in mfcembed and its simple cbrowsertooltip class implemented in mfc. how do i disable drag/drop support? when setting up your browser add a hook to the command manager which points to your nsiwebbrowserchrome implementation. this implementation should also implement nsiclipboarddragdrophooks. deny the drop by setting the return value of the allowdrop() function. nscomptr<nsicommandmanager> commandmanager = do_getinterface(iwebbrowser); if (commandmanager) { nscomptr<nsidomwindow> thedomwind...
...And 2 more matches
IPDL Tutorial
void sendbaz() { /* boilerplate */ } }; you can use the child, parent, and both labels multiple times in a protocol specification. they behave like public, protected, and private labels in c++. parameters message declarations allow any number of parameters. parameters specify data that are sent with the message. their values are serialized by the sender and deserialized by the receiver. ipdl supports built-in and custom primitive types, as well as unions and arrays. the built-in simple types include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring). ipdl imports these automatically because they are common, and because the base ipc library knows how to serialize and deserialize these types. see ipc/ipdl/ipdl/builtin.py for the most up-to-date...
...aybe(nscstring? maybe); }; custom primitive types when you need to send data of a type other than one built into ipdl, you can add a using declaration in an ipdl specification. a custom serializer and deserializer must be provided by your c++ code. using mozilla::plugins::npremoteevent; sync protocol pplugininstance { child: async handleevent(npremoteevent); }; unions ipdl has built-in support for declaring discriminated unions. using struct mozilla::void_t from "ipc/ipcmessageutils.h"; union variant { void_t; bool; int; double; nscstring; ppluginscriptableobject; }; this union generates a c++ interface which includes the following: struct variant { enum type { tvoid_t, tbool, tint, tdouble, tnscstring, tpplugionscriptableobject }; type type(); void_t& g...
...nt(); double& get_double(); nscstring& get_nscstring(); ppluginscriptableobject* get_ppluginscriptableobject(); }; aunion.type() can be used to determine the type of a union received in an ipdl message handler, with the remaining functions granting access to its contents. to initialize a union, simply assign a valid value to it, as follows: avariant = false; structs ipdl has built-in support for arbitrary collections of serializable data types. struct namevaluepair { nscstring name; nscstring value; }; in implementation code, these structs can be created and used like so: namevaluepair entry(astring, anotherstring); foo(entry.name(), entry.value()); // named accessor functions return references to the members arrays ipdl has simple syntax for arrays: invokemethod(nscst...
...And 2 more matches
Mozilla DOM Hacking Guide
mozilla's dom is coded almost entirely in c++. seriously hacking on it requires excellent knowledge of c++ and xpcom, mozilla's own component model. in this document i will try to outline the main aspects of the implementation, beginning with the class info mechanism, which lies at the heart of the dom, then with the description of various interfaces and classes. since i am myself still learning how it works, don't expect this to be a complete reference quite yet. ...
...ty() is used when retrieving an attribute that was not defined in idl, and newresolve() is used when resolving for the first time an attribute or method that was not previously resolved. please see the nsixpcscriptable interface for more information. the nsdomclassinfo class the heart of class info is the nsdomclassinfo class, defined in nsdomclassinfo.h. it implements two interfaces besides nsisupports: nsixpcscriptable and nsiclassinfo. we already know what nsixpcscriptable is used for (see the previous section). nsiclassinfo is an xpcom interface, very well described by mike shaver in this overview of nsiclassinfo. basically it contains convenient methods to find out about the interfaces an object promises to support. in our case, this list of interfaces will be populated by "class inf...
...() function and section 1.2 on interface flattening. we saw in section 1.3 that nsdomclassinfo is the base class for all the helper classes. let's see what it's made of. let's begin with the public interface. constructor: it is called for each created helper class through the member initialization list. it simply initializes the mid data member with the aid argument. the nsixpcscriptable, nsisupports, and nsiclassinfo member functions, declared with ns_decl_x macros. static nsiclassinfo* getclassinfoinstance(nsdomclassinfoid aid): this helper method returns a non-refcounted nsiclassinfo pointer to an instance of the helper class corresponding to the id passed in. the implementation is detailed in section 1.6. static nsiclassinfo* getclassinfoinstance(nsdomclassinfodata* adata);: th...
...And 2 more matches
Mozilla Quirks Mode Behavior
obsolete since gecko 50 list bullets do not inherit the font size of the list (bug 97351). removed in firefox 50 (bug 648331). don't inherit font properties into tables except for font-family. make table borders gray rather than using the foreground color. collapse top margin of body and td and bottom margin of td. collapse the bottom or top margins of empty elements (bug 97361). support <pre wrap>, <pre cols>, <pre width>. orphaned dd has generated content :before instead of margin (bug 5119). indent nested dl elements (bug 8749). map acts like an inline, not a block. give floated img a 3px margin (bug 58899). residual style tags' size info does not take precedence over heading tags' size (bug 77352). use box-sizing:border-box for most input types and texta...
...stinct meaning, and except in shorthands). in quirks mode, the css parser allows {} around the contents of style attributes (bug 99554). this behavior is being removed in firefox 27, for interoperability. (bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode. the topmargin, bottommargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 conform and has been adopted in standards mode. the scrollleft, scrolltop, scrollwidth, and scrollheight properties are relative to body in quirks mode (instead of html) (bug 211030). html (1-7) and css (xx-small - xx-large) font sizes are calcu...
...d not work. prior to gecko 36, it also applied to images, and form controls but the quirk has been adapted to match the behavior of other browser (bug 783213). prior to gecko 36, the quirk was also applied if another pseudo-class was used in the same selector, if a pseudo-element was used in the selector, or if it was part of a pseudo-class argument (bug 783213). quirks mode has document.all support (undetected). images (img elements) without alt attributes sometimes display placeholder icons in quirks mode. obsolete since gecko 2.0 html colors were parsed differently up to gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) (bug 121738). in quirks mode, the url fragment #top scrolls to the top of the page when there is no such anchor. obsolete since gecko 10.0 however, html5 r...
...And 2 more matches
Introduction to Network Security Services
network security services (nss) is a set of libraries designed to support cross-platform development of communications applications that support ssl, s/mime, and other internet security standards. for a general overview of nss and the standards it supports, see overview of nss. shared libraries network security services provides both static libraries and shared libraries. applications that use the shared libraries must use only the apis that they export. three shared libraries export public functions: the ssl library supports core ssl operations. the s/mime library supports core s/mime operations. the nss library supports core crypto operations. we guarantee that applications using the exported apis will remain compatible with future versions of those libraries. for a complet...
...list of public functions exported by these shared libraries in nss 3.2, see nss functions. for information on which static libraries in nss 3.1.1 are replaced by each of the above shared libraries in nss 3.2 , see migration from nss 3.1.1. figure 1, below, shows a simplified view of the relationships among the three shared libraries listed above and nspr, which provides low-level cross platform support for operations such as threading and i/o. (note that nspr is a separate mozilla project; see netscape portable runtime for details.) figure 1 relationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for static and dynamic libraries: windows unix static .lib .a dy...
... the above forms. the following static libaries aren't included in any shared libraries libcrmf.a/crmf.lib provides an api for crmf operations. libjar.a/jar.lib provides an api for creating jar files. the following static libaries are included only in external loadable pkcs #11 modules: libnssckfw.a/nssckfw.lib provides an api for writing pkcs #11 modules. ...
...And 2 more matches
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initial...
...requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. ...
...ate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. ...
...And 2 more matches
NSS 3.14.1 release notes
purposes of testing. ...
...pe notable changes in nss 3.14.1 windows ce support has been removed from the code base. bug 812399 - in nss 3.14, a regression caused bug 641052 / cve-2011-3640 to be re-introduced under certain situations. this regression only affected applications that initialize nss via the nss_nodb_init function. nss 3.14.1 includes the complete fix for this issue. bug 357025 - nss 3.14 added support for tokens that make use of cka_always_authenticate. however, when authenticating with such tokens, it was possible for an internal lock to be acquired twice, causing a hang. this hang has been fixed in nss 3.14.1. ...
... applications which use multiple pkcs#11 modules, which do not indicate which tokens should be used by default for particular algorithms, and which do make use of cipherorder may now find that cryptographic operations occur on a different pkcs#11 token. ...
...And 2 more matches
NSS 3.20 release notes
s) 3.20, which is a minor release. distribution information the hg tag is nss_3_20_rtm. nss 3.20 requires nspr 4.10.8 or newer. nss 3.20 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_rtm/src/ new in nss 3.20 new functionality the tls library has been extended to support dhe ciphersuites in server applications. new functions in ssl.h ssl_dhegroupprefset - configure the set of allowed/enabled dhe group parameters that can be used by nss for a server socket. ssl_enableweakdheprimegroup - enable the use of weak dhe group parameters that are smaller than default minimum size of the library. new types in sslt.h ssldhegrouptype - enu...
...imum size of the library. ...
... the tls library has been extended to support dhe ciphersuites in server applications. for backward compatibility reasons, the server side implementation of the tls library keeps all dhe ciphersuites disabled by default. they can be enabled with the new socket option ssl_enable_server_dhe and the ssl_optionset or the ssl_optionsetdefault api. the server side implementation of the tls does not support session tickets while using a dhe ciphersuite (see bug 1174677). support for the following ciphersuites has been added: tls_dhe_dss_with_aes_128_gcm_sha256 tls_dhe_dss_with_aes_128_cbc_sha256 tls_dhe_dss_with_aes_256_cbc_sha256 by default, the server side tls implementation will use dhe parameters with a size of 2048 bits when using dhe ciphersuites. nss embeds fixed dhe p...
...And 2 more matches
NSS 3.22 release notes
services (nss) 3.22, which is a minor release. distribution information the hg tag is nss_3_22_rtm. nss 3.22 requires nspr 4.11 or newer. ...
...download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_22_rtm/src/ new in nss 3.22 new functionality rsa-pss signatures are now supported (bug 1215295) new functions pk11_signwithmechanism() and pk11_signwithmechanism() are provided to allow rsa keys to be used with pss. pseudorandom functions based on hashes other than sha-1 are now supported with pbkdf (bug 554827). pk11_createpbev2algorithmid() now supports sec_oid_pkcs5_pbkdf2 with cipheralgtag and prfalgtag set to sec_oid_hmac_sha256, sec_oid_hmac_sha224, sec_oid_hmac_sha384, or sec_oid_hmac_sha512. enforce an external policy on nss from a config file (bug 1009429) you can now add a config= line to pkcs11.txt (assuming you are using sql databases), which wi...
... new functions in pk11pub.h pk11_signwithmechanism - this function is an extended version pk11_sign(). pk11_verifywithmechanism - this function is an extended version of pk11_verify(). these functions take an explicit mechanism and parameters as arguments rather than inferring it from the key type using pk11_mapsignkeytype(). the mechanism type ckm_rsa_pkcs_pss is now supported for rsa in addition to ckm_rsa_pkcs. the ck_rsa_pkcs_pss mechanism takes a parameter of type ck_rsa_pkcs_pss_params. in ssl.h ssl_peersignedcerttimestamps - get signed_certificate_timestamp tls extension data ssl_setsignedcerttimestamps - set signed_certificate_timestamp tls extension data new types in secoidt.h the following are added to secoidtag:...
...And 2 more matches
NSS 3.52 release notes
sson distribution information the hg tag is nss_3_52_rtm. nss 3.52 requires nspr 4.25 or newer. nss 3.52 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_52_rtm/src/ other releases are available in nss releases. notable changes in nss 3.52 bug 1603628 - update nss to support pkcs #11 v3.0. note: this change modifies the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see...
...es the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see the bug for more information. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add i...
... and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - mpconfig calls in ssl initialize policy before nss is initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 architectures. bug 1624402 - fix compilation error in firefox android. bug 1624130 - re...
...And 2 more matches
nss tech note7
your contribution is welcome. data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h". seckeyprivatekey: a private key, defined in "keythi.h". ...
...your contribution is welcome. data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h". seckeyprivatekey: a private key, defined in "keythi.h". ...
...your contribution is welcome. data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h". seckeyprivatekey: a private key, defined in "keythi.h". ...
...And 2 more matches
NSS tools : pk12util
the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database. -l p12file list the keys and certificates in pkcs#12 file. -o p12file export keys and certificates from the security da...
...the keys and certificates in pkcs#12 file. -o p12file export keys and certificates from the security database to a pkcs#12 file. arguments -c keycipher specify the key encryption algorithm. -c certcipher specify the key cert (overall package) encryption algorithm. -d [sql:]directory specify the database directory into which to import to or export from certificates and keys. pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -h tokenname specify the name of the token to import into or export from. -k slotpasswordfile specify the text file containing the sl...
...13 (0xd) signature algorithm: pkcs #1 sha-1 with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification services division,o=thawte consulting,l=cape t own,st=western cape,c=za" alternatively, the -r prints the certificates and then exports them into separate der binary files. this allows the certificates to be fed to another application that supports .p12 files. each certificate is written to a sequentially-number file, beginning with file0001.der and continuing through file000n.der, incrementing the number for every certificate: # pk12util -l test.p12 -r enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd. id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key t...
...And 2 more matches
TLS Cipher Suite Discovery
nd no tls implementation offers all known cipher suites at all times. an implementation that claimed to offer all defined cipher suites would only be able to make that claim for a short time until another new cipher suite was defined. at any time, any real implementation implements some subset of the complete set of well-defined cipher suites. each new release of a tls implementation may contain support for new cipher suites not supported in previous versions. when a new version of a tls implementation is made available for use by applications, those applications may wish to immediately use the newly supported cipher suites found in the new version, without the application needing to be modified and re-released to know about these new cipher suites. to that end, nss's libssl offers a way for...
...when a new version of a tls implementation is made available for use by applications, those applications may wish to immediately use the newly supported cipher suites found in the new version, without the application needing to be modified and re-released to know about these new cipher suites. to that end, nss's libssl offers a way for applications to discover at run time the set of cipher suites supported by that version of libssl. ...
...e applications may wish to immediately use the newly supported cipher suites found in the new version, without the application needing to be modified and re-released to know about these new cipher suites. to that end, nss's libssl offers a way for applications to discover at run time the set of cipher suites supported by that version of libssl. 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 attempt to use. here are the details of how an nss-based application learns what cipher suites are supported and obtains the information to display to the user. libssl offers a public table of well defined cipher suite numbers. the cipher s...
...And 2 more matches
NSS_3.12.3_release_notes.html
d from the file named in the environment variable nsrandfile (see below). makes nsrandfile usable with /dev/urandom. nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the use of md2 and md4 hash algorithms inside signatures. this was allowed by default before nss 3.12.3. nss_hash_alg_support string specifies algorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process ...
...ng. nss_use_shexp_in_cert_name boolean (any non-empty value to enable) tells nss to allow shell-style wildcard patterns in certificates to match ssl server host names. this behavior was the default before nss 3.12.3. the new behavior conforms to rfc 2818. ...
..._seed_ecb_encrypt_data ckm_seed_cbc_encrypt_data in secmod.h: public_mech_seed_flag in secmodt.h: secmod_seed_flag in secoidt.h: sec_oid_seed_cbc in sslproto.h: tls_rsa_with_seed_cbc_sha in sslt.h: ssl_calg_seed new structure for seed support: (see blapit.h) seedcontextstr seedcontext new functions in the nss shared library: cert_rfc1485_escapeandquote (see cert.h) cert_comparecerts (see cert.h) cert_registeralternateocspaiainfocallback (see ocsp.h) pk11_getsymkeyhandle (see pk11pqg.h) util_setforkstate (se...
...And 2 more matches
NSS Tools certutil
that can create and modify the netscape communicator cert8.db and key3.db database files. it can also list, generate, modify, or delete certificates within the cert8.db file and create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key3.db file. starting from nss 3.35, the database format was upgraded to support sqlite as described in this document. it means that cert9.db and key4.db files may be targeted instead. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for information security module database management, ...
...used on the cert8.db and key3.db files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -e check a certificate's signature during the process of validating a certificate. -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -g keysize set a key size to use when generating new public and private key pairs. the minimum is 512 bits and the maximum is 8192 bits. the default is 1024 bits. any size that is a mu...
...generating a new rsa private and public key pair. this argument makes it possible to use hardware-generated seed values and unnecessary to manually create a value from the keyboard. the minimum file size is 20 bytes. -1 add a key usage extension to a certificate that is being created or added to a database. this extension allows a certificate's key to be dedicated to supporting specific operations such as ssl server or object signing. the certificate database tool will prompt you to select a particular usage for the certificate's key. these usages are described under standard x.509 v3 certificate extensions in appendix a.3 of thered hat certificate system administration guide. -2 add a basic constraint extension to a certificate that...
...And 2 more matches
certutil
ca from which a new certificate will derive its authenticity. use the exact nickname or alias of the ca certificate, or use the ca's email address. bracket the issuer string with quotation marks if it contains spaces. -d [sql:]directory specify the database directory containing the certificate and key database files. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -e check a certificate's signature during the process of validating a ...
...3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -e check a certificate's signature during the process of validating a certificate. -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -g keysize set a key size to use when generating new public and private key pairs. the minimum is 512 bits and the maximum is 8192 bits. the de...
...e keywords: o digital signature o nonrepudiation o keyencipherment o dataencipherment o keyagreement o certsigning o crlsigning o critical -2 add a basic constraint extension to a certificate that is being created or added to a database. ...
...And 2 more matches
NSS tools : pk12util
the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database. -l p12file list the keys and certificates in pkcs#12 file. -o p12file ...
...ficates in pkcs#12 file. -o p12file export keys and certificates from the security database to a pkcs#12 file. arguments -n certname specify the nickname of the cert and private key to export. -d [sql:]directory specify the database directory into which to import to or export from certificates and keys. pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -p prefix specify the prefix used on the certificate and key databases. this ...
...with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification services division,o=thawte consulting,l=cape t own,st=western cape,c=za" .... alternatively, the -r prints the certificates and then exports them into separate der binary files. this allows the certificates to be fed to another application that supports .p12 files. each certificate is written to a sequentially-number file, beginning with file0001.der and continuing through file000n.der, incrementing the number for every certificate: # pk12util -l test.p12 -r enter password for pkcs12 file: key(shrouded): friendly name: thawte freemail member's thawte consulting (pty) ltd. id encryption algorithm: pkcs #12 v2 pbe with sh...
...And 2 more matches
Network Security Services
for a list of frequently asked questions, see the faq. nss is available under the mozilla public license. for information on downloading nss releases as tar files, see download pki source. ...
...for a list of frequently asked questions, see the faq. nss is available under the mozilla public license. for information on downloading nss releases as tar files, see download pki source. ...
...for a list of frequently asked questions, see the faq. nss is available under the mozilla public license. for information on downloading nss releases as tar files, see download pki source. ...
...And 2 more matches
JIT Optimization Strategies
this page has two intended uses: 1. provide a repository of jit optimization strategy information which the jit coach tool can parse to display in its ui. 2. provide a user-browsable documentation of optimization strategies, how they work, how they are defeated, and options for how to re-enable them. ...
...l args using arguments[i] save arguments into variables, as long as those variables cannot be accessed by any nested function, and as long as there exists no eval anywhere within the function or nested function definitions. call a function using f.apply(obj, arguments) if the function contains any use of the arguments object that falls out of the cases defined above, this optimization will be suppressed. in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply case above). getprop_argumentscallee attempts to optimize an arguments.callee property access. this optimization only works if the arguments object is used in well-understood ways within the function. the function containing the arguments.callee is allowed to use the ...
...l args using arguments[i] save arguments into variables, as long as those variables cannot be accessed by any nested function, and as long as there exists no eval anywhere within the function or nested function definitions. call a function using f.apply(obj, arguments) if the function contains any use of the arguments object that falls out of the cases defined above, this optimization will be suppressed. in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply example listed above). getprop_inferredconstant attempts to optimize an access to a property that seems to be a constant. it applies to property accesses on objects which are global-like in that there is only one instance of them per program. this includes global obje...
...And 2 more matches
SpiderMonkey 1.8.7
ox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.7 is supported on all the platforms where firefox 10 runs. spidermonkey 1.8.7 includes type inference, which boosts the speed of the jägermonkey jit by about 30% over version 1.8.5. type inference largely obviates tracemonkey, so the tracemonkey jit has been removed. the jit is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disable...
...applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. xxx is there anything here? these and other changes are explained in detail below. new javascript language features xxx needs updating javascript 1.8.5 adds support for ecmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of ecmascript supported by spidermonkey versions 1.5 through 1.8. these are discussed in annex e of the es5 specification. spidermonkey 1.8.5 also ships with js-ctypes, a foreign-function interface for...
...e api, and in many cases the need to explicitly root gc things or use the "root as you go" approach popular with earlier spidermonkey releases. since this is a conservative collector, it will often find "garbage" addresses which can trigger warnings from certain code analysis tools. if you are running valgrind on your embedding, be sure to build spidermonkey with the --enable-valgrind option to suppress superflous error messages triggered by the garbage collector. this also means that objects will be finalized in a non-deterministic order in spidermonkey 1.8.5. this is not a bug, and, any embedding which depends upon deterministic finalization is fatally flawed. typed rooting api the rooting api has been changed from an error-prone void ** interface to an interface which accepts pointers t...
...And 2 more matches
Web Replay
e at their entry points to call a different function with the same signature), including the function used to dispatch mach messages. when a call or message is intercepted, the wrapped call/message is first performed normally and then it and its outputs are recorded in a data stream for the thread performing the call. during execution of the wrapped call/message, recording of any inner calls is suppressed, so that they are performed normally without affecting the recording. the functions which are intercepted are generally at the system call and the system library level. in general, any function which is not compiled as part of gecko is fair game. acquisition order of locks is recorded in a data stream for each lock. some locks which are associated with non-deterministic components are ...
...laying. similarly, executions which run out of memory at some point can't be reliably replayed. executions which are stopped at some point by the slow script dialog can't be reliably replayed. keeping track of the exact point where an interrupt occurred would require quite a bit of recording overhead, and it doesn't seem worth it to try to do this. the following executions are unlikely to be supported by the initial release, but should be able to be handled at some point in the future: on x64, asm.js code relies on mprotect to handle out of bounds heap accesses; mprotect works differently while replaying, so some cooperation will be needed between the asm.js exception handler and the dirty memory exception handler. shared array buffers can be used by web content to introduce data rac...
...er on the contents of those buffers, going against a fundamental assumption of the record/replay infrastructure. recording and replaying executions using these buffers will require new techniques like treating all accesses on the buffers as atomic (probably unacceptable overhead) or performing all accesses on the buffer on a single core and keeping track of context switches. dom workers are not supported yet. for simplicity, debugger integration is currently only able to handle js code that runs on the main thread. webgl is not supported yet, as it uses a pretty different rendering path from normal web content. media elements are not supported yet, as many of these run third party multithreaded code which hasn't been tested with the infrastructure. porting almost all implementation wo...
...And 2 more matches
XPCOM Stream Guide
Mozilla › Tech › XPCOM › Guide › Streams
calls to the underlying stream are minimized. nsbufferedinputstream @mozilla.org/network/buffered-input-stream;1 nsibufferedinputstream .init(stream, buffersize) binary read binary data from the underlying stream, in "big-endian" order. nsbinaryinputstream @mozilla.org/binaryinputstream;1 nsibinaryinputstream .setinputstream(stream) object read a nsisupports object from the underlying stream. nsbinaryinputstream @mozilla.org/binaryinputstream;1 nsiobjectinputstream (inherits from nsibinaryinputstream) converter convert unicode characters from an underlying stream. nsconverterinputstream @mozilla.org/intl/converter-input-stream;1 nsiconverterinputstream .init(stream, charset, buffersize, replacechar) m...
...e that data to the underlying stream. nsbufferedoutputstream @mozilla.org/network/buffered-output-stream;1 nsibufferedoutputstream .init(stream, buffersize) binary write binary data to the underlying stream, in "big-endian" order. nsbinaryoutputstream @mozilla.org/binaryoutputstream;1 nsibinaryoutputstream .setoutputstream(stream) object write an nsisupports object to the underlying stream. nsbinaryoutputstream @mozilla.org/binaryoutputstream;1 nsiobjectoutputstream (inherits from nsibinaryoutputstream) converter write to an underlying stream with automatic conversion of unicode characters. nsconverteroutputstream @mozilla.org/intl/converter-output-stream;1 nsiconverteroutputstream .init(stream, charset, buffe...
...tream;1 nsiobjectoutputstream (inherits from nsibinaryoutputstream) converter write to an underlying stream with automatic conversion of unicode characters. ...
...And 2 more matches
Interfacing with the XPCOM cycle collector
than a nsautorefcnt. it only traverses objects that return a helper object when qi'ed to nsicyclecollectionparticipant. if it encounters an unknown edge during its traversal, it gives up on that edge; this means that every edge involved in a cycle must be participating, otherwise the cycle will not be found. the traverse and unlink methods on the helper object are not magic; they are programmer-supplied and must be correct, or else the collector will fail. the collector does not know how to find temporary owning pointers that exist on the stack, so it is important that it only run from near the top-loop of the program. it will not crash if there are extra owning pointers, but it will find itself unable to account for the reference counts it finds in the owned objects, so may fail to collec...
...e. in general, assuming you are modifying class nsfoo with two nscomptr 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. add a line declaring that your class nsfoo participates in the cycle collection in nsfoo.cpp: ns_impl_cycle_collection_class(nsfoo) change the line ns_decl_isupports to ns_decl_cycle_collecting_isupports in the definition of nsfoo. add a line ns_decl_cycle_collection_class(nsfoo) within the public portion of definition of nsfoo. or ns_decl_cycle_collection_class_ambiguous(nsfoo, nsibar) if nsfoo inherits from multiple interfaces, where nsibar is the interface which is returned when you queryinterface nsfoo to nsisupports. (we call nsibar the canonic...
...s to ns_decl_cycle_collecting_isupports in the definition of nsfoo. add a line ns_decl_cycle_collection_class(nsfoo) within the public portion of definition of nsfoo. or ns_decl_cycle_collection_class_ambiguous(nsfoo, nsibar) if nsfoo inherits from multiple interfaces, where nsibar is the interface which is returned when you queryinterface nsfoo to nsisupports. (we call nsibar the canonical isupports type for nsfoo.) add a line ns_interface_map_entries_cycle_collection(nsfoo) to the interface map of nsfoo in nsfoo.cpp. or if that doesn't work: ns_interface_table_head(nsfoo) ns_interface_table2(nsfoo, nsibar, nsibaz) ns_interface_table_to_map_segue_cycle_collection(nsfoo) ns_interface_map_end change the line ns_impl_addref(nsfoo) to...
...And 2 more matches
Components.classes
ect for the contractid @mozilla.org/messenger;1, which is not usually used by itself, but whose createinstance and getservice methods can be used to create a new instance of the component or to access the singleton instance, if the contract id represents a service. ...
...self, but whose createinstance and getservice methods can be used to create a new instance of the component or to access the singleton instance, if the contract id represents a service. ...
...tance of the component or to access the singleton instance, if the contract id represents a service. a new xpcom component instance can be created from the returned class object as follows: var obj = components.classes["@mozilla.org/supports-array;1"] .createinstance(components.interfaces.nsisupportsarray); which is a shortcut to var obj = components.classes["@mozilla.org/supports-array;1"] .createinstance(); obj.queryinterface(components.interfaces.nsisupportsarray); if you don't provide a specific interface to createinstance(), it will return an xpconnect wrapper for the component, which only exposes the methods of the nsisupports interface (and under certain circumstances the special wrappedjsobject property). to access a service (a singleto...
...And 2 more matches
imgILoader
modules/libpr0n/public/imgiloader.idlscriptable please add a summary to this article. ...
...emented by @mozilla.org/image/loader;1 as a service: var imgiloader = components.classes["@mozilla.org/image/loader;1"] .getservice(components.interfaces.imgiloader); method overview imgirequest loadimage(in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy); imgirequest loadimagewithchannel(in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 ...
...ring mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image. imgirequest loadimage( in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy ); parameters auri the uri to load. ainitialdocumenturl areferreruri the 'referring' uri. aloadingprincipal the principal of the loading document. aloadgroup loadgroup to put the image load into. aobserver the observer (may be null) acx some random data. aloadflags ...
...And 2 more matches
inIDOMUtils
layout/inspector/inidomutils.idlscriptable dom utility functions. ...
...siarray getbindingurls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astr...
... anonymous content, then if the element has an xbl binding then this will be the binding's anonymous nodes, otherwise if the element is itself an anonymous node containing an insertion point then this will be a list combining the element's explicit children from its binding parent's anonymous nodes and any children inserted as a result of the insertion point. ...
...And 2 more matches
nsIAccessibilityService
ervice.idlscriptable please add a summary to this article. ...
...ast changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsiaccessibleretrieval method overview nsiaccessible createouterdocaccessible(in nsidomnode anode); nsiaccessible createrootaccessible(in nsipresshell ashell, in nsidocument adocument); nsiaccessible createhtml4buttonaccessible(in nsisupports aframe); nsiaccessible createhypertextaccessible(in nsisupports aframe); nsiaccessible createhtmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible createhtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); nsiaccessi...
...tmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible createhtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); nsiaccessible createhtmlcheckboxaccessible(in nsisupports aframe); nsiaccessible createhtmlcomboboxaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlhraccessible(in nsisupports aframe); nsiaccessible createhtmlimageaccessible(in nsisupports aframe); nsiaccessible...
...And 2 more matches
nsIAnnotationService
to use this service, use: var annotationservice = components.classes["@mozilla.org/browser/annotation-service;1"] .getservice(components.interfaces.nsiannotationservice); note: the annotation service is not thread-safe. ...
...to use this service, use: var annotationservice = components.classes["@mozilla.org/browser/annotation-service;1"] .getservice(components.interfaces.nsiannotationservice); note: the annotation service is not thread-safe. ...
...he item on which the annotation is to be set. aname the annotation name. avalue the annotation value. aflags should be "0" for now, some flags will be defined in the future. aexpiration one of the expire_* constant value defined above. setpageannotationbinary() this method sets an annotation for given uri, just like setpageannotationstring(), but takes binary data as an input. you must supply a valid mime type. void setpageannotationbinary( in nsiuri auri, in autf8string aname, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration ); parameters auri the uri on which the annotation is to be set. aname the annotation name. adata binary contents of the page to save. a...
...And 2 more matches
nsIAppShellService
xpfe/appshell/nsiappshellservice.idlscriptable provides the appshellservice. ...
... void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only! ...
...stwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only! ...
...And 2 more matches
nsIAppStartup
toolkit/components/startup/public/nsiappstartup.idlscriptable this interface is intended to be used as application startup service. it also helps in quitting applications as well. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/toolkit/app-startup;1. to use the service: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); method overview void createhiddenwindow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsi...
...this can be used, for example, when doing performanc...
...this can be used, for example, when doing performance testing of the s...
...And 2 more matches
nsIAuthInformation
netwerk/base/public/nsiauthinformation.idlscriptable a object that holds authentication information. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the caller of nsiauthprompt2.promptusernameandpassword() or nsiauthprompt2.promptpasswordasync() provides an object implementing this interface; the prompt implementation can then read the values here to prefill the dialog. after the user entered the authentication information, it should set the attributes of this object to indicate to the caller what was entered by the user. attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable. if the protocol ...
...on can then read the values here to prefill the dialog. after the user entered the authentication information, it should set the attributes of this object to indicate to the caller what was entered by the user. attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable. if the protocol for this authentication does not support schemes, this will be the empty string. otherwise, this will be a string such as "basic" or "digest". this string will always be in lowercase. read only. domain astring the initial value should be used to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the domain entered by the user. this attribute is only used if flags include #need_do...
...on return, this parameter should contain the domain entered by the user. this attribute is only used if flags include #need_domain. flags unsigned long flags describing this dialog. a bitwise or of the constants. it is possible that neither #auth_host nor #auth_proxy are set. ...
...And 2 more matches
nsIBoxObject
layout/xul/base/public/nsiboxobject.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) to get an instance, use the boxobject property. where possible, element.getclientrects and element.getboundingclientrect should be used instead. method overview wstring getlookandfeelmetric(in wstring propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only. firs...
...pixels. read only. y long the y coordinate of the box, in css pixels. read only. ...
...nly. y long the y coordinate of the box, in css pixels. read only. ...
...And 2 more matches
nsIChannel
ng protocol-specific results. for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable. this attribute only applies to textual data. setting contentcharset before the channel has been opened provides a hint to the channel on what the charset should be. t...
...facerequestor the notification callbacks for the channel. this is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications. if this value is null, the channel implementation may use the notification callbacks from its load group. the channel may also query the notification callbacks from its load group if its notification callbacks do not supply the requested interface. interfaces commonly requested include: nsiprogresseventsink, nsiprompt, and nsiauthprompt / nsiauthprompt2. when the channel is done, it must not continue holding references to this object. note: a channel implementation should take care when "caching" an interface pointer queried from its notification callbacks. if the notification callbacks are changed,...
...an still be obtained. this is also used as the ri of the document resulting from the channel, unless the channel has the load_replace flag set. this is never null. attempts to set it to null must throw. note: this is distinctly different from the http referer (referring uri), which is typically the page that contained the original uri (accessible from nsihttpchannel.) owner nsisupports the owner, corresponding to the entity that is responsible for this channel. used by the security manager to grant or deny privileges to mobile code loaded from this channel. note: this is a strong reference to the owner, so if the owner is also holding a strong reference to the channel, care must be taken to explicitly drop its reference to the channel. securityinfo ...
...And 2 more matches
nsIClipboardDragDropHooks
widget/public/nsiclipboarddragdrophooks.idlscriptable interfaces for overriding the built-in drag, drop, copy, and paste implementations in the content area and editors. use this to do things such as prevent a drag from starting, adding or removing data and flavors, or preventing the drop. ...
...adding them to the first window does not enable them for every window. ...
...adding them to the first window does not enable them for every window. if more than one implementation is set for a window, the hooks will be called in the order they are added. ...
...And 2 more matches
nsIComponentRegistrar
xpcom/components/nsicomponentregistrar.idlscriptable this interface provides methods to access and modify the xpcom component registry. ...
...ing atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactorylocation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory. registration lasts for this run only, and is not cached. note: formerly this method would register component files directly. this is no longer supported. component files must have an associated loader and export the required symbols which this loader defines. for example, if the given file is a native library, it must export the symbol nsgetmodule. other loaders may have different semantics. this method may only be called from the main thread. void autoregister( in nsifile aspec ); parameters aspec this parameter indicates either a com...
... a given contractid, if one exists and is registered. nscidptr contractidtocid( in string acontractid ); parameters acontractid the contractid to be queried. return value the classid corresponding to acontractid if one exists and is registered. enumeratecids() this method returns an enumerator over the list of registered classids. elements of the enumeration can be queryinterfaced for the nsisupportsid interface. from the nsisupportsid, you can obtain the actual classid. nsisimpleenumerator enumeratecids(); parameters none. return value an nsisimpleenumerator over the list of registered classes. elements of the enumerator implement nsisupportsid. enumeratecontractids() this method returns an enumerator over the list of registered contractids. elements of the enumeration can be queryinte...
...And 2 more matches
nsIContentSecurityPolicy
content/base/public/nsicontentsecuritypolicy.idlscriptable describes an xpcom component used to model and enforce content security policies. ...
...nderbird 3.3 / seamonkey 2.1) method overview boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type description allowseval boolean whether this policy allows eval and eval-like functions such as settimeout("code string...
...ate method called by the service when sub-elements of the protected document are being loaded. given a bit of information about the request, decides whether or not the policy is satisfied. calls to this may trigger violation reports when queried, so this value should not be cached. short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetypeguess aextra return value shouldprocess() delegate method called by the service when sub-elements of the protected document are being processed. given a bit of information about the request, decides whether or not the policy is satisfied. shor...
...And 2 more matches
nsIContentViewer
docshell/base/nsicontentviewer.idlscriptable handles displaying content. inherits from: nsisupports last changed in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) implemented by: ?????????????????????????????????????. to create an instance, use: var contentviewer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only! [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init...
... [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only! [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only! void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only! ...
...can return null. read only. istabmodalpromptallowed boolean read only. prescontext nsprescontextptr read only. native code only!
...And 2 more matches
nsIFile
xpcom/io/nsifile.idlscriptable an instance of this interface is a cross-platform representation of a location in the filesystem. inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform location...
... containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect. therefore, the utf-16 forms are scriptable, but the "native methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the full unicode support on windows 2000 or later where the os itself does not have such a limitation. therefore, you must not use the native form unless it is guaranteed that the path passed to a native form function is always ascii. to create an nsifile from a path you can use fileutils.jsm: var fileutils = cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filename )...
... type description directoryentries nsisimpleenumerator returns an enumeration of the elements in a directory. each element in the enumeration is an nsifile. read only. exceptions thrown ns_error_file_not_directory indicates that this nsifile does not reference a directory. diskspaceavailable print64 the number of bytes available to non-superuser on the disk volume containing the nsifile. read only. filesize print64 the value of this attribute is the number of bytes corresponding to the data represented by the file. on the mac, getting/setting the file size with nsifile only deals with the size of the data fork. if you need to know the size of the combined data and resource forks use nsilocalfilemac.getfiles...
...And 2 more matches
nsINavBookmarksService
toolkit/components/places/nsinavbookmarksservice.idlscriptable the bookmarksservice interface provides methods for managing bookmarked history items. bookmarks consist of a set of user-customizable folders. a uri in history can be contained in one or more such folders. 1.0 67 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: @mozilla.org/browser/nav-bookmarks-service;1. to use this service, use: var navbookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); method overview void addobserver(in nsinavbookmarkobserver observer, in boolean ...
... long long afolder); obsolete since gecko 2.0 void removefolderchildren(in long long aitemid); void removeitem(in long long aitemid); void removeobserver(in nsinavbookmarkobserver observer); void replaceitem(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports auserdata); void setfolderreadonly(in long long afolder, in boolean areadonly); void setfoldertitle(in print64 folder, in astring title); obsolete since gecko 1.9 void setitemdateadded(in long long aitemid, in prtime adateadded); void setitemguid(in long long aitemid, in astring aguid); obsolete since gecko 14.0 void setitemindex(in long long ...
...parator". type_dynamic_container 4 this is an index for type "dynamic container". dynamic containers were removed in gecko 11, but the type index remains to prevent reuse. methods addobserver() this method adds a bookmark observer. if ownsweak is false, the bookmark service will keep an owning reference to the observer. if ownsweak is true, then aobserver must implement nsisupportsweakreference, and the bookmark service will keep a weak reference to the observer. void addobserver( in nsinavbookmarkobserver observer, in boolean ownsweak ); parameters observer the bookmark observer to be added. ownsweak the owning reference state (boolean). beginupdatebatch() obsolete since gecko 1.9 (firefox 3) causes observers to be notified of...
...And 2 more matches
nsINavHistoryQueryOptions
toolkit/components/places/nsinavhistoryservice.idlscriptable represents the global options for executing a query. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) method overview nsinavhistoryqueryoptions clone(); attributes attribute type description applyoptionstocontainers boolean if true, the query options are only applied to the containers. asyncenabled boolean when true, the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. ...
...tocontainers boolean if true, the query options are only applied to the containers. asyncenabled boolean when true, the root container node generated by these options and all of its descendant containers are opened asynchronously if they support doing so. by default, this is false. note: currently, only bookmark folder containers support being opened asynchronously. excludeitemifparenthasannotation obsolete since gecko 13.0 autf8string this option excludes items from a bookmarks query if the parent of the item has this annotation. an example is to exclude livemark items (parent folders have the "livemark/feeduri" annotation). ignored for queries over history. excludeitems ...
...e you multiple results for one uri). individual result nodes will have type "visit". results_as_full_visit 2 this is identical to result_type_visit except that individual result nodes will have type "fullvisit". this is used for the attributes that are not commonly accessed to save space in the common case (the lists can be very long). note: supported only for query_type_history. results_as_date_query 3 returns nsinavhistoryqueryresultnode nodes for each predefined date range where we had visits. note: supported only for query_type_history. results_as_site_query 4 returns nsinavhistoryqueryresultnode nodes for each site where we hav...
...And 2 more matches
nsIProgressEventSink
netwerk/base/public/nsiprogresseventsink.idlscriptable this interface is used to asynchronously convey channel status and progress information that is generally not critical to the processing of the channel. the information is intended to be displayed to the user in some meaningful way. inherits from: nsisupports last changed in gecko 1.7 this interface is used to asynchronously convey channel status and progress information that is generally not critical to the processing of the channel. the information is intended to be displayed to the user in some meaningful way. an implementation of this interface can be passed to a channel via the channel's notificationcallbacks attribute. see nsichannel for more info. the channel will begin passing notifications to the progress event si...
...progress event sink after its asyncopen method has been called. notifications will cease once the channel calls its listener's onstoprequest method or once the channel is canceled (via nsirequest.cancel()). note: this interface is actually not specific to channels and may be used with other implementations of nsirequest. ...
...r once the channel is canceled (via nsirequest.cancel()). note: this interface is actually not specific to channels and may be used with other implementations of nsirequest. ...
...And 2 more matches
nsIScriptableIO
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. nsiscriptableio provides a convenient api for creating files and streams, as well as for reading and writing data to them. for your convenience, this api is...
...nvenient api for creating files and streams, as well as for reading and writing data to them. for your convenience, this api is published through a global io object. for more details about how to use this object, see the file and stream guide. network/base/public/nsiscriptableio.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports a scriptable io object can be used in an extension or chrome code by referring to the global io object. for example: io.getfile("profile", "cookies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profil...
... you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissio...
...And 2 more matches
nsIServiceManager
xpcom/components/nsiservicemanager.idlscriptable this interface provides a means to obtain global services in an application. the service manager depends on the repository to find and instantiate factories to obtain services. ...
...sserviceinstantiated( in nscidref aclass, in nsiidref aiid ); parameters aclass the classid of the service that is being tested. aiid the interface type to be tested. return value true if the service has already been created. exceptions thrown ns_error_service_not_available indicates that the service hasn't been instantiated. ns_nointerface indicates that the iid given isn't supported. isserviceinstantiatedbycontractid() this method tests whether or not a xpcom service, identified by contractid, has been instantiated. boolean isserviceinstantiatedbycontractid( in string acontractid, in nsiidref aiid ); parameters acontractid the contractid of the service that is being tested. aiid the interface type to be tested. return value true if the service has al...
...ontractid( in string acontractid, in nsiidref aiid ); parameters acontractid the contractid of the service that is being tested. aiid the interface type to be tested. return value true if the service has already been created. exceptions thrown ns_error_service_not_available indicates that the service hasn't been instantiated. ns_nointerface indicates that the iid given isn't supported. remarks the service manager depends on the repository to find and instantiate factories to obtain services. because services are instantiated lazily, methods are provided to test whether or not a service has already been instantiated. users of the service manager must first obtain a pointer to the global service manager by calling ns_getservicemanager. after that, they can request spe...
...And 2 more matches
nsISocketProvider
netwerk/socket/nsisocketprovider.idlscriptable this interface represents a socket provider. it is implemented by several types of socket classes like: udp, socks, tls, ssl, and so on. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/network/socket;2?type=foo. ...
...socket;2?type=foo. ...
...when set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request. anonymous_connect 1 << 1 ...
...And 2 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level. nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly. therefore they sometimes caused impossible scenarios in automated tests (what's tested with such events?) and js-ime and/or js-keyboard on firefox os or add-ons may dispatch events with wrong rules. for ...
... in such case, non-printable keyboard events will be dispatched. key_keep_key_location_standard 0x00000008 one of akeyflags. the location attribute value of dispatching keyboard events is computed automatically if the attribute isn't initialized or initialized with 0. for the latter case, you may not want textinputprocessor to compute location attribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero location attribute value, this causes throwing an exception since it doesn't make sense. key_keep_keycode_zero 0x00000010 one of akeyflags. the keycode attribute value of dispatching printable keyboard events is computed from key value automatically if the attribute isn't initialized or initialized with 0. for ...
...throwing an exception since it doesn't make sense. key_keep_keycode_zero 0x00000010 one of akeyflags. the keycode attribute value of dispatching printable keyboard events is computed from key value automatically if the attribute isn't initialized or initialized with 0. for the latter case, you may not want textinputprocessor to compute keycode attribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero keycode attribute value, this causes throwing an excepction since it doesn't make sense. key_dont_dispatch_modifier_key_event 0x00000020 one of akeyflags. textinputprocessor manages modifier state with every modifier key events. in other words, when you need to specify modifier key state of dispatching keyboard...
...And 2 more matches
nsIWebSocketChannel
nsiwebsocketchannel netwerk/protocol/websocket/nsiwebsocketchannel.idlscriptable provides support for websocket channels. 1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: ?????????????????????????????????????. ...
...rbird 8.0 / seamonkey 2.5) implemented by: ?????????????????????????????????????. to create an instance, use: var websocketchannel = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiwebsocketchannel); method overview void asyncopen(in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext); void close(in unsigned short acode, in autf8string areason); void sendbinarymsg(in acstring amsg); void sendmsg(in autf8string amsg); attributes attribute type description extensions acstring sec-websocket-extensions response header value. read only. loadgroup nsiloadgroup the load group of the websocket...
...o forth. originaluri nsiuri the original uri used to construct the protocol connection. this is used in the case of a redirect or uri "resolution" (for example resolving a resource: uri to a file: uri) so that the original pre-redirect uri can still be obtained. this is never null. read only. protocol acstring sec-websocket-protocol value. securityinfo nsisupports transport-level security information (if any). read only. uri nsiuri the uri corresponding to the protocol connection after any redirections are completed. read only. status codes the following values are permitted status codes. status code name description 0-999 reserved and not used. 1000 close_normal normal closure; th...
...And 2 more matches
nsIZipWriter
modules/libjar/zipwriter/public/nsizipwriter.idlscriptable this interface provides an easy way for scripts to archive data in the zip file format. operations on the archive can be performed one by one, or queued for later execution. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) once all the operations you wish to perform are added to the queue, a call to processqueue() will perform the operations in the order they were added to the queue. operations performed on the queue throw any errors that occur out to the observer. attempting to perform a synchronous operation on the interface while the background queue is in progress will throw an ns_error_in_progress exception. file and directory names should use slashe...
... exceptions thrown ns_error_not_initialized if no zip file has been opened. file nsifile the zip file bei...
... compression_default 6 use the default compression method when adding the file to the archive. compression_best 9 use the best compression method when adding the file to the archive. methods addentrychannel() adds data from a channel to the zip file. if the operation is performed on the queue then the channel will be opened asynchronously, otherwise the channel must support being opened synchronously. void addentrychannel( in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue ); parameters azipentry the path of the file entry to add to the zip file. this is the path it will be located at within the zip file. note: you must use forward slashes ('/') in the path. amodtime the modifica...
...And 2 more matches
XPCOM Interface Reference by grouping
tion contains elements associated with the view pane or the content of the "browser window" proper. it is wrapped by system, but displayed for convenience. data this section contains data wrappers and core object definitions. security this section contains apis for secure channel communications system this section contains application level interfaces including calls to external support elements (such as device calls). this is the root element and may contain some functions defined in other groups. user this section contains elements specific to a given user's data storage. browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice ...
... nsifeedprogresslistener nsifeedresult nsifeedresultlistener nsifeedtextconstruct script mozijssubscriptloader storage mozistoragevacuumparticipant util nsieffectivetldservice worker nsiabstractworker data nsiarray nsicategorymanager nsicollection nsidictionary nsimutablearray nsisimpleenumerator nsisupportschar nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprimitive nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoi...
... nsisupportsdouble nsisupportsfloat nsisupportsid nsisupportsinterfacepointer nsisupportsprbool nsisupportsprimitive nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttprequestupload obsolete nsixmlrpcclient nsixmlrpcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper ...
...And 2 more matches
wrappedJSObject
wrappedjsobject is a property sometimes available on xpconnect wrappers. when available, it lets you access the javascript object hidden by the wrapper. there are two kinds of xpconnect wrappers that support the wrappedjsobject property: xpcnativewrappers which are used to protect the chrome code working with content objects. see xpcnativewrapper for detailed documentation. regular xpconnect wrappers which you can encounter, for example, when using xpcom components implemented in js. this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl. the rest of this article demonstrates what xpconnect wrappers do and how wrappedjsobject can be used to bypass them. examp...
...es as declared in xpidl. the rest of this article demonstrates what xpconnect wrappers do and how wrappedjsobject can be used to bypass them. example component to see how the wrappedjsobject property works, we need an example xpcom component implemented in js. see how to build an xpcom component in javascript for details on creating one. for simplicity we omit the component registration code. ...
...ponent in javascript for details on creating one. for simplicity we omit the component registration code. suppose we register the component below with the @myself.com/my-component;1 contract. // constructor function helloworld() { }; helloworld.prototype = { hello: function() { return "hello world!"; }, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsihelloworld)) throw components.results.ns_error_no_interface; return this; } }; xpconnect wrapping now let's get a reference to our component. in this example we use getservice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-...
...And 2 more matches
Mail composition back end
sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages. the interface that accomplishes this task is the nsimsgsend interface. the feedback mechanism is provided by a nsimsgsendlistener which is implemented by the caller. the caller has the ability to add or remove listener interfaces to the nsimsgsend object and the interface can support multiple listeners. (for detailed information on the listener interfaces, see the listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface. all of these methods are asynchronous operations. createandsendmessage the createandsendmessage method will create an rfc822 message and send it ...
...r_p argument is set to pr_true) nsimsgcopyservicelistener the nsimsgcopyservicelistener interface will notify the implementor or the progress and completion of the copy operation that follows successful send operations. onstartcopy the onstartcopy interface is called when the copy operation has begun. ns_imethod onstartcopy( nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation onprogress the onprogress interface is called with progress notification for the copy operation. ns_imethod onprogress( pruint32 aprogress, - the progress so far pruint32 aprogressmax) = 0; - the maximum progress (aprogress should b...
...ss the onprogress interface is called with progress notification for the copy operation. ns_imethod onprogress( pruint32 aprogress, - the progress so far pruint32 aprogressmax) = 0; - the maximum progress (aprogress should be used as a numerator and aprogressmax as a denominator for a message sent percentage) nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation onstopcopy the onstopcopy interface is called when the copy operation has completed. this will be called in the case of both success and failure. ns_imethod onstopcopy( nsresult astatus, - the resulting status for the send operation ...
...And 2 more matches
Using COM from js-ctypes
the windows api mostly concerns itself with the interaction between the operating system and an application. for communication between the different windows applications among themselves, microsoft has developed a series of technologies alongside the main windows api. this started out with dynamic data exchange (dde), which was superseded by object linking and embedding (ole) and later by the component object model (com), automation objects, activex controls, and the .net framework. com is c++ and it cannot be written directly with js-ctypes. this documentaion explains how to convert the com c++ code into js-ctypes code. basis and reference for this article bugzilla :: bug 738501 - implement ability to create windows shortcuts from javascript - comment 4 relavent topic bugzilla :: bug...
... model (com), automation objects, activex controls, and the .net framework. com is c++ and it cannot be written directly with js-ctypes. this documentaion explains how to convert the com c++ code into js-ctypes code. basis and reference for this article bugzilla :: bug 738501 - implement ability to create windows shortcuts from javascript - comment 4 relavent topic bugzilla :: bug 505907 - support c++ calling from jsctypes converting com code to c code to convert com code to js-ctypes, we need to write c++ vtable pointers in c. after that, we can pass a pointer . speech synthesis example let's start with following c++ code, which invokes microsoft speech api and says "hello, firefox!" with system default voice, then wait until the speaking done. #include <sapi.h> int main(void) ...
... ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboundary; void* getalertboundary; void* setrate; void* getrate; void* setvolume; void* getvolume; void* waituntildone; void* setsyncspeaktimeout; void* getsyncspeaktimeout; void* speakcompleteevent; void* isuisupported; void* displayui; /* end ispvoice */ }; int main(void) { if (succeeded(coinitialize(null))) { struct myispvoice* pvoice = null; hresult hr = cocreateinstance(&clsid_spvoice, null, clsctx_all, &iid_ispvoice, (void**)&pvoice); if (succeeded(hr)) { pvoice->lpvtbl->speak(pvoice, l"hello, firefox!"...
...And 2 more matches
AnalyserNode.AnalyserNode() - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
BaseAudioContext.createConstantSource() - Web APIs
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
BudgetService.getBudget() - Web APIs
s page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...t exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetbudget experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung i...
...And 2 more matches
BudgetService.getCost() - Web APIs
his page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...net exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetcost experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung i...
...And 2 more matches
BudgetService.reserve() - Web APIs
his page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...net exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreserve experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ? ie ? opera full support 42safari ? webview android full support 55chrome android full support 55firefox android ? opera android full support 42safari ios ? samsung i...
...And 2 more matches
DOMRectReadOnly.fromRect() - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Element: mousewheel event - Web APIs
lta attribute value is an abstract value which indicates how far the wheel turned. if the wheel has rotated away from the user, it's positive, otherwise negative. this means that the delta value sign is different from dom level 3 event's wheel. however, the meaning of the amount of these values is not the same between browsers. see following explanation for the detail. ie and opera (presto) only support wheeldelta attribute and do not support horizontal scroll. the wheeldeltax attribute value indicates the wheeldelta attribute value along the horizontal axis. when a user operates the device for scrolling to right, the value is negative. otherwise, i.e., if it's to left, the value is positive. the wheeldeltay attribute value indicates the wheeldelta attribute value along the vertical axis. ...
...ght, the value is negative. otherwise, i.e., if it's to left, the value is positive. the wheeldeltay attribute value indicates the wheeldelta attribute value along the vertical axis. the sign of the value is the same as the wheeldelta attribute value. internet explorer the value is the same as the delta value of windows' wm_mousewheel or wm_mousehwheel. it means that if the mouse wheel doesn't support high resolution scroll, the value is 120 per notch. the value isn't changed even if the scroll amount of system settings is page scroll. chrome on windows, the value is the same as the delta value of wm_mousewheel or wm_mousehwheel. and also, the value isn't changed even if the scroll amount of system settings is page scroll, i.e., the value is the same as ie on windows. on linux, the valu...
...f wm_mousewheel or wm_mousehwheel. and also, the value isn't changed even if the scroll amount of system settings is page scroll, i.e., the value is the same as ie on windows. on linux, the value is 120 or -120 per native wheel event. this makes the same behavior as ie and chrome for windows. on mac, the value is complicated. ...
...And 2 more matches
FederatedCredential - Web APIs
syntax var mycredential = new federatedcredential(init) parameters init options are: provider: a usvstring; identifying the credential provider. specifications specification status comment credential management level 1 working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
...page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...te to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
FileReaderSync.readAsBinaryString() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
FileSystemDirectoryEntry.createReader() - Web APIs
bility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ou'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
....com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
FileSystemEntry.filesystem - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...f you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
FileSystemEntry.fullPath - Web APIs
patibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
age is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...e to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...xploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontfacesetloadevent() constructor experimentalchrome full support 57edge full support ≤79firefox ? ie ? opera full support 44safari ? webview android no support nochrome android full support 57firefox android ? opera android full support 43safari ios ? samsung int...
...And 2 more matches
HTML Drag and Drop API - Web APIs
a translucent representation of the draggable elements follows the pointer during the drag operation. for web sites, extensions, and xul applications, you can customize which elements can become draggable, the type of feedback the draggable elements produce, and the droppable elements. this overview of html drag and drop includes a description of the interfaces, basic steps to add drag-and-drop support to an application, and an interoperability summary of the interfaces. drag events html drag-and-drop uses the dom event model and drag events inherited from mouse events. a typical drag operation begins when a user selects a draggable element, drags the element to a droppable element, and then releases the dragged element. during drag operations, several event types are fired, and some eve...
...nsfer objects include the drag event's state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item. datatransfer objects also have methods to add or remove items to the drag's data. the dragevent and datatransfer interfaces should be the only ones needed to add html drag and drop capabilities to an application. (firefox supports some gecko-specific extensions to the datatransfer object, but those extensions will only work on firefox.) each datatransfer object contains an items property, which is a list of datatransferitem objects. a datatransferitem object represents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type. the datatransferitem object a...
...t object has methods to add a drag item to the list, remove a drag item from the list, and clear the list of all drag items. a key difference between the datatransfer and datatransferitem interfaces is that the former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() method. note: dragevent and datatransfer are broadly supported on desktop browsers. however, the datatransferitem and datatransferitemlist interfaces have limited browser support. see interoperability for more information about drag-and-drop interoperability. gecko-specific interfaces mozilla and firefox support some features not in the standard drag-and-drop model. these are convenience functions to help with dragging multiple items or non-string da...
...And 2 more matches
IDBVersionChangeRequest.setVersion() - Web APIs
table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
InputEvent.getTargetRanges() - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
MediaStream.getTracks() - Web APIs
tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Using the Notifications API - Web APIs
ons. getting permission if permission to display notifications hasn't been granted yet, the application needs to use the notification.requestpermission() method to request this from the user. in its simplest form, we just include the following: notification.requestpermission().then(function(result) { console.log(result); }); this uses the promise-based version of the method. if you want to support older versions, you might have to use the older callback version, which looks like this: notification.requestpermission(); the callback version optionally accepts a callback function that is called once the user has responded to the request to display permissions. example in our todo list demo, we include an "enable notifications" button that, when pressed, requests notification permissio...
...!('permission' in notification)) { notification.permission = permission; } // set the button to shown or hidden, depending on what the user answers if(notification.permission === 'denied' || notification.permission === 'default') { notificationbtn.style.display = 'block'; } else { notificationbtn.style.display = 'none'; } } // let's check if the browser supports notifications if (!('notification' in window)) { console.log("this browser does not support notifications."); } else { if(checknotificationpromise()) { notification.requestpermission() .then((permission) => { handlepermission(permission); }) } else { notification.requestpermission(function(permission) { handlepermission(permission); ...
... to avoid duplicating code, we have stored a few bits of housekeeping code inside the handlepermission(...
...And 2 more matches
PerformanceResourceTiming.decodedBodySize - Web APIs
d content-codings. note: this feature is available in web workers. syntax resource.decodedbodysize; return value the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings. example the following example, the value of the size properties of all "resource" type events are logged. ...
...ers. syntax resource.decodedbodysize; return value the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings. example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the *size properties and print their values // if supported. ...
...ed content-codings. example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the *size properties and print their values // if supported. ...
...And 2 more matches
PerformanceResourceTiming.encodedBodySize - Web APIs
efore removing any applied content-codings. syntax resource.encodedbodysize; return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings. example the following example, the value of the size properties of all "resource" type events are logged. ...
... return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings. example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the performanceentry.*size properties and print their values // if supported. ...
...s. example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the performanceentry.*size properties and print their values // if supported. ...
...And 2 more matches
PerformanceResourceTiming.transferSize - Web APIs
-origin resource, this property returns zero. syntax resource.transfersize; return value a number representing the size (in octets) of the fetched resource. the size includes the response header fields plus the response payload body (rfc7230). example the following example, the value of size properties of all "resource" type events are logged. ...
...return value a number representing the size (in octets) of the fetched resource. the size includes the response header fields plus the response payload body (rfc7230). example the following example, the value of size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the performanceentry.*size properties and print their values // if supported. ...
...7230). example the following example, the value of size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the performanceentry.*size properties and print their values // if supported. ...
...And 2 more matches
PhotoCapabilities.imageHeight - Web APIs
syntax var mediasettingsrange = photocapabilities.imageheight value a mediasettingsrange object. specifications specification status comment mediastream image capturethe definition of 'imageheight' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...ibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
imageWidth - Web APIs
syntax var mediasettingsrange = photocapabilities.imagewidth value a mediasettingsrange is an object. specifications specification status comment mediastream image capturethe definition of 'imagewidth' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. ...
...tibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Multi-touch interaction - Web APIs
this additional feature can be used to provide richer user interaction models but at the cost of additional complexity in the multi-touch interaction handling. ...
...ious pointing input devices such as pen/stylus and touch screens as well as mouse. the pointer is a hardware-agnostic device that can target a specific set of screen coordinates. having a single event model for pointers can simplify creating web sites, applications and provide a good user experience regardless of the user's hardware. pointer events have many similarities to mouse events but they support multiple simultaneous pointers such as multiple fingers on a touch screen. this additional feature can be used to provide richer user interaction models but at the cost of additional complexity in the multi-touch interaction handling. this document demonstrates via example code, using pointer events with different multi-touch interactions. a live version of this application is available on g...
...nteractions. define touch targets the application uses <div> to define three different touch target areas. <style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } </style> global state to support multi-touch interaction, preserving a pointer's event state during various event phases is required. this application uses three arrays to cache event state, one cache per target element. // log events flag var logevents = false; // event caches, one per touch target var evcache1 = new array(); var evcache2 = new array(); var evcache3 = new array(); register event handlers event handlers...
...And 2 more matches
RTCConfiguration - Web APIs
server, such as a stun or turn server. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". constants rtcbundlepolicy enum the rtcbundlepolicy enum defines string constants which are used to request a specific policy for gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a sing...
...r gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. if the remote endpoint is bundle-aware, all media tracks and data channels are bundled onto a single transport at the completion of negotiation, regardless of policy used, and any superfluous transports that were created initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant description "balanced" the ice agent initially creates on...
...ice candidates with public ip addresses will be considered. removed from the specification's may 13, 2016 working draft. "relay" only ice candidates whose ip addresses are being relayed, such as those being passed through a turn server, will be considered. rtcrtcpmuxpolicy enum the rtcrtcpmuxpolicy enum defines string constants which specify what ice candidates are gathered to support non-multiplexed rtcp. <<<add a link to info about multiplexed rtcp. constant description "negotiate" instructs the ice agent to gather both rtp and rtcp candidates. if the remote peer can multiplex rtcp, then rtcp candidates are multiplexed atop the corresponding rtp candidates. otherwise, both the rtp and rtcp candidates are returned, separately. "requir...
...And 2 more matches
RTCPeerConnection - Web APIs
d to the other peer.close() the rtcpeerconnection.close() method closes the current peer connection.createanswer() the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection. the answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process.createdatachannel() the createdatachannel() method on the rtcpeerconnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted.createoffer()th...
...r gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. if the remote endpoint is bundle-aware, all media tracks and data channels are bundled onto a single transport at the completion of negotiation, regardless of policy used, and any superfluous transports that were created initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant description "balanced" the ice agent initially creates on...
...tion is in the "failed" state. "closed" the rtcpeerconnection is closed. this value was in the rtcsignalingstate enum (and therefore found by reading the value of the signalingstate) property until the may 13, 2016 draft of the specification. rtcrtcpmuxpolicy enum the rtcrtcpmuxpolicy enum defines string constants which specify what ice candidates are gathered to support non-multiplexed rtcp. <<<add a link to info about multiplexed rtcp. constant description "negotiate" instructs the ice agent to gather both rtp and rtcp candidates. if the remote peer can multiplex rtcp, then rtcp candidates are multiplexed atop the corresponding rtp candidates. otherwise, both the rtp and rtcp candidates are returned, separately. "requir...
...And 2 more matches
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). a guide to codecs supported by webrtc—and each codec's positive and negative characteristics—can be found in codecs used by webrtc. syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs. if codecs is empty, the codec configurations are all returned...
...ed codecs. if codecs is empty, the codec configurations are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. ...
... returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. return value undefined exceptions invalidaccesserror the codecs list includes one or more codecs which are not supported by the transceiver. usage notes getting a list of supported codecs you can only include in the codecs list codecs which the transceiver actually supports. that means that either the associated rtcrtpsender or the rtcrtpreceiver needs to support every codec in the list. if any unsupported codecs are listed, the browser will throw an invalidaccesserror exception when you call this method. a good approach to setting codec preferences is to first get ...
...And 2 more matches
SVGAnimatedPathData - Web APIs
svg animated path data interface the svganimatedpathdata interface supports elements which have a 'd' attribute which holds svg path data, and supports the ability to animate that attribute. interface overview also implement none methods none properties svgpathseglist animatednormalizedpathseglist svgpathseglist animatedpathseglist svgpathseglist normalizedpathseglist svgpathseglist pathseglist normative document svg 1.1 (2nd edition) properties this interface also inherits prope...
... opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...And 2 more matches
SVGFitToViewBox - Web APIs
svg fit to view box interface the svgfittoviewbox interface is used to reflect the viewbox and preserveaspectratio attributes, and is mixed in to other interfaces for elements that support these two attributes. interface overview also implement none methods none properties svganimatedpreserveaspectratio preserveaspectratio svganimatedrect viewbox normative document svg 1.1 (2nd edition) properties name type description ...
... opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...And 2 more matches
SVGSVGElement - Web APIs
n the coordinate system of the parent document. (if the parent uses css or xsl layout, then unitless values represent pixel units for the current css or xsl viewport.) svgsvgelement.pixelunittomillimeterx a float representing the size of the pixel unit (as defined by css2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium. on systems where it is impossible to know the size of a pixel, a suitable default pixel size is provided. svgsvgelement.pixelunittomillimetery a float representing the size of a pixel unit along the y-axis of the viewport. svgsvgelement.screenpixeltomillimeterx user interface (ui) events in dom level 2 indicate the s...
...s from its parent, svggraphicselement and also implements the ones from svgzoomandpan, svgfittoviewbox, and windoweventhandlers. svgsvgelement.suspendredraw() takes a time-out value which indicates that redraw shall not occur until: the corresponding unsuspendredraw() call has been made, an unsuspendredrawall() call has been made, or its timer has timed out. in environments that do not support interactivity (e.g., print media), then redraw shall not be suspended. calls to suspendredraw() and unsuspendredraw() should, but need not be, made in balanced pairs. to suspend redraw actions as a collection of svg dom changes occur, precede the changes to the svg dom with a method call similar to: const suspendhandleid = suspendredraw(maxwaitmilliseconds) and follow the changes with a...
...w() by providing a unique suspend handle id that was returned by a previous suspendredraw() call. svgsvgelement.unsuspendredrawall() cancels all currently active suspendredraw() method calls. this method is most useful at the very end of a set of svg dom calls to ensure that all pending suspendredraw() method calls have been cancelled. svgsvgelement.forceredraw() in rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the viewport that require updating. svgsvgelement.pauseanimations() suspends (i.e., pauses) all currently running animations that are defined within the svg document fragment corresponding to this <svg> element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.
...And 2 more matches
SubtleCrypto.deriveKey() - Web APIs
er key. it takes as arguments some initial key material, the derivation algorithm to use, and the desired properties for the key to derive. it returns a promise which will be fulfilled with a cryptokey object representing the new key. it's worth noting that the three key derivation algorithms you can use have quite different characteristics and are appropriate in quite different situations. see supported algorithms for some more detail on this. syntax const result = crypto.subtle.derivekey( algorithm, basekey, derivedkeyalgorithm, extractable, keyusages ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdhkeyderiveparams object. to use hkdf, pass an hkdfparams object. to use pbkdf2, pass a pbkdf2param...
.... "unwrapkey": the key may be used to unwrap a key. return value result is a promise that fulfills with a cryptokey. exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the master key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey. ...
... ecdh ecdh (elliptic curve diffie-hellman) is a key-agreement algorithm. ...
...And 2 more matches
SubtleCrypto.wrapKey() - Web APIs
to use aes-kw, pass the string "aes-kw", or an object of the form { "name": "aes-kw }. return value result is a promise that fulfills with an arraybuffer containing the encrypted exported key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the wrapping key is not a key for the requested wrap algorithm. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. typeerror raised when trying to use an invalid format. supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the "wrapkey" usage set. for key wrapping you have the additional option of aes-kw. aes-kw aes-kw ...
... a multiple of 64 bits. aes-kw is specified in rfc 3394. examples note: you can try the working examples out on github. raw wrap this example wraps an aes key. it uses "raw" as the export format and aes-kw, with a password-derived key, to encrypt it. see the complete code on github. let salt; /* get some key material to use as input to the derivekey method. the key material is a password supplied by the user. */ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-kw key using pbkdf2. */ function getkey(keymate...
... return wrapcryptokey(secretkey); }) .then((wrappedkey) => { console.log(wrappedkey); }); pkcs #8 wrap this example wraps an rsa private signing key. it uses "pkcs8" as the export format and aes-gcm, with a password-derived key, to encrypt it. see the complete code on github. let salt; let iv; /* get some key material to use as input to the derivekey method. the key material is a password supplied by the user. */ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-gcm key using pbkdf2. */ function getkey(keymat...
...And 2 more matches
Multi-touch interaction - Web APIs
however, the interfaces can be a bit tricky for programmers to use because touch events are very different from other dom input events, such as mouse events. the application described in this guide shows how to use touch events for simple single and multi-touch interactions, the basics needed to build application-specific gestures. a live version of this application is available on github. the source code is available on github and pull requests and bug reports are welcome. ...
...the code does not include error handling, or vertical moving. note that the threshold for pinch and zoom movement detection is application specific (and device dependent). // this is a very basic 2-touch move/pinch/zoom handler that does not include // error handling, only handles horizontal moves, etc. function handle_pinch_zoom(ev) { if (e...
...it also calls preventdefault() to keep the browser from applying further event handling (for example, mouse event emulation). function start_handler(ev) { // if the user makes simultaneous touches, the browser will fire a // separate touchstart event for each touch point. thus if there are // three simultaneous touches, the first touchstart event will have // targettouc...
...And 2 more matches
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ithub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
WebGLRenderingContext - Web APIs
the webglrenderingcontext interface provides an interface to the opengl es 2.0 graphics rendering context for the drawing surface of an html <canvas> element. to get an access to a webgl context for 2d and/or 3d graphics rendering, call getcontext() on a <canvas> element, supplying "webgl" as the argument: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); once you have the webgl rendering context for a canvas, you can render within it. the webgl tutorial has more information, examples, and resources on how to get started with webgl. if you require a webgl 2.0 context, see webgl2renderingcontext; this supplies access to an implementation of opengl es 3.0 graphics. constants see the webgl constants page. the webgl context the following properties...
...lrenderingcontext.drawelements() renders primitives from element array data. webglrenderingcontext.finish() blocks execution until all previously called commands are finished. webglrenderingcontext.flush() empties different buffer commands, causing all commands to be executed as quickly as possible. working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions. webglrenderingcontext.getextension() returns an extension object. examples webgl context feature detection in this first example we are going to check whether the browser supports webgl. to that end we will try to obtain the webgl rendering context from a canvas element. the webgl rendering co...
...ctual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. ...
...And 2 more matches
Compressed texture formats - Web APIs
the webgl api provides methods to use compressed texture formats. these are useful to increase texture detail while limiting the additional video memory necessary. by default, no compressed formats are available: a corresponding compressed texture format extension must first be enabled. usage unless otherwise specified, this article applies to both webgl 1 and 2 contexts. if supported, textures can be stored in a compressed format in video memory. this allows for additional detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. note that this advantage doesn't translate to network bandwidth: while the formats are better than uncompressed data, they are in general far worse than standard image formats such as png...
... memory. this allows for additional detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. note that this advantage doesn't translate to network bandwidth: while the formats are better than uncompressed data, they are in general far worse than standard image formats such as png and jpg. ...
...ccessed by a shader. note that this advantage doesn't translate to network bandwidth: while the formats are better than uncompressed data, they are in general far worse than standard image formats such as png and jpg. as compressed textures require hardware support, therefore no specific formats are required by webgl; instead, a context can make different formats available, depending on hardware support. this site shows which formats are supported in the used browser. usage of compressed formats first requires activating the respective extension with webglrenderingcontext.getextension(). if supported, it will return an extension object with constants for the added formats and the formats will also be returned by calls to gl.getparameter(gl.compressed_texture_formats). (e.g. ext.compressed_r...
...And 2 more matches
WebXR Device API - Web APIs
the webxr device api implements the core of the webxr feature set, managing the selection of output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. ...
...nd the right eye's viewpoint rendered into the right half of the buffer. once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to the webxr device to be presented to the user through their headset or other appropriate display device. webxr device api concepts and usage example webxr hardware setup while the older webvr api was designed solely to support virtual reality (vr), webxr provides support for both vr and augmented reality (ar) on the web. support for ar functionality is added by the webxr augmented reality module. a typical xr device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor. the equipment may also include an accelerometer, barometer, or other sensors which are used to sens...
...rspace which is used to identify a spatial relationship in relation to the user's physical environment. the xrreferencespace coordinate system is expected to remain unchanged through the lifespan of the xrsession.the world has no boundaries and extends infinitely in every direction. xrboundedreferencespace xrboundedreferencespace extends the xrreferencespace coordinate system to further include support for a finite world with set boundaries. unlike xrreferencespace, the origin must be located on the floor (that is, y = 0 at the floor). the x and z components of the origin are typically presumed to be located at or near the center of the room or surface. xrview represents a single view into the xr scene for a particular frame. each xrview corresponds to the video display surface used to pr...
...And 2 more matches
Using the Web Animations API - Web APIs
m-heavy techniques such as writing css properties and scoping classes onto elements to control playback direction. and unlike pure, declarative css, javascript also lets us dynamically set values from properties to durations. for building custom animation libraries and creating interactive animations, the web animations api might be the perfect tool for the job. let's see what it can do! browser support the basic web animations api features discussed in this article are available by default in firefox 48+ and chrome 36+. safari supports web animations in its technology preview version and there is also a handy polyfill that tests for feature support and adds it where necessary. writing css animations with the web animations api one of the more familiar ways to approach learning the web an...
... the object, separated from the declaration with a comma. in the above example, to make sure that alice’s color changes at 30% (not 50%) for the color change, we are giving it offset: 0.3. currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence). if your keyframe list has only one entry, element.animate() may throw a notsupportederror exception in some browsers until they are updated. so to recap, the keys are equally spaced by default unless you specify an offset on a key. handy, no? representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s animation: var alicetiming = { duration: 3000, itera...
...pending on which third it falls into var aliceheight = aliceplayhead / alicetimeline; if (aliceheight <= .333){ // alice got smaller! ... } else if (aliceheight >= .666) { // alice got bigger! ... } else { // alice didn't change significantly ... } } note: getanimations() and effect are not shipping in all browsers as of this writing, but the polyfill does support them today. callbacks and promises css animations and transitions have their own event listeners, and these are also possible with the web animations api: onfinish is the event handler for the finish event and can be triggered manually with finish(). oncancel is the event handler for the cancel event and can be triggers with cancel(). here we set the callbacks for the cake, bottle, a...
...And 2 more matches
Using the Web Storage API - Web APIs
ge maintains a separate storage area for each given origin that's available for the duration of the page session (as long as the browser is open, including page reloads and restores). localstorage does the same thing, but persists even when the browser is closed and reopened. these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties are members of) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved, and removed. a different storage object is used for the sessionstorage and localstorage for each origin —...
...for each origin — they function and are controlled separately. so, for example, initially calling localstorage on a document will return a storage object; calling sessionstorage on a document will return a different storage object. both of these can be manipulated in the same way, but separately. ...
...fferent storage object. both of these can be manipulated in the same way, but separately. feature-detecting localstorage to be able to use localstorage, we should first verify that it is supported and available in the current browsing session. testing for availability note: this api is available in current versions of all major browsers. testing for availability is necessary only if you must support very old browsers, such as internet explorer 6 or 7, or in the limited circumstances described below. browsers that support localstorage have a property on the window object named localstorage. however, just asserting that that property exists may throw exceptions. if the localstorage object does exist, there is still no guarantee that the localstorage api is actually available, as various ...
...And 2 more matches
Window.minimize() - Web APIs
Web › API › Window › minimize
ompatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...s://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Window.routeEvent() - Web APIs
Web › API › Window › routeEvent
table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...om/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Window.setCursor() - Web APIs
Web › API › Window › setCursor
mpatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...a. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Window.updateCommands() - Web APIs
bility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ub.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
Synchronous and asynchronous requests - Web APIs
in general, however, asynchronous requests should be preferred to synchronous requests for performance reasons. synchronous requests block the execution of code which causes "freezing" on the screen and an unresponsive user experience. asynchronous request if you use an asynchronous xmlhttprequest, you receive a callback when the data has been received. this lets the browser continue to work as normal while your request is being handled. example: send a file to the console log this is the simplest usage of asynchronous xmlhttprequest. ...
... the xhr object (via the arguments property) to the success callback function. line 1 declares a function invoked when the xhr operation completes successfully. it, in turn, invokes the callback function specified in the invocation of the loadfile function (in this case, the function showmessage) which has been assigned to a property of the xhr object (line 11). the additional arguments (if any) supplied to the invocation of function loadfile are "applied" to the running of the callback function. line 5 declares a function invoked when the xhr operation fails to complete successfully. line 11 stores the success callback given as the second argument to loadfile in the xhr object's callback property. line 12 slices the arguments array given to the invocation of loadfile. starting with the t...
...uccessfully. line 11 stores the success callback given as the second argument to loadfile in the xhr object's callback property. line 12 slices the arguments array given to the invocation of loadfile. starting with the third argument, all remaining arguments are collected, assigned to the arguments property of the variable xhr, passed to the success callback function xhrsuccess., and ultimately supplied to the callback function (in this case, showmessage) which is invoked by function xhrsuccess. line 15 specifies true for its third parameter to indicate that the request should be handled asynchronously. line 16 actually initiates the request. example: using a timeout you can use a timeout to prevent your code from hanging while waiting for a read to finish. this is done by setting the v...
...And 2 more matches
ARIA - Accessibility
for example, aria enables accessible navigation landmarks in html4, javascript widgets, form hints and error messages, live content updates, and more. ...
...ssbar.setattribute("aria-valuenow", percentcomplete); } note that aria was invented after html4, so does not validate in html4 or its xhtml variants. however, the accessibility gains it provides far outweigh any technical invalidity. in html5, all aria attributes validate. the new landmark elements (<main>, <header>, <nav> etc) have built-in aria roles, so there is no need to duplicate them. ...
...ria was invented after html4, so does not validate in html4 or its xhtml variants. however, the accessibility gains it provides far outweigh any technical invalidity. in html5, all aria attributes validate. the new landmark elements (<main>, <header>, <nav> etc) have built-in aria roles, so there is no need to duplicate them. support like any other web technology, there are varying degrees of support for aria. support is based on the operating system and browser being used, as well as the kind of assistive technology interfacing with it. in addition, the version of the operating system, browser, and assistive technology are contributing factors. older software versions may not support certain aria roles, have only partial support, or misreport its functionality. it is also important to a...
...And 2 more matches
Architecture - Accessibility
at's to find its position within that text, because the hyperlink interface exposes a start and end index. in fact, the end index will always be 1 larger than the start index, because the object is always represented by a single '\xfffc' character. if you want to know that something is really a link, check to see if it is role_link. html containers are implemented by nshypertextaccessible. they support the nsiaccessiblehypertext is implemented on any container element that has both text and embedded objects for accessible children. why hyperlink is often not a link as explained above, anything that is embedded in text implements the hyperlink interface. while it is odd to call non-link objects a link, this was a necessary compromise in the newatk design because it is necessary to know wher...
...objects a link, this was a necessary compromise in the newatk design because it is necessary to know where objects exist within their containing text. previously the hyper link interface was really only for links, but the design could not fully represent an html document hierarchy. keeping the link name of the interface is unfortunate but necessary for backwards compatibility, without introducing superfluous interfaces. api comparison nsiaccessible (internal). when you have an nsiaccessiblehypertext, you can ask for its links, which is the subset of children from the nsiaccessible hierarchy that are not text or whitespace. atk: same as nsiaccessible, except that text and whitespace leaf nodes are not exposed. the children of any hypertext object are an exact match to the links it exposes...
...bles. see the atk uses of isembeddedobject() for more information on how we do this. iaccessible2: same as nsiaccessible. text and whitespace leaf nodes are exposed, but are redundant with the information in the parent object's nsiaccessibletext. this is done for backward compatibility with older msaa clients which didn't have access to a text interface. the children of a hypertext object are a superset of the links it exposes. the new system makes it easier to show caret positions etc., which will be an improvement in ia2 over msaa. example take the following html code: <div>hello<a href="http://www.mozilla.org/access">my link<img src="image.gif">is cool</a>bye</div> both the <a> and <img> are hyperlinks also, both the <div> and <a> are hypertexts so the <a> is both a hypertext and a hy...
...And 2 more matches
@import - CSS: Cascading Style Sheets
Web › CSS › @import
the @import css at-rule is used to import style rules from other style sheets. syntax @import url; @import url list-of-media-queries; @import url supports( supports-query ); @import url supports( supports-query ) list-of-media-queries; where: url is a <string> or a <url> representing the location of the resource to import. the url may be absolute or relative. note that the url for a mozilla package need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information. ...
...ote that the url for a mozilla package need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. ...
... file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. if the browser does not support any these queries, it does not load the linked resource. supports-query is either a <supports-condition> or a <declaration>. description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional i...
...And 2 more matches
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
firefox initially implemented an early version of the scroll snap specification, called scroll snap points. in firefox 68 the new version of the specification will be shipped and these old properties removed. in this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your web site or app. what should i do if i used the old firefox implementation? if you have only used the old firefox implementation of the specification, with the properties that are detailed in scroll snap points, you should update your code to use the new specification. this will ensure your scroll snapping works in all browsers which implement the specification, including firefox. if you do not do this your scroll snappi...
...fox 68 and up. the main things to note are as follows: the scroll-snap-type-x and scroll-snap-type-y properties have been dropped the scroll-snap-type property has become a longhand, so the old shorthand syntax like scroll-snap-type:mandatory will stop working can i use the old implementation as a fallback? if you have already used the old implementation as a fallback, or feel you want to support users of old firefox (or -webkit prefixed safari), then you can continue to use the old specification as outlined in the example below. in this initial example we have used the old specification alongside the current specification in order to make scroll snapping work in all browsers which support some form of scroll snapping. the example adds the scroll-snap-points-y and scroll-snap-destin...
... do i need to use both specs? scroll snapping is one of those nice parts of css in which the fallback is that you don't get the enhanced functionality, but everything still works. ...
...And 2 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
Web › CSS › Cascade
rs, 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 descriptor. if several @font-face rules with the same descriptor are defined, only the most appropriate @font-face, as a whole, is considered. while the declarations contained in most at-rules — such as those in @media, @document, or @supports — participate in the cascade, declarations contained in @keyframes don't. as with @font-face, only the at-rule as a whole is selected via the cascade algorithm. finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm. origin of css declarations the css cascade algorithm's job is to select css declarations in order to determine the co...
...no declaration is marked as !important, so the precedence order is author style sheets before user style sheets or user-agent stylesheet. so three declarations are in competition: margin-left: 0 margin-left: 3px margin-left: 1px the last one is ignored (on a screen), and the...
...no declaration is marked as !important, so the precedence order is author style sheets before user style sheets or user-agent stylesheet. so three declarations are in competition: margin-left: 0 margin-left: 3px margin-left: 1px the last one is ignored (on a screen), and the first t...
...And 2 more matches
<color> - CSS: Cascading Style Sheets
type in detail. to learn more about using color in html, see applying color to html elements using css. syntax the <color> data type is specified using one of the options listed below. note: although <color> values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device. this is because most devices are not calibrated, and some browsers do not support output devices' color profiles. color keywords color keywords are case-insensitive identifiers that represent a specific color, such as red, blue, black, or lightseagreen. although the names more or less describes their respective colors, they are essentially artificial, without a strict rationale behind the names used. there are a few caveats to consider when using color keywords: htm...
...heir specific hardware. note: the list of accepted keywords has undergone many changes during the evolution of css: css level 1 only included 16 basic colors, called the vga colors as they were taken from the set of displayable colors on vga graphics cards. css level 2 added the orange keyword. although various colors not in the specification (mostly adapted from the x11 colors list) were supported by early browsers, it wasn't until svg 1.0 and css colors level 3 that they were formally defined. they are called the extended color keywords, the x11 colors, or the svg colors. css colors level 4 added the rebeccapurple keyword to honor web pioneer eric meyer. specification keyword rgb hex value live keyword css level 1 black #000000 s...
.... for example, #0f38 is the same color as #00ff3388. functional notation: rgb[a](r, g, b[, a]) r (red), g (green), and b (blue) can be either <number>s or <percentage>s, where the number 255 corresponds to 100%. a (alpha) can be a <number> between 0 and 1, or a <percentage>, where the number 1 corresponds to 100% (full opacity). functional notation: rgb[a](r g b[ / a]) css colors level 4 adds support for space-separated values in the functional notation. hsl colors the hsl color model defines a given color according to its hue, saturation, and lightness components. an optional alpha component represents the color's transparency. many designers find hsl more intuitive than rgb, since it allows hue, saturation, and lightness to each be adjusted independently. hsl can also make it easier...
...And 2 more matches
display - CSS: Cascading Style Sheets
Web › CSS › display
becomes the first inline box of the block box that follows it. run-in elements act like inlines or blocks, depending on the surrounding elements. that is: if the run-in box contains a block box, same as block. if a block box follows the run-in box, the run-in box becomes the first inline box of the block box. if an inline box follows, the run-in box becomes a block box. note: browsers that support the two value syntax, on finding the outer value only, such as when display: block or display: inline is specified, will set the inner value to flow. this will result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. inside <display-inside> these keywords s...
...ex the element behaves like a block element and lays out its content according to the flexbox model. grid the element behaves like a block element and lays out its content according to the grid model. ruby the element behaves like an inline element and lays out its content according to the ruby formatting model. it behaves like the corresponding html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. list item <display-listitem> the element generates a ...
...lay-listitem> the element generates a block box for the content and a separate list-item inline box. a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. internal <display-internal> some layout models such as table and ruby have a complex internal structure, with several different roles that their children and descendants can fill. this section defines those "internal" d...
...And 2 more matches
image() - CSS: Cascading Style Sheets
disambiguation: image(), the htmlimageelement constructor. ...
...mber> | <percentage><hue> = <number> | <angle> where: image-tagsoptional the directionality of the image, either ltr for left-to-right or rtl for right-to-left. image-src optional zero or more <url>s or <string>s specifying the image sources, with optional image fragment identifiers. coloroptional 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, optional parameter of the image() notation is the directionality of the image. if included, and the image is used on an element with opposite directionality, the image will be flipped horizontally in horizontal writing modes. if the directionality is omitted, the image won't be flipped if the language direction is changed. image fragment...
...x tall. the #xywh=#,#,#,# media fragment syntax takes four comma separated numeric values. the first two represent the x and y coordates for the starting point of the box that will be created. the third value is the width of the box, and the last value is the height. by default, these are pixel values. the spacial dimension definition in the media specification indicates that percentages will be supported as well: xywh=160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=pixel:160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=percent:25,25,50,50 /* results in a 50%x50% image at x=25% and y=25% */ the image fragments can be used in url() notation as well. the #xywh=#,#,#,# media fragment syntax is 'backwards compatible' in that a media f...
...And 2 more matches
list-style-type - CSS: Cascading Style Sheets
added by initial zeros e.g. 01, 02, 03, … 98, 99 lower-roman lowercase roman numerals e.g. i, ii, iii, iv, v… upper-roman uppercase roman numerals e.g. i, ii, iii, iv, v… lower-greek lowercase classical greek alpha, beta, gamma… e.g. α, β, γ… lower-alpha lower-latin lowercase ascii letters e.g. ...
... numerals e.g. i, ii, iii, iv, v… lower-greek lowercase classical greek alpha, beta, gamma… e.g. α, β, γ… lower-alpha lower-latin lowercase ascii letters e.g. a, b, c, … z lower-latin is unsupported in ie7 and earlier see browser compatibility section. upper-alpha upper-latin uppercase ascii letters e.g. ...
...åƒäø€ē™¾äø€åäø€ upper-armenian * example disclosure-open symbol indicating that a disclosure widget such as <details> is opened. disclosure-closed symbol indicating that a disclosure widget, like <details> is closed. non-standard extensions a few more predefined types are provided by mozilla (firefox), blink (chrome and opera) and webkit (safari) to support list types in other languages. see the compatibility table to check which browsers supports which extension. -moz-ethiopic-halehame example -moz-ethiopic-halehame-am example ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-er example ethiopic-halehame-ti-et -moz-ethiopic-halehame-ti-et example hangul -moz-hangul example example exam...
...And 2 more matches
vertical-align - CSS: Cascading Style Sheets
for example, it could be used to vertically position an <img> in a line of text: <p> top:<img style="vertical-align:top" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> middle:<img style="vertical-align:middle" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> bottom:<img style="vertical-align:bottom" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> super:<img style="vertical-align:super" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> sub:<img style="vertical-align:sub" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> </p> <p> text-top:<img style="vertical-align:text-top" src="https://udn.realityripple.com/samples/16/ed9c61c3b6.png"/> text-bottom:<img style="vertical-align:text-bottom" src="https://udn.realityrip...
... margin-left: auto; margin-right: auto; width: 80%; } table, th, td { border: 1px solid black; } td { padding: 0.5em; font-family: monospace; } note that vertical-align only applies to inline, inline-block and table-cell elements: you can't use it to vertically align block-level elements. ...
...ertically align the element relative to its parent element: baseline aligns the baseline of the element with the baseline of its parent. the baseline of some replaced elements, like <textarea>, is not specified by the html specification, meaning that their behavior with this keyword may vary between browsers. sub aligns the baseline of the element with the subscript-baseline of its parent. super aligns the baseline of the element with the superscript-baseline of its parent. text-top aligns the top of the element with the top of the parent element's font. text-bottom aligns the bottom of the element with the bottom of the parent element's font. middle aligns the middle of the element with the baseline plus half the x-height of the parent. <length> aligns the baseline of the ele...
...And 2 more matches
HTML5 Parser - Developer guides
Web › Guide › HTML › HTML5 › HTML5 Parser
x’s main ui thread, improving overall browser responsiveness. calls to innerhtml are a lot faster. dozens of long-standing parser related bugs are now fixed. the html5 specification provides a more detailed description than previous html standards of how to turn a stream of bytes into a dom tree. this will result in more consistent behavior across browser implementations. in other words, in supporting html5, gecko, webkit, and internet explorer (ie) will behave more consistently with each other. changed parser behaviors some changes to the way that the gecko 2 parser behaves, as compared to earlier versions of gecko, may affect web developers, depending on how you've written your code in the past and what browsers you've tested it on. tokenization of left angle-bracket within a tag ...
.... for example, if the document lacked a </title> closing tag, the parser would reparse to look for the first '<' in the document, or if a comment was not closed, it would look for the first '>'. this behavior created a security vulnerability. if an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in addition, supporting reparsing led to unnecessarily complex parsing code. with html5, parsers no longer reparse documents. this change has the following consequences for web developers: if you omit the closing tag for <title>, <style>, <textarea>, or <xmp>, the page will fail to be parsed. ie already fails to parse documents with a missing </title> tag, so if you test with ie, you probably don't have that ...
...ther, so it's unlikely that you have this issue in sites that are tested in multiple browsers. in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--. the older practice of escaping the string </script> by surrounding it with comment markers, while supported by html5, is problematic in cases where the closing comment marker is omitted (see preceding point). you can avoid such problems by using the character code for the initial '<' instead. (it is valid to use an escape character, e.g., <\/script>, but this strategy does not work for <script and <!--, because \s and \! are not valid javascript escapes; the character code strategy is more genera...
...And 2 more matches
HTML5 - Developer guides
Web › Guide › HTML › HTML5
n the classical paradigm where the server could send data only in response to a client's request. webrtc this technology, where rtc stands for real-time communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application. offline & storage offline resources: the application cache firefox fully supports the html5 offline resource specification. most others have offline resource support at some level. online and offline events firefox 3 supports whatwg online and offline events, which let applications and extensions detect whether or not there's an active internet connection, as well as to detect when the connection goes up and down. whatwg client-side session and persistent storage (aka ...
... down. whatwg client-side session and persistent storage (aka dom storage) client-side session and persistent storage allows web applications to store structured data on the client side. indexeddb indexeddb is a web standard for the storage of significant amounts of structured data in the browser and for high performance searches on this data using indexes. using files from web applications support for the new html5 file api has been added to gecko, making it possible for web applications to access local files selected by the user. this includes support for selecting multiple files using the <input> of type file html element's new multiple attribute. there also is filereader. multimedia using html5 audio and video the <audio> and <video> elements embed and allow the manipulation o...
...onferencing directly in the browser, without the need for a plugin or an external application. track and webvtt the <track> element allows subtitles and chapters. webvtt is a text track format. 2d/3d graphics and effects canvas tutorial learn about the new <canvas> element and how to draw graphs and other objects in firefox. html5 text api for <canvas> elements the html5 text api is now supported by <canvas> elements. webgl webgl brings 3d graphics to the web by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. svg an xml-based format of vectorial images that can directly be embedded in the html. performance and integration web workers allows delegation of javascript evaluation to background threads, allowing these act...
...And 2 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
the type of relationships is given by the value of the rel attribute, which, if present, must have a value that is an unordered set of unique space-separated keywords, which are listed in the following table. every keyword within a space seperated value should be unique within that value. ...
... to the current document. not allowed link not allowed the rel attribute is relevant to the <link>, <a>, <area>, and <form> elements, but some values only relevant to a subset of those elements. like all html keyword attribute values, these values are case-insenstive. the rel attribute has no default value. if the attribute is omitted or if none of the values in the attribute are supported, then the document has no particular relationship with the destination resource other than there being a hyperlink between the two. in this case, on <link> and <form>, if the rel attribute is absent, has no keywords, or if not one or more of the space-separated keywords above, then the element does not create any links. <a> and <area> will still created links, but without a defined relation...
...onship. like all html keyword attribute values, these values are case-insenstive. values if there are multiple <link rel="icon">s, the browser uses their media attribute, type, and sizes attributes to select the most appropriate icon. if several icons are equally appropriate, the last one is used. if the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on. note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder. instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. the shortcut link type is often seen before icon, but this...
...And 2 more matches
HTML attribute: required - HTML: Hypertext Markup Language
the boolean required attribute which, if present, indicates that the user must specify a value for the input before the owning form can be submitted. the required attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <input> types along with the <select> and <textarea> form control elements. if present on any of these input types and elements, the :required pseudo class will match. if the attribute is not included, the :optional pseudo class will match. ...
...ribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, number, checkbox, radio, file, <input> types along with the <select> and <textarea> form control elements. if present on any of these input types and elements, the :required pseudo class will match. if the attribute is not included, the :optional pseudo class will match. the attribute is not supported or relevant to range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a form that is hidden. nor is it supported on any of the button types, including image. ...
...equired pseudo class will match. if the attribute is not included, the :optional pseudo class will match. the attribute is not supported or relevant to range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a form that is hidden. nor is it supported on any of the button types, including image. note color and range don't support required, but type color defaults to #00000, and range defaults to the midpoint between min and max -- with min and max defaulting to 0 and 100 respectively in most browsers if not declared -- so always has a value. ...
...And 2 more matches
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
custom color picker window. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a 7-character domstring specifying a <color> in lower-case hexadecimal notation events change and input supported common attributes autocomplete and list idl attributes list and value methods select() value the value of an <input> element of type color is always a domstring which contains a 7-character string specifying an rgb color in hexadecimal format. while you can input the color in either upper- or lower-case, it will be stored in lower-case form. the value is n...
...tting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000. in particular, you can't use css's standardized color names, or any css function syntax, to set the value. this makes sense when you keep in mind that html and css are separate languages and specifications. in addition, colors with an alpha channel are not supported; specifying a color in 9-character hexadecimal notation (e.g. #009900aa) will also result in the color being set to #000000. note: any web browser that doesn't support an input of type color will naturally fall back to the type text. because users can write colors in many different ways (such as rgb(255, 255, 0)), one way to work around this is to set a pattern attribute equal to either ...
...set a pattern attribute equal to either #[0-9a-f]{6} or #[0-9a-fa-f]{6} (preferably the latter because some users may not expect a different result with just a letter-case change) and set a placeholder attribute equal to a color representing the expected format of the user's input, such as #ff0000. using color inputs inputs of type color are simple, due to the limited number of attributes they support. providing a default color you can update the simple example above to set a default value, so that the color well is pre-filled with the default color and the color picker (if any) will also default to that color: <input type="color" value="#ff0000"> if you don't specify a value, the default is #000000, which is black. the value must be in seven-character hexadecimal notation, meaning t...
...And 2 more matches
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
be styled differently by the user agent. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the value contained in the search field. events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, required, size. idl attributes value methods select(), setrangetext(), setselectionrange(). value the value attribute contains a domstring representing the value contained in the search field. you can retrieve this using the htmlinputelement.value property in javascript. sea...
.... you can retrieve this using the htmlinputelement.value property in javascript. searchterms = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). ...
...bute is a string which indicates whether or not to activate automatic correction while the user is editing this field. permitted values are: on enable automatic correction of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. incremental the boolean attribute incremental is a webkit and blink extension (so supported by safari, opera, chrome, etc.) which, if present, tells the user agent to process the input as a live search. as the user edits the value of the field, the user agent sends search events to the htmlinputelement object representing the search box. this allows your code to update the search results in real time as the user edits the search. if incremental is not specified, the search event ...
...And 2 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
policy applies to the favicon. if you encounter problems with the favicon not loading, verify that the content-security-policy header's img-src directive is not preventing access to it. the html and xhtml specifications define event handlers for the <link> element, but it is unclear how they would be used. under xhtml 1.0, empty elements such as <link> require a trailing slash: <link />. webtv supports the use of the value next for rel to preload the next page in a document series. attributes this element includes the global attributes. as this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security poli...
...ernal stylesheets — it allows the user agent to pick the best adapted one for the device it runs on. notes: in html 4, this can only be a simple white-space-separated list of media description literals, i.e., media types and groups, where defined and allowed as values for this attribute, such as print, screen, aural, braille. html5 extended this to any kind of media queries, which are a superset of the allowed values of html 4. browsers not supporting css3 media queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in html 4. referrerpolicy a string indicating which referrer to use when fetching the resource: no-referrer means that the referer header will not be sent. no-referrer-when...
...format <width in pixels>x<height in pixels> or <width in pixels>x<height in pixels>. each of these sizes must be contained in the resource. note: most icon formats are only able to store one single icon; therefore most of the time the sizes attribute contains only one entry. ms's ico format does, as well as apple's icns. ico is more ubiquitous, so you should use this format if cross-browser support is a concern (especially for old ie versions). title the title attribute has special semantics on the <link> element. when used on a <link rel="stylesheet"> it defines a preferred or an alternate stylesheet. incorrectly using it may cause the stylesheet to be ignored. type this attribute is used to define the type of the content linked to. the value of the attribute should be a mime t...
...And 2 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
Web › HTML › Element › source
the html <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. it is an empty element, meaning that it has no content and does not have a closing tag. it is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content none, it is an empty element. tag omission it must have a star...
...l fall back to using the image specified by the <picture> element's <img> child if it is unable to find a suitable image to use after examing every provided <source>. usage notes the <source> element is an empty element (or void element), which means that it not only has no content but also has no closing tag. that is, you never use "</source>" in your html. ...
...l. for information about image formats supported by web browsers and guidance on selecting appropriate formats to use, see our image file type and format guide on the web. for details on the video and audio media types, you can use, see the guide to media types formats used on the web. examples video example this example demonstrates how to offer a video in ogg format for users whose browsers support ogg format, and a quicktime format video for users whose browsers support that. if the audio or video element is not supported by the browser, a notice is displayed instead. if the browser supports the element but does not support any of the specified formats, an error event is raised and the default media controls (if enabled) will indicate an error. be sure to reference our guide to media t...
...And 2 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
lished using a mix of <td> (data cell) and <th> (header cell) elements. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. to provide additional control over how cells fit into (or span across) columns, both <th> and <td> support the colspan attribute, which lets you specify how many columns wide the cell should be, with the default being 1. similarly, you can use the rowspan attribute on cells to indicate they should span more than one table row. this can take a little practice to get right when building your tables. we have some examples below, but for more examples and an in-depth tutorial, see the html tables ser...
... align each cell in the row on a specific character (such that each row in the column that is configured this way will horizontally align its cells on that character). this uses the char and charoff to establish the alignment character (typically "." or "," when aligning numerical data) and the number of characters that should follow the alignment character. this alignment type was never widely supported. if no value is expressly set for align, the parent node's value is inherited. instead of using the obsolete align attribute, you should instead use the css text-align property to establish left, center, right, or justify alignment for the row's cells. to apply character-based alignment, set the css text-align property to the alignment character (such as "." or ","). bgcolor...
...y values for currencies that use hundredths of a unit (such as the dollar, which is divided into 100 cents), you would typically specify a value of 2, so that in tandem with char being set to ".", the values in a column would be cleanly aligned on the decimal points, with the number of cents properly displayed to the right of the decimal point. this attribute is obsolete, and was never widely supported anyway. valignobsolete since html5 a domstring specifying the vertical alignment of the text within each cell in the row. possible values for this attribute are: baseline aligns each cell's content text as closely as possible to the bottom of the cell, handling alignment of different fonts and font sizes by aligning the characters along the baseline of the font(s) used in ...
...And 2 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
ment extensions. also note that the full list of values the as attribute can take is governed by the fetch spec — see request destinations. including a mime type <link> elements can accept a type attribute, which contains the mime type of the resource the element points to. this is especially useful when preloading resources — the browser will use the type attribute value to work out if it supports that resource, and will only download it if so, ignoring it if not. you can see an example of this in our video example (see the full source code, and also the live version): <head> <meta charset="utf-8"> <title>video preload example</title> <link rel="preload" href="sintel-short.mp4" as="video" type="video/mp4"> <link rel="preload" href="sintel-short.webm" as="video" type="video/...
...this shows how preloading content can...
...eo/mp4"> <link rel="preload" href="sintel-short.webm" as="video" type="video/webm"> </head> <body> <video controls> <source src="sintel-short.mp4" type="video/mp4"> <source src="sintel-short.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="sintel-short.mp4">link to the video</a> instead.</p> </video> </body> so in this case, browsers that support mp4s will preload and use the mp4, making the video player hopefully smoother/more responsive for users. browsers that don't support mp4 can still load the webm version, but don't get the advantages of preloading. this shows how preloading content can be combined with the philosophy of progressive enhancement. cross-origin fetches if you've got your sites' cors settings worked out properly,...
...And 2 more matches
Want-Digest - HTTP
sk the responder to provide a digest of the requested resource using the digest response header. the header contains identifiers for one or more digest algorithms that the sender wishes the responder to use to create the digest. the sender may use quality values to indicate its preference ordering among the choices it offers. if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad request error, and include another want-digest header with that response, listing the algorithms that it does support. see the page for the digest header for more information. header type general header forbidden header name no syntax want-digest: <digest-...
... <q-value> the quality value to apply to that option. ...
... header type general header forbidden header name no syntax want-digest: <digest-algorithm> // multiple algorithms, weighted with the quality value syntax: want-digest: <digest-algorithm><q-value>,<digest-algorithm><q-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <q-value> the quality value to apply to that option. examples want-digest: sha-256 want-digest: sha-512;q=0.3, sha-256;q=1, md5;q=0 basic operation the sender provides a list of digests which it is prepared to accept, and the server us...
...And 2 more matches
Protocol upgrade mechanism - HTTP
the http/1.1 protocol provides a special mechanism that can be used to upgrade an already established connection to a different protocol, using the upgrade header field. this mechanism is optional; it cannot be used to insist on a protocol change. implementations can choose not to take advantage of an upgrade even if they support the new protocol, and in practice, this mechanism is used mostly to bootstrap a websockets connection. note also that http/2 explicitly disallows the use of this mechanism; it is specific to http/1.1. upgrading http/1.1 connections the upgrade header field is used by clients to invite the server to switch to one of the listed protocols, in descending preference order. because upgrade is a hop-by-hop header, it also needs to be listed in the connection header fi...
...ther. sec-websocket-extensions specifies one or more protocol-level websocket extensions to ask the server to use. using more than one sec-websocket-extension header in a request is permitted; the result is the same as if you included all of the listed extensions in one such header. sec-websocket-extensions: extensions extensions a comma-separated list of extensions to request (or agree to support). these should be selected from the iana websocket extension name registry. extensions which take parameters do so by using semicolon delineation. for example: sec-websocket-extensions: superspeed, colormode; depth=16 sec-websocket-key provides information to the server which is needed in order to confirm that the client is entitled to request an upgrade to websocket. this header can be ...
...include in the response a key of its own, which the client will validate before delivering the upgrade response to you. the server's response's sec-websocket-accept header will have a value computed based upon the specified key. sec-websocket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server in a sec-websocket-protocol header included in the response. you can use this more than once in the header, as well; the result is the same as if you used a comma-delineated list of subprotocol identifiers in a single header. sec-websocket-protocol: subprotocols subprotocols a comma-separated list of subprotocol names, in the or...
...And 2 more matches
HTTP range requests - HTTP
you can check this by issuing a head request with curl, for example. curl -i http://i.imgur.com/z4d4kwk.jpg http/1.1 200 ok ... ...
...you can check this by issuing a head request with curl, for example. curl -i http://i.imgur.com/z4d4kwk.jpg http/1.1 200 ok ... ...
... request with curl, for example. curl -i http://i.imgur.com/z4d4kwk.jpg http/1.1 200 ok ... accept-ranges: bytes content-length: 146515 in this response, accept-ranges: bytes indicates that bytes can be used as unit to define a range. here the content-length header is also useful as it indicates the full size of the image to retrieve. ...
...And 2 more matches
Array.prototype.reduce() - JavaScript
tion's returned value is assigned to the accumulator, whose value is remembered across each iteration throughout the array, and ultimately becomes the final, single resulting value. syntax arr.reduce(callback( accumulator, currentvalue, [, index[, array]] )[, initialvalue]) parameters callback a function to execute on each element in the array (except for the first, if no initialvalue is supplied). it takes four arguments: accumulator the accumulator accumulates callback's return values. it is the accumulated value previously returned in the last invocation of the callback—or initialvalue, if it was supplied (see below). currentvalue the current element being processed in the array. index optional the index of the current element being processed in the array. start...
...e the current element being processed in the array. index optional the index of the current element being processed in the array. starts from index 0 if an initialvalue is provided. otherwise, it starts from index 1. array optional the array reduce() was called upon. initialvalue optional a value to use as the first argument to the first call of the callback. if no initialvalue is supplied, the first element in the array will be used as the initial accumulator value and skipped as currentvalue. calling reduce() on an empty array without an initialvalue will throw a typeerror. return value the single value that results from the reduction. description the reduce() method executes the callback once for each assigned value present in the array, taking four arguments: accum...
... ].reduce( maxcallback ); // 22 [ { x: 2 } ].reduce( maxcallback ); // { x: 2 } [ ].reduce( maxcallback ); // typeerror // map & reduce with initialvalue; better solution, also works for empty or larger arrays [ { x: 22 }, { x: 42 } ].map( el => el.x ) .reduce( maxcallback2, -infinity ); how reduce() works suppose the following use of reduce() occurred: [0, 1, 2, 3, 4].reduce(function(accumulator, currentvalue, currentindex, array) { return accumulator + currentvalue }) the callback would be invoked four times, with the arguments and return values in each call being as follows: callback iteration accumulator currentvalue currentindex array return value first c...
...And 2 more matches
Function.prototype.bind() - JavaScript
one https://github.com/mdn/interactive-examples and send us a pull request. syntax let boundfunc = func.bind(thisarg[, arg1[, arg2[, ...argn]]]) parameters thisarg the value to be passed as the this parameter to the target function func when the bound function is called. the value is ignored if the bound function is constructed using the new operator. when using bind to create a function (supplied as a callback) inside a settimeout, any primitive value passed as thisarg is converted to object. if no arguments are provided to bind , or if the thisarg is null or undefined, the this of the executing scope is treated as the thisarg for the new function. arg1, arg2, ...argn optional arguments to prepend to arguments provided to the bound function when invoking func. return value a co...
... // yes, it does work with `new (funca.bind(thisarg, args))` if (!function.prototype.bind) (function(){ var arrayprototypeslice = array.prototype.slice; function.prototype.bind = function(otherthis) { if (typeof this !== 'function') { // closest thing possible to the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - what...
...tial implementation relies on array.prototype.slice(), array.prototype.concat(), function.prototype.call() and function.prototype.apply(), built-in methods to have their original values. the partial implementation creates functions that do not have immutable "poison pill" caller and arguments properties that throw a typeerror upon get, set, or deletion. (this could be added if the implementation supports object.defineproperty, or partially implemented [without throw-on-delete behavior] if the implementation supports the __definegetter__ and __definesetter__ extensions.) the partial implementation creates functions that have a prototype property. (proper bound functions have none.) the partial implementation creates bound functions whose length property does not agree with that mandated by ...
...And 2 more matches
Intl - JavaScript
s canonical locale names. ...
...ey support using an algorithm specified in the options.localematcher property. locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use in a given operation. a single locale may be specified by either an intl.locale object or a string that is a unicode bcp 47 locale identifier. multiple locales may be specified (and a best-supported locale determined by evaluating each of them in order and comparing against the locales supported by the implementation) by passing an array (or array-like object, with a length property and corresponding indexed elements) whose elements are either intl.locale objects or values that convert to unicode bcp 47 locale identifier strings. if the locales argument is not provided or is undefined...
...the "early modern english" dialect (variant) the subtags identifying languages, scripts, regions (including countries), and (rarely used) variants in unicode bcp 47 locale identifiers are registered in the iana language subtag registry. this registry is periodically updated over time, and implementations may not always be up to date, so be careful not to rely too much on tags being universally supported. bcp 47 also allows for extensions, each consisting of a single digit or letter (other than "x") and one or more two- to eight-letter or digit tags, all separated by hyphens. javascript internationalization functions use the "u" (unicode) extension, which can be used to request additional customization of collator, numberformat, or datetimeformat objects. examples: "de-de-u-co-phonebk":...
...And 2 more matches
Promise - JavaScript
read using promises first. description a promise is a proxy for a value not necessarily known when the promise is created. it allows you to associate handlers with an asynchronous action's eventual success value or failure reason. this lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future. a promise is in one of these states: pending: initial state, neither fulfilled nor rejected. fulfilled: meaning that the operation completed successfully. rejected: meaning that the operation failed. a pending promise can either be fulfilled with a value, or rejected with a reason (error). when either of these options happens, the associated handl...
...ain are nested like russian dolls, but get popped like the top of a stack. the first promise in the chain is most deeply nested and is the first to pop. (promise d, (promise c, (promise b, (promise a) ) ) ) when a nextvalue is a promise, the effect is a dynamic replacement. the return causes a promise to be popped, but the nextvalue promise is pushed into its place. for the nesting shown above, suppose the .then() associated with "promise b" returns a nextvalue of "promise x". the resulting nesting would look like this: (promise d, (promise c, (promise x) ) ) a promise can participate in more than one nesting. for the following code, the transiton of promisea into a "settled" state will cause both instances of .then() to be invoked. const promisea = new promise(myexecutorfunc); const pro...
...ionfunc(777); }); // at this point, "promisea" is already settled. promisea.then( (val) => console.log("asynchronous logging has val:",val) ); console.log("immediate logging"); // produces output in this order: // immediate logging // asynchronous logging has val: 777 constructor promise() creates a new promise object. the constructor is primarily used to wrap functions that do not already support promises. static methods promise.all(iterable) wait for all promises to be resolved, or for any to be rejected. if the returned promise resolves, it is resolved with an aggregating array of the values from the resolved promises ,in the same order as defined in the iterable of multiple promises. if it rejects, it is rejected with the reason from the first promise in the iterable that w...
...And 2 more matches
Proxy - JavaScript
indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could easily extend a constructor with a new constructor. this example uses the construct and apply handlers. ...
...rson.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could easily extend a constructor with a new constructor. this example uses the construct and apply handlers. ...
...pply handlers. ...
...And 2 more matches
String.fromCharCode() - JavaScript
). numbers greater than 0xffff are truncated. no validity checks are performed. return value a string of length n consisting of the n specified utf-16 code units. description this method returns a string and not a string object. because fromcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created. ...
...string object you created. returning supplementary characters in utf-16, the most common characters can be represented by a single 16-bit value (i.e. a code unit). however, this set of characters, known as the base multilingual plane (bmp), is only 1/17th of the total addressable unicode code points. the remaining code points, in the range of 65536 (0x010000) to 1114111 (0x10ffff) are known as supplementary characters. in utf-16, supplementary characters are represented by two 16-bit code units, known as surrogates, that were reserved for this purpose. a valid combination of two surrogates used to represent a supplementary character is known as a surrogate pair. because fromcharcode() only works with 16-bit values (same as the \u escape sequence), a surrogate pair is required in order to ...
...y characters. in utf-16, supplementary characters are represented by two 16-bit code units, known as surrogates, that were reserved for this purpose. a valid combination of two surrogates used to represent a supplementary character is known as a surrogate pair. because fromcharcode() only works with 16-bit values (same as the \u escape sequence), a surrogate pair is required in order to return a supplementary character. for example, both string.fromcharcode(0xd83c, 0xdf03) and \ud83c\udf03 return code point u+1f303 "night with stars". while there is a mathematical relationship between the supplementary code point value (e.g. 0x1f303) and both surrogate values that represent it (e.g., 0xd83c and 0xdf03), it does require an extra step to either calculate or look up the surrogate pair values e...
...And 2 more matches
Mobile first - Progressive web apps (PWAs)
sense to include the narrow screen/mobile styling as the default styling before any media queries are encountered, rather than having desktop/wider screen styling first. this way, mobile devices don't have to load assets and other information twice. if you are using mechanisms like feature detection and matchmedia to conditionally load scripting functionality depending on viewport size, feature support, etc., you should just load the very basics that pretty much all browsers will need first, then progressively enhance browsers higher up the food chain. note: starting with very little and working up as the need arises usually makes more sense than starting with everything and then covering up things if they aren't needed! mobile constraints we have already mentioned the fact that mobil...
...ead that media query, so they will not waste their time and bandwidth downloading that image. note: firefox's responsive design view is a great way to get a quick idea of how your media queries are behaving themselves. try it out with tools > web developer > responsive design view. feature detection feature detection involves doing tests (usually in javascript) to determine whether a browser supports a certain feature, and then serving css or javascript to suit that situation. this can be very useful for mobile first, as you may well want to hide bits of code from the "mobile version" and only include them for the "desktop version", or vice versa. you can write your own feature detects (mark pilgrim's all-in-one almost-alphabetical guide to detecting everything is a good start), but rea...
...ad builder. the full uncompressed modernizr library is 42kb, but the version we are using in this demo is only 8kb. i put modernizr inside my js/lib directory, then included it by putting the following construct inside my html file: <script type="text/javascript" src="js/lib/modernizr.js"></script> with modernizr in place, we can now use the following js block to test whether media queries are supported, and if not, to load in respond.js, scott jehl's matchmedia and media query polyfill. if(!modernizr.mq('only all')) { require('respond'); } editorial note: this currently doesn't work, and i'm not sure why. ongoing work required. matchmedia is also very useful in many other ways. imagine you wanted to include some kind of webgl chart in the desktop version of the site requiring a web...
...And 2 more matches
Introduction - SVG: Scalable Vector Graphics
create an image either by specifying all the lines and shapes necessary, by modifying already existing raster images, or by a combination of both. the image and its components can also be transformed, composited together, or filtered to change their appearance completely. svg came about in 1999 after several competing formats had been submitted to the w3c and failed to be fully ratified. svg is supported by all major browsers. a downside is loading svg can be slow. svg does offer benefits, some of which include having a dom interface available for it, and not requiring third-party extensions. whether or not to use it often depends on your specific use case. basic ingredients html provides elements for defining headers, paragraphs, tables, and so on. in much the same way svg provides e...
...o on. in much the same way svg provides elements for circles, rectangles, and simple and complex curves. a simple svg document consists of nothing more than the <svg> root element and several basic shapes that build a graphic together. in addition there is the <g> element, which is used to group several basic shapes together. starting from there, the svg image can become arbitrarily complex. svg supports gradients, rotations, filter effects, animations, interactivity with javascript, and so on. but all these extra features of the language rely on this relatively small set of elements to define the graphics area. before you start there are a number of drawing applications available such as inkscape which are free and use svg as their native file format. however, this tutorial will rely on t...
... rely on the trusty xml or text editor (your choice). the idea is to teach the internals of svg to those who want to understand it, and that is best done by dirtying your hands with a bit of markup. you should note your final goal though. ...
...And 2 more matches
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
he processor looks at all ancestors of the current node and the current node itself, stopping when it reaches a match for the from attribute, if there is one. for each node in this list that matches the count attribute, the processor counts how many preceding matching siblings it has, and adds one for the node itself. if no match is found, the sequence will be an empty list. ...
... any (not supported at this time.) numbers all matching nodes, regardless of level, sequentially. the ancestor, self, and preceding axes are all considered. the processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any from attribute. if no match to the count attribute is found, the sequence will be an empty list. this level is not supported at this time. from specifies where the numbering should start or start over. the sequence begins with the first descendant of the node that matches the from attribute. value applies a given format to a number. this is a quick way to format a user-supplied number (as opposed to a node sequence number) in any of the standard <xsl:number> formats. format defines the format o...
...art over. the sequence begins with the first descendant of the node that matches the from attribute. value applies a given format to a number. this is a quick way to format a user-supplied number (as opposed to a node sequence number) in any of the standard <xsl:number> formats. format defines the format of the generated number: format="1" 1 2 3 . . . (this is the only format supported at this time) format="01" 01 02 03 . . . 09 10 11 . . . format="a" a b c . . .y z aa ab . . . format="a" a b c . . . y z aa ab . . . ...
...And 2 more matches
Understanding WebAssembly text format - WebAssembly
ere are many different ways to encode a string’s length in the string itself (for example, c strings); for simplicity here we just pass both offset and length as parameters: (import "console" "log" (func $log (param i32) (param i32))) on the javascript side, we can use the textdecoder api to easily decode our bytes into a javascript string. (we specify utf8 here, but many other encodings are supported.) function consolelogstring(offset, length) { var bytes = new uint8array(memory.buffer, offset, length); var string = new textdecoder('utf8').decode(bytes); console.log(string); } the last missing piece of the puzzle is where consolelogstring gets access to the webassembly memory. webassembly gives us a lot of flexibility here: we can either create a memory object in javascript and ...
...direct (type $return_i32) (local.get $i)) in a higher level, more expressive language like javascript, you could imagine doing the same thing with an array (or probably more likely, object) containing functions. the pseudo code would look something like tbl[i](). so, back to the typechecking. since webassembly is typechecked, and the funcref can be potentially any function signature, we have to supply the presumed signature of the callee at the callsite, hence we include the $return_i32 type, to tell the program a function returning an i32 is expected. if the callee doesn’t have a matching signature (say an f32 is returned instead), a webassembly.runtimeerror is thrown. so what links the call_indirect to the table we are calling? the answer is that there is only one table allowed right n...
...her. memory.fill: fill a region of linear memory with a given byte value. memory.init: copy a region from a data segment. table.copy: copy from one region of a table to another. table.init: copy a region from an element segment. note: you can find more information in the bulk memory operations and conditional segment initialization proposal. reference types the reference types proposal (supported in firefox 79) provides two main features: a new type, externref, which can hold any javascript value, for example strings, dom references, objects, etc. externref is opaque from the point of view of webassembly — a wasm module can't access and manipulate these values and instead can only receive them and pass them back out. but this is very useful for allowing wasm modules to call jav...
...And 2 more matches
Classes and Inheritance - Archive of obsolete content
h are initialized to a given value when the class is instantiated. data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. unlike languages like c++ and java, javascript does not have native support for classical inheritance. instead, it uses something called prototypal inheritance. as it turns out, it is possible to emulate classical inheritance using prototypal inheritance, but not without writing a significant amount of boilerplate code. classes in javascript are defined using constructor functions. each constructor function has an associated object, known as its prototype, which is ...
... prototypes, and the instanceof operator, and how to override methods in subclasses. the sdk uses a special constructor internally, known as class, to create constructors that behave properly with respect to inheritance. the last section shows how to work with the class constructor. it is possible to read this section on its own. however, to fully appreciate how class works, and the problem it is supposed to solve, it is recommended that you read the entire article. constructors before the ecmascript 6 standard, a javascript class was defined by creating a constructor function for that class. to illustrate this, let's define a simple constructor for a class shape: function shape(x, y) { this.x = x; this.y = y; } we can now use this constructor to create instances of shape: let s...
...of a class have the same prototype. this makes the prototype the perfect place to define properties that are shared between instances of the class. to illustrate this, let's add a member function to the class shape: shape.prototype.draw = function () { throw error("not yet implemented"); } let shape = shape(2, 3); shape.draw(); // => error: not yet implemented inheritance and constructors suppose we want to create a new class, circle, and inherit it from shape. since every circle is also a shape, the constructor for shape must be called every time we call the constructor for circle. since javascript does not have native support for inheritance, it doesn't do this automatically. instead, we need to call the constructor for shape explicitly. the resulting constructor looks as follows: ...
...turns true, or the prototype becomes null, in which case it returns false. the problem is that when we overrode the prototype of circle with an object whose prototype is the prototype of shape, we didn't correctly set its constructor property. this property is set automatically for the prototype property of a constructor, but not for objects created with object.create. the constructor property is supposed to be non-configurable, non-enumberable, and non-writable, so the correct way to define it is as follows: circle.prototype = object.create(shape.prototype, { constructor: { value: circle } }); overriding methods as a final example, we show how to override the stub implementation of the method draw in shape with a more specialized one in circle. recall that javascript retu...
Content Processes - Archive of obsolete content
neither content or add-on proceses were ever actually implemented, but by the time they were cancelled, the sdk was already designed with them in mind. to understand this article, it's probably best to read it as if content and add-on processes actually exist. to communicate between add-on and content processes, the sdk uses something called content scripts. these are explained in the first section. content scripts communicate with add-on code using something called event emitters. these are explained in the next section. ...
...ssociated with the event emitter itself. when this function is called with a given event name, it calls all the listeners currently associated with that event. the other emit function is associated with another event emitter: it was passed as an argument to the constructor of this event emitter, and made into a method. calling this method causes an event to be emitted on the other event emitter. suppose we have two event emitters in different processes, and we want them to be able to emit events to each other. in this case, we would replace the emit function passed to the constructor of each emitter with a function that sends a message to the other process. we can then hook up a listener to be called when this message arrives at the other process, which in turn calls the emit function on the...
...ct containing one or more named options. among other things, this allows us to specify one or more content scripts to be loaded. when a content script is first loaded, the content worker automatically imports a messaging api that allows it to emit messages over a pipe. on the add-on side, this pipe is exposed via the the port property on the worker. in addition to the port property, workers also support the web worker api, which allows scripts to send messages to each other using the postmessage function. this function uses the same pipe internally, and causes a 'message' event to be emitted on the other side. as explained earlier, firefox doesn't yet use separate processes for tabs or add-ons, so instead, each content script is loaded in a sandbox. sandboxes were explained this article. a...
...erties of the window object via a content script is sometimes inconvenient, so it is possible to circumvent this: by defining the property on window.wrappedobject, the property is defined on the underlying object, rather than the wrapper itself. this feature should only be used when you really need it, however. a few notes on security as we stated earlier, the sdk was designed with multiprocess support in mind, despite the fact that work on implementing this in firefox has currently been suspended. since both add-on modules and content scripts are currently loaded in sandboxes rather than separate processes, and sandboxes can communicate with each other directly (using imports/exports), you might be wondering why we have to go through all the trouble of passing messages between add-on and c...
Private Properties - Archive of obsolete content
a private property is a property that is only accessible to member functions of instances of the same class. unlike other languages, javascript does not have native support for private properties. people have come up with several ways to emulate private properties using existing language features. this article discusses two common techniques: one using prefixes, the other closures. both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. a better alternative is to use weakmap objects, which solve both these problems. however, note that weakmaps might not be supported by all implementations yet. also shown here is how to generalize the idea of using weakmaps, from associating one or more private properties with an object, to associating one or ...
...unction (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent. however, the use of an underscore prefix is just a coding convention and is not enforced by the language: there is nothing to prevent a user from directly accessing a property that is supposed to be private. using closures another common technique, is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = functio...
...in ecmascript 2015 and have recently been implemented in spidermonkey. before explaining how weakmaps work, the following looks at how ordinary objects can be used as hash maps, by creating a simple image cache: let images = {}; function getimage(name) { let image = images[name]; if (!image) { image = loadimage(name); images[name] = image; } return image; } now suppose there's a need to associate a thumbnail with each image. moreover, to create each thumbnail only when it's first required: function getthumbnail(image) { let thumbnail = image._thumbnail; if (!thumbnail) { thumbnail = createthumbnail(image); image._thumbnail = thumbnail; } return thumbnail; } this approach is straightforward, but relies on the use of prefixe...
...mbers of point have a reference to the internal namespace, they can access private properties on other instances of point. namespaces in the add-on sdk the add-on sdk is built on top of xpcom, the interface between javascript and c++ code. since xpcom allows the user to do virtually anything, security is very important. among other things, add-ons should not be able to access variables that are supposed to be private. the sdk uses namespaces internally to ensure this. as always with code that is heavily reused, the sdk defines a helper function to create namespaces. it's defined in the module "core/namespace", and it's use is straightforward. to illustrate this, the following reimplements the class point using namespaces: const { ns } = require("sdk/core/namespace"); var internal = ns(); ...
SDK API Lifecycle - Archive of obsolete content
the api lifecycle aims to balance these competing demands. ...
... a formal deprecation process. unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. backwards-compatibility will be maintained if reasonable. if we do have to make backwards-incompatible changes, we will not guarantee the module will go through the formal deprecation process. stable the module is a fully-supported part of the sdk. we will avoid breaking backwards compatibility unless absolutely necessary. if we do have to make backwards-incompatible changes, we will go through the formal deprecation process. deprecated we plan to change this module, and backwards compatibility should not be expected. don’t start using it, and plan to migrate away from this module to its replacement. ...
...k google group. the deprecation notice should point developers at a migration guide. migration the deprecation period defaults to 18 weeks (that is, three releases) although in some cases, generally those out of our control, it might be shorter than this. during this time, the module will be in the deprecated state. the sdk team will track usage of deprecated modules on addons.mozilla.org and support developers migrating their code. the sdk will continue to provide warnings: api documentation will inform users that the module is deprecated. attempts to use a deprecated module at runtime will log an error to the error console. the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore fail amo review. all warnings should include links to f...
... ...
SDK and XUL Comparison - Archive of obsolete content
advantages of the sdk simplicity the sdk provides high-level javascript 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. compatibility although we can't promise we'll never break a high-level api, maintaining compatibility across firefox versions is a top priority for us. we've designed the apis to be forward-compatible with the new multiple process architecture (codenamed electrolysis) planned for firefox. we also expect to support both desktop and mobile firefox using a single edition of the sdk: so you'll be able to write one extension and have it work on both products. security if they're not carefu...
...u can write traditional add-ons that are restartless, you can't use xul overlays in them, so most traditional add-ons would have to be substantially rewritten anyway. user experience best practices the ui components available in the sdk are designed to align with the usability guidelines for firefox, giving your users a better, more consistent experience. ...
...'t use xul overlays in them, so most traditional add-ons would have to be substantially rewritten anyway. user experience best practices the ui components available in the sdk are designed to align with the usability guidelines for firefox, giving your users a better, more consistent experience. mobile support starting in sdk 1.5, we've added experimental support for developing add-ons on the new native version of firefox mobile. see the tutorial on mobile development. advantages of xul-based add-ons user interface flexibility xul overlays offer a great deal of options for building a ui and integrating it into the browser. using only the sdk's supported apis you have much more limited options for your ui. ...
... low-level apis and third-party modules that's not the whole story. ...
Working with Events - Archive of obsolete content
objects emit events on state changes that might be of interest to add-on code, such as browser windows opening, pages loading, network requests completing, and mouse clicks. by registering a listener function to an event emitter an add-on can receive notifications of these events. we talk about content scripts in more detail in the working with content scripts guide. additionally, if you're using content scripts to interact with web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. in this case one end of the conversation emits the events, and the other end listens to them. ...
...{ panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules. adding listeners in constructors event emitters may be modules, as is the case for the ready event above, or they may be objects returned by constructors. in the latter case the options object passed to the constructor typically defines properties whose names are the names of supported event types prefixed with "on": for example, "onopen", "onready" and so on. then in the constructor you can assign a listener function to this property as an alternative to calling the object's on() method. for example: the actionbutton object emits an event when the button is clicked. the following add-on creates a button and assigns a listener to the onclick property of the options obje...
...ted event types prefixed with "on": for example, "onopen", "onready" and so on. then in the constructor you can assign a listener function to this property as an alternative to calling the object's on() method. for example: the actionbutton object emits an event when the button is clicked. the following add-on creates a button and assigns a listener to the onclick property of the options object supplied to the button's constructor. the listener loads https://developer.mozilla.org/: require("sdk/ui/button/action").actionbutton({ id: "visit-mozilla", label: "visit mozilla", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").open("https://developer.mozilla.org/"); } }); this is exactly equivalent to constructing the button and then calling the button's on() metho...
... the listener must have been previously been added using one of the methods described above. in the following add-on, we add two listeners to the tabs module's ready event. one of the handler functions removes the listener again. then we open two tabs. var tabs = require("sdk/tabs"); function listener1() { console.log("listener 1"); tabs...
panel - Archive of obsolete content
to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. t...
...it's usually better practice to use contentscriptfile, which is a url pointing to a script file saved under your add-on's data directory. warning: unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate fil...
... name type width number the width of the panel in pixels. optional. height number the height of the panel in pixels. optional. position object, button, widget the position of the panel. ignored if the panel is opened by a widget. this may be one of three things: a toggle button. if this is supplied the panel will be shown attached to the button. see the section on attaching panels to buttons. a widget object. if this is supplied the panel will be shown attached to the widget. an object which specifies where in the window the panel should be shown. the rest of this section describes this object. the position object has one or more of the following properties: top, ri...
...loating modal dialog that can by an add-on to present user interface content. once a panel object has been created it can be shown and hidden using its show() and hide() methods. once a panel is no longer needed it can be deactivated using destroy(). the content of a panel is specified using the contenturl option. an add-on can interact with the content of a panel using content scripts which it supplies in the contentscript and/or contentscriptfile options. for example, a content script could create a menu and send the user's selection to the add-on. methods destroy() destroys the panel, unloading any content that was loaded in it. once destroyed, the panel can no longer be used. if you just want to hide the panel and might show it later, use hide instead. postmessage(message) sends a ...
passwords - Archive of obsolete content
typically a credential consists of a username and a password. using this module you can: search for credentials which have been stored in the password manager. you can then use the credentials to access their related service (for example, by logging into a web site). store credentials in the password manager. you can store different sorts of credentials, as outlined in the "credentials" section below. ...
... authentication credentials add-on credential these are associated with your add-on rather than a particular web site. they contain the following properties: username the username. password the password. url for an add-on credential, this property is of the form: addon:<addon-id>, where <addon-id> is the add-on's program id. you don't supply this value when storing an add-on credential: it is automatically generated for you. however, you can use it to work out which stored credentials belong to your add-on by comparing it with the uri property of the self module. realm you can use this as a name for the credential, to distinguish it from any other credentials you've stored. the realm is displayed in firef...
...r functions don't return a value in case of success their oncomplete options are optional. for all functions, onerror is optional. globals functions search(options) this function is used to retrieve a credential, or a list of credentials, stored in the password manager. you pass it any subset of the possible properties a credential can contain. credentials which match all the properties you supplied are returned as an argument to the oncomplete callback. so if you pass in an empty set of properties, all stored credentials are returned: function show_all_passwords() { require("sdk/passwords").search({ oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); ...
...ls and http authentication credentials. oncomplete function the callback function that is called once the function completes successfully. onerror function the callback function that is called if the function failed. the callback is passed an error argument: this is an nsiexception object. remove(options) removes a stored credential. you supply it all the properties of the credential to remove, along with optional oncomplete and onerror callbacks. because you must supply all the credential's properties, it may be convenient to call search first, and use its output as the input to remove. for example, to remove all of joe's stored credentials: require("sdk/passwords").search({ username: "joe", oncomplete: function oncomplete(cre...
widget - Archive of obsolete content
ssage() api or (preferably, usually) the port api. unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. for example, suppose we want to implement a media player as an add-on. we could implement the main user interface as a widget hosting an array of buttons to control play/pause/stop functions. we can then use a content script to listen for clicks on those buttons. but because content scripts can't use the sdk's apis, we'll want the content script to send messages to the main add-on code, which can then implement ...
... data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); require("sdk/widget").widget({ id: "open-clock-btn", label: "clock", contenturl: data.url("history.png"), panel: c...
...clicks the widget. data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); require("sdk/widget").widget({ id: "open-clock-btn", label: "clock", contenturl: data.url("history.png"), panel: clockpanel }); note that this is, at the moment, the only way you can attach a panel to a widget. you must supply the panel in the widget's constructor for it to work. if you assign the panel to the widget after construction, the panel can still be shown but will not be anchored to the widget: data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); widget = require("sdk/widget").widget({ id: "open-clock-btn", ...
...n", label: "clock", contenturl: data.url("history.png"), panel: clockpanel, onclick: function() { // will not be anchored this.panel.show(); } }); see bug 638142. private windows if your add-on has not opted into private browsing, then your widget will not appear in any private browser windows. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. examples for conciseness, these examples create their content scripts as strings and use the contentscript property. in your own add-ons, you will probably want to create your content scripts in separate files and pass their urls using the contentscriptfile property. see working with content scripts for more infor...
Setting Up a Development Environment - Archive of obsolete content
nsions use the same (or similar) languages that are used for web development, so most text editors and ides are up to the task. most xul tools and plugins you'll find online are merely templates that generate the folder structure for the project, and that's not much help. we recommend komodo edit. it's free, open source, and cross-platform. it's based on the mozilla xulrunner platform, so it has support for some of the particularities in firefox extension development. komodo edit has automatic completion for xul tags and attributes, and it supports mozilla's css extensions (css values and properties beginning with "-moz"). it has an add-on system similar to the one in firefox, and there are some komodo extensions that provide additional help in extension development. that is more than what y...
...ormation to locate the installation path of the extension and overwrite the installed files. if firefox is open at the time you run "make install", you'll have to restart it in order to see the changes. it's still better than installing the xpi all over again. you may need to alter the profile location in your makefile. in order to set the profile location to the right value, you should read the support article on profiles, at the mozilla support site. we'll also delve deeper in this topic later on in this section. to make "make install" work on non-windows systems, you need an extra step. the install process requires using an environment variable called ostype, which is not exported. long story short, if you want to run it from a command line, you need to run: export ostype; make instal...
...interfaces. these idl files are compiled into binary form and included in the extension as xpt files. to compile an idl file to xpt, you need a command line tool called xpidl. this tool is included in the mozilla gecko sdk. if you need to compile idls, go to the sdk page and download a compiled version for your system. also note any prerequisites you may need. if your system is not listed in the supported builds, you'll have to build the sdk yourself from the mozilla source. good luck with that. you should also set up your environment so that xpidl.exe (or just xpidl on other systems) is in the default executable path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/path/to/your/sdk our build system should pick it up from there. to make it wo...
... firefox profile management it is good development practice to keep your test environment separate from everything else. you don't want unstable extensions to break your everyday firefox profile, risking data loss. it's much better to have a different "version" of firefox for testing. this is what firefox profiles are for. you can learn about setting up multiple firefox profiles in the mozilla support article managing profiles. you can have as many profiles as you like. you can also mix them with multiple firefox installations. for instance, you may want to test your extension in firefox 3.5 and firefox 3.6, or test it in a localized version of firefox. you can install as many firefox versions as you want, and mix profiles and versions. on windows and linux it's easy to create shortcuts f...
XUL user interfaces - Archive of obsolete content
mozilla overcomes this limitation by providing a specialized language for creating user interfaces: xul (xml user-interface language, usually pronounced like "zool"). in xul, many common user interface features are built in. ...
...mozilla overcomes this limitation by providing a specialized language for creating user interfaces: xul (xml user-interface language, usually pronounced like "zool"). in xul, many common user interface features are built in. ...
...) } else { status.removeattribute("warning") status.setattribute("label", adate.tolocaledatestring()) } } to see the result exactly as intended, use the default theme in your browser. if you use a different theme, it changes some user-interface styles and the demonstration might look strange. open the document in your mozilla browser and use the interface. this wiki does not support xul and javascript in pages, so it is not possible to show the demonstration here. it looks something like this: xul demonstration day of week calculator date: 6/27/2005 day: sunday monday tuesday wednesday thurdsay friday saturday clear today ...
...et that makes the background of the date box pale blue when it has keyboard focus (but white when keyboard focus is somewhere else). what next? if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page. in this demonstration, you see the standard rectangular shapes that are common to most user interfaces. mozilla also supports a specialized graphics language for creating shapes, using css stylesheets to specify the style. the next page demonstrates this: svg and css. ...
MMgc - Archive of obsolete content
ect from being destroyed. sometimes, it is desirable to hold a pointer to a gcobject, but to let the object be destroyed if there are no other references. gcweakref can be used for this purpose. it has a get method which returns the pointer to the original object, or null if that object has already been destroyed. gcfinalizedobject base class: gcobject a garbage collected object with finalization support. all of the rules from gcobject above apply to gcfinalizedobject. the finalizer (c++ destructor) of a gcfinalizedobject will be invoked when mmgc collects the object. class myfinalizedobject : public mmgc::gcfinalizedobject { public: ~myfinalizedobject() { // do finalization behavior, like closing network connections, // freeing unmanaged memory owned by this object, etc. } }; ...
...ged memory that was freed by an explicit call to gc::free (including drc reaping) 0xdeadbeef this is written to the 4 bytes just after any object allocated via mmgc. it is used for overwrite detection. 0xfbfbfbfb a block given back to the heap manager is memset to this (fb == free block). finalizers if your c++ class is a subclass of gcfinalizedobject or rcfinalizedobject, it has finalizer support. a finalizer is a method which will be invoked by the gc when an unreachable object is about to be destroyed. it's similar to a destructor. it differs from a destructor in that it is usually called nondeterministically, i.e. in whatever random order the gc decides to destroy objects. c++ destructors are usually invoked in a comparatively predictable order, since they're invoked explicitly by ...
.... these two optimizations can be combined. increment time slice before diving into the this it should be acknowledged that another way to go about this is to use a background thread and not worry about incremental marking. this approach was not chosen for the following reasons: coordinating the marking thread and the main thread will require locking and may suffer due to lock overhead/contention supporting mac classic's cooperative threads makes this approach harder flash's frame based architecture gives us a very natural place to do this work we have better control over how much time is spent marking without threads when smp systems become more prevalent it may be worth investigating this approach because true parallelism may afford better performance. another point to consider is whether ...
...an fall back on a malloc/free approach for obtaining memory if a memory mapping api like virtualalloc or mmap is not available. in this case, gcheap will allocate exactly as much memory as is requested when the heap is expanded and not try to reserve additional memory pages to expand into. gcheap won't attempt to allocate contiguous regions in this case. we currently use virtualalloc for windows (supported on all flavors of windows back to 95), mmap on mach-o and linux. on classic and carbon, we do not currently use a memory mapping strategy... these implementations are calling mpallocaligned, which can allocate 4096-byte aligned memory. we could potentially bind to the mach-o framework dynamically from carbon, if the user's system is mac os x, and call mmap/munmap. ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
t's take a close look at the breeding ground for trouble, and why this is a problem. we start with a simple case, illustrated in figure 1: a one-cell table containing an image. obviously most designs are a touch more complicated than this, but we don't need anything more for our purposes. one image, one cell-- that's all it takes. there's nothing apparently wrong with that example. there isn't supposed to be, since it's an example of how browsers have traditionally behaved. now let's see what that same simple table looks like in a modern browser when the page has a strict doctype. notice the added space beneath the image in figure 2. the markup of both table and cell remains unchanged-- it's the rendering mode that's different. instead of "shrinkwrapping" the image itself, the browser ...
...thanks to mozilla's thorough implementation of css2, the problem of inline images in table cells forcing open unwanted space has come to the attention of the css working group. there have been many proposals to fix the problem, but one of the most promising approaches is the property line-box-contain, which has been proposed for inclusion in css3. should this property be adopted, then any browser supporting it could emulate traditional "shrinkwrap" behavior without risking other layout upset with the following rule: td {line-box-contain: font replaced;} /* proposed for css3 */ there are other possible fixes contained within the current css3 working drafts, such as line-height-policy. obviously, the sooner a solution can be found and implemented, the happier authors everywhere will be. rec...
...ate traditional "shrinkwrap" behavior without risking other layout upset with the following rule: td {line-box-contain: font replaced;} /* proposed for css3 */ there are other possible fixes contained within the current css3 working drafts, such as line-height-policy. obviously, the sooner a solution can be found and implemented, the happier authors everywhere will be. recommendations absent support for css3, it is difficult to provide a clear set of steps for fixing every instance of these problems, because the best solution for a given document will greatly depend on its structure. if your document uses transitional markup, make sure your doctype reflects that fact and does not trigger "standards" mode. this will prevent browsers from using standards-based rendering, and thus all the i...
...ges should be vertically aligned with the bottom of the line box. any image in a table cell with other images and text should have its vertical alignment changed as necessary, if at all. with a judicious mixture of approaches and a reduction of single-pixel image tricks-- which, in a css-capable browser, are unnecessary anyway-- it is quite possible to sidestep this strange effect of standards support. the best solution may be to ensure that images are always in a cell by themselves, thus allowing authors to make them block-level, but as always this will depend on the author's design. related links gecko's almost standards mode mozilla's quirks mode original document information author(s): eric a. meyer last updated date: march 21st, 2003 copyright © 2001-2003 netscape. ...
No Proxy For configuration - Archive of obsolete content
acters) entries. new profiles contain the values "localhost, 127.0.0.1", by default. entry points: preferences | advanced | proxies control-click menu for off line-online icon (network plug) configuration the no proxy list is composed of either domain elements or ipv4 address elements. the elements are separated by either a space (" ") or a comma (","). note for former-ie users: "*" is supported only at the beginning of domain filters (*.mozilla.org). to block ... put this into "no proxy for" ...for example use... limitations a domain, including sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.org" does not block t...
... hostnames that resolve to the ip address ("127.0.0.1" does not block "localhost") a network network w/ cidr block "10.0.0.0/8" does not block hostnames that resolve to the ip address range (10.0.0.0/8 is not "no proxy for intranet hostnames") optional - port-specific (optional) ":" + port number "<filter>:81" only black-lists port. only applies to one port (no support for ranges and/or multiple ports). port-only filters ":80" or "*:80" are not supported. all non-fqdn hosts, such as intranet hosts the string "<local>" (without quotes) "<local>" bypasses the proxy for all hostnames which have no periods in them. for example: "https://mycompanyintranet/" formats that are not accepted example domain filters with in...
...nterior wildcards www.*.com ip address string prefixes 127. or 10.0.* ip addresses with wildcards in quads 10.*.*.* preferences name network.proxy.no_proxies_on default value localhost, 127.0.0.1 by default "localhost" and "127.0.0.1" are excluded, since most people assume these should connect to the local system. note: when ipv6 support is added, additional addresses will need to be added and tested. communicator used "network.proxy.none" limitations no ipv6 support - the backend stores ipv4 addresses as ipv6, but ipv6 formats are not supported. scalability - not usable for local domains with numerous hostnames. not usable for large number of filters (ad blocking). mozilla implements this feature with significant lim...
...proxyservice::examineforproxy - decides to check filters if configuration is "manual" nsprotocolproxyservice::canuseproxy - performs url vs. ...
Editor Embedding Guide - Archive of obsolete content
he content on the browser. below is the sequence of steps that need to be followed for the same: 1. get the nsicommandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsicommandmanager> commandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(commandmgr)); 2. call a command -- docommand: commandmanager->docommand(acommand, acommandparams); acommand is a const char * to a supported command name (see list below). acommandparams could possibly be a null pointer or a pointer to a valid structure filled with relative parameters to acommand (see list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given command -- getcommandstate: commandmanager->...
..."(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal teletype cmd_strikethrough toggles strikethrough style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal strikethrough cmd_superscript toggles superscript style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal superscript cmd_subscript toggles subscript style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(...
...these cases will return whether or not it is possible to call docommand. this will not really give you any concrete information on the state of the command. nsicommandparams creating how do you create an nsicommandparams? -saari writing once you have created an nsicommandparams you call the "set" methods. setbooleanvalue setlongvalue setdoublevalue setstringvalue setcstringvalue setisupportsvalue removevalue each will take a name value pair. in the case of setbooleanvalue for example you use a boolean as the second parameter. commandparam->setcstringvalue("state_attribute","left"); reading for reading you may go after individual name/value pairs you know are there or you may iterate through all the name/value pairs and programatically pull off data. first getnext (ret...
...amatically pull off data. first getnext (returns the next name in the name/value pair list) hasmoreelements getvaluetype (numeric enum type see nsicommandparams for values) if the name/value pair is known or it was obtained using the methods described above, it is possible to call the following methods: getbooleanvalue getlongvalue getdoublevalue getstringvalue getcstringvalue getisupportsvalue all of these take pointers to values except for getstringvalue which demands a reference to an nsastring. commandparam->getbooleanvalue("state_enabled",&boolval); original document information authors: michael judge (mjudge@netscape.com) contributor: kathleen brade (brade@netscape.com) last updated date: march 27, 2003 original document: a guide to embedding the gecko editor...
Layout System Overview - Archive of obsolete content
e and modes are explained in more detail in article mozilla's doctype sniffing. galley and page presentations: the presentation generally is constrained by the width of the window in which the presentation is to be displayed, and a height that extends as far as necessary. this is referred to as the galley mode presentation, and is what one expects from a typical browser. additionally, layout must support a paginated presentation, where the width of the presentation is constrained by the dimensions of the printed output (paper) and the height of each page is fixed. this paged presentation presents several challenges not present in the galley presentation, namely how to break up elements that are larger than a single page, and how to handle changes to page dimensions. the original design of the...
...ined by the dimensions of the printed output (paper) and the height of each page is fixed. this paged presentation presents several challenges not present in the galley presentation, namely how to break up elements that are larger than a single page, and how to handle changes to page dimensions. the original design of the layout system allowed for multiple, possibly different, presentations to be supported simultaneously from the same content model. in other words, the same html or xml document could be viewed as a normal galley presentation in a browser window, while simultaneously being presented in a paged presentation to a printer, or even an aural presentation to a speech-synthesizer. to date the only real use of this multiple presentation ability is seen in printing, where multiple pres...
...te the only real use of this multiple presentation ability is seen in printing, where multiple presentations are managed, all connected to the same content model. (note: it is unclear if this is really a benefit - it may have been better to use a copy of the content model for each presentation, and to remove the complexity of managing separate presentations - analysis is needed here). the idea of supporting a non-visual presentation is interesting. layout's support for aural presentations is undeveloped, though conceptually, it is possible and supported by the architecture. how layout does its job: frames and reflow so, layout is concerned with providing a presentation, in galley or paged mode. given a content model, how does the layout system actually create the presentation? through the cre...
...hanges, and thus more or less text appears on each line. the block is responsible for managing the lines. note that lines may contain only inline elements, whereas block may contain both inline elements and other blocks.other layout models: xul in addition to managing css-defined formatting, the layout system provides a way to integrate other layout schemes into the presentation. currently layout supports the formatting of xul elements, which utilize a constraint-based layout language. the box is introduced into the layout system's frame model via an adapter (boxtoblockadapter) that translates the normal layout model into the box formatting model. conceptually, this could be used to introduce other layout systems, but it might be worth noting that there was no specific facility designed into ...
Repackaging Firefox - Archive of obsolete content
ct trademarks@mozilla.com. getting started now, on to the technical details. the following diagram represents an overview of the process and the pieces involved: you will need the following to get started: a macintosh computer (even for repackaging windows or linux only); it may be either powerpc or intel based. the repackager tool. currently that page mentions only firefox 1.5.x, but it supports firefox 2. the pristine firefox 2 installer files (windows .exe, mac .dmg, or linux .tar.gz) for each of the locales you need. at the time of writing this document, the latest builds are here. a "distro" extension that makes the changes you desire. once you have all the ingredients, the customization process is quite easy: download the firefox installer. install the repackager tool l...
...of the contents of the xpi. components/partnerbookmarks.js from the cck extension, and it allows us to drop in default bookmarks at profile creation. you should not need to edit this file. defaults/preferences/partner.js default preferences for this dex. install.rdf meta-information about your extension, such as the creator (your organization), a unique id, and which versions of firefox are supported. locale/*/partner.properties for preferences which need to be localized, there needs to be an entry in each of the properties files with the desired value for that locale. if the value is the same for *all* locales, it can be set in the partner.js file itself, see the section "preferences" for more information. partner-bookmarks.xml default bookmarks are set here. and that's all you n...
... partner.js file itself, see the section "preferences" for more information. partner-bookmarks.xml default bookmarks are set here. and that's all you need! take a moment and browse through the files, and don't forget to check mdc for reference material. locales there is a difference between the locales you plan to distribute installers for (and will therefore need to repack), and the locales supported by your dex. if possible, we recommend you have your dex support the full set of locales that firefox supports. the reason is that if you create and ship a dex that supports 2 locales (for example), and later decide to ship on a 3rd locale, you will need to re-create the dex to support it. that means that you will need to change the version of the dex, and that will cause any users with th...
... that firefox supports. the reason is that if you create and ship a dex that supports 2 locales (for example), and later decide to ship on a 3rd locale, you will need to re-create the dex to support it. that means that you will need to change the version of the dex, and that will cause any users with the earlier version to get unnecessarily upgraded. on the other hand, if you create a dex which supports all locales, you can only ship on a few, and later expand your set without any upgrade hassles. of course, this strategy only works when your strings either do not need localization, or are programmatically localizable (for example, simply adding the locale to a url, like http://<locale>.example.com/). but it's something to keep in mind when planning your locale support. preferences prefe...
Mozilla Application Framework - Archive of obsolete content
form applications want to build applications? use the mozilla framework and make your life easier. we provide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help. ...
...u develop your apps, and a community of people to help. framework xul a comprehensive, cross-platform ui toolkit with an easy-to-learn xml language for defining ui structure, a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing uis quick and painless. gecko a performant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform component model with multiple language bindings and idl descriptions ...
...working library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xmlhttprequest, xml-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services. xpinstall our cross-platform installer for trivial packaging and installation of your mozilla framework applications. and much much more... ...
... dom inspector a tool for inspecting and editing the structure and widgets of your user interface while your application is running. ...
Plug-n-Hack Phase1 - Archive of obsolete content
it is up to the tool authors to decide how the url of the manifest is published. the tool configures itself by serving an html document (we’ll call this the configuration document) to the browser. ...
...ument) to the browser. this can cause the browser to inspect the manifest and register the tool by firing a customevent with the type configuresectool and a properties object which specifies the url of the tool manifest. for example: var manifest = {"detail":{"url":"http://localhost:8080/manifest"}}; var evt = new customevent('configuresectool', manifest); it is suggested that browsers wishing to support pnh restrict handling of customevents such that they’re ignored where the event happens outside of user initiated actions. the configuration document should then listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configur...
...ns outside of user initiated actions. the configuration document should then listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configuresectool event has been fired, you might want to warn the user that pnh does not seem to be supported by this browser (perhaps prompting them to install the appropriate addon). configuresectoolfailed - this notifies the document that configuration has failed for some reason. the user should be notified that configuration has failed. configuresectoolsucceeded - this notifies the document that configuration has succeeded. the user can be given a message to this effect. configuresectoola...
...to install the appropriate addon). configuresectoolfailed - this notifies the document that configuration has failed for some reason. the user should be notified that configuration has failed. configuresectoolsucceeded - this notifies the document that configuration has succeeded. the user can be given a message to this effect. configuresectoolactivated - this notifies the document that pnh support (perhaps previously unavailable, e.g. due to a missing addon) has been enabled. you can see an example of a configuration document in the zap pnh addon. there’s another (possibly out of date) example here. an example manifest (for owasp zap) is: { "toolname":"owasp zap", "protocolversion":"0.2", "features":{ "proxy":{ "pac":"http://localhost:8080/proxy.pac", "cace...
Tamarin build documentation - Archive of obsolete content
windows 32 and 64 bit mac osx 10.4, 10.5 on ppc mac osx 10.5, 10.6 on intel linux 32 and 64 bit solaris 10 on sparc android 2.2 on arm windows mobile 6.5 mips (linux) sh4 (linux) getting the tamarin source the tamarin source resides in mercurial at tamarin central. ...
...ny arguments will list the available options. note that additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-platform build system for mozilla developers. the cross-platform build system is used for daily automated build testing so it is the most reliable system. the tamarin codebase has the ability to build additional code which supports debugging hooks. in the xcode project, this is the debug_debugger and release_debugger configurations. the flash player builds tamarin with the debugging hooks off for codesize reasons, but the mozilla client will build tamarin with the debugging hooks on. cross-platform build (general instructions - non-android) prerequisites: you need python 2.5 or later and gnu make 3.81 or later. (gnu ...
... with the above setup you should now be able to build: $ hg clone http://hg.mozilla.org/tamarin-central/ $ cd tamarin-central $ mkdir objdir-release $ cd objdir-release $ python ../configure.py $ make ... $ shell/avmshell.exe shell 1.0 build cyclone ... microsoft visual studio visual studio 2008 (vs2008) is the preferred windows build environment. visual studio 2003 and 2005 are no longer supported. to build tamarin: copy tamarin/platform/win32/armasm.rules to c:/program files/microsoft visual studio 9.0/vc/vcprojectdefaults build "builtin.h" following the instructions below in the section "compiling and running applications" do the same for shell_toplevel.h, starting in avmplus/shell, using the command "python shell_toplevel.py" open the tamarin project file "platform/win32/avm...
..._debugger configuration will create avm.exe under \tamarin-redux\platform\win32\x64\release_debugger. note the "\obj9" directory under \platform\win32 for the win32 builds and "\x64" directory under \platform\win32 for 64-bit builds; this looks a little odd but preserves previous behavior as much as possible to avoid initial disruption from the shell rename fix. you must install vs2008 with x64 support to build the 64-bit configurations. if you installed the windows mobile 6 sdk, you can build for windows mobile (arm) targets. apple xcode the project files are designed for xcode 3.0. see "platform/mac/avmplus/avmplus.xcodeproj/". xcode 2.2, 2.3, and 2.4 will not work. there are two targets in the xcode ide, 'avm' for 32-bit builds and 'avm64' for 64-bit builds. there is also an aggrega...
Writing textual data - Archive of obsolete content
et of the full repertoire. when the file is to be read only by the application/extension itself, using utf-8 is often the best choice — it can represent all characters, and ascii characters are represented efficiently. writing to a stream in gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverteroutputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); // this assumes that fos is the nsioutputstream you want to write to os.init(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n"); os.writestring("hebrew: \u05d0 \u05d1\n"); // etc. os.close(); you can also write...
...nit(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n"); os.writestring("hebrew: \u05d0 \u05d1\n"); // etc. os.close(); you can also write character arrays using the write function, although using writestring is simpler from javascript code. ...
...sing the write function, although using writestring is simpler from javascript code. the example above passes 0 as the third argument, which disables buffering (note: the implementation of the converter stream might not support buffering). passing 0 ensures that data will be immediately written to the underlying stream; however, for better perfomance you should pass a value like 4096 instead. unsupported characters you can specify what should happen with characters that are not supported by the selected character encoding. the last argument to init specifies that: 0x0000 means that writing unsupported characters throws an exception (with an error code of ns_error_loss_of_significant_data), and no data will be written. to instead write a replacement character in such cases, specify the cha...
..._error_loss_of_significant_data), and no data will be written. to instead write a replacement character in such cases, specify the character instead of 0x00: os.init(fos, charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character. you can also specify any unicode character u+abcd directly as 0xabcd. note: if the replacement character is not a supported character in the chosen character encoding, attempts to write unsupported characters will fail with ns_error_loss_of_significant_data. versions before gecko 1.8 firefox 1.0.x, mozilla 1.7.x and older versions do not support nsiconverteroutputstream. alternative ways usable from javascript do not support character encodings that use embedded nulls (such as utf-16 and utf-32). they work by...
Using XPInstall to Install Plugins - Archive of obsolete content
r netscape gecko browsers using xpinstall. a definition of terms xpinstall is an installer technology, and the name itself stands for "cross platform install" (hence "xp" -- an abbreviation for "cross platform"). an xpinstall package is usually called an xpi package for short (and often pronounced "zippy"). this article is about how you can use xpinstall to install plugins to the browsers that support xpinstall. an xpi package is in fact a zip file with the xpi file extension (e.g. myplugininstaller.xpi), and can be created on windows by utilities such as winzip. xpi packages, like zip files, "contain" other files, typically: the software component to be installed. in our case, this is the plugin software. a javascript file called install.js, which is the install logic that drives the i...
...t that contains the software and the install.js javascript file is a cross-platform file (zip) and since javascript is understood by mozilla browsers on all platforms, often one single xpi package can be deployed on all platforms. this is, in fact, how skins and themes are installed to mozilla browsers, changing their look and feel. this article focuses on how to install plugins. which browsers support xpinstall? currently, all mozilla browsers released by mozilla.org support xpinstall, and a family of browsers based on mozilla code support xpinstall. in particular, this includes: recent netscape browsers such as netscape 6.2.x and netscape 7.0, which are both based on netscape gecko, which is at the core of the mozilla browser recent beta-only versions of the aol software based on nets...
...ort xpinstall. in particular, this includes: recent netscape browsers such as netscape 6.2.x and netscape 7.0, which are both based on netscape gecko, which is at the core of the mozilla browser recent beta-only versions of the aol software based on netscape gecko, the layout engine of the mozilla project. caveats: aol time warner's compuserve browser, also based on netscape gecko, does not support xpinstall. netscape communicator 4.x does not support xpinstall. what does a plugin consist of? plugins can consist of the following types of files, all of which can be installed via an xpi package: shared libraries (i.e. on windows, these are dlls, on unix these are *.so files). these files are native code files made with the netscape plugin api. if the plugin is scriptable, then it w...
...ief history of netscape installer technologies this section is relevant if you are familiar with netscape communicator 4.x's smartupdate installer technology. the use of javascript as the install logic is not unprecedented in netscape browsers. netscape communicator 4.x uses the notion of smartupdate to install software, particularly plugins and java applets to be run locally. smartupdate is not supported by mozilla browsers (and netscape/aol browsers based on mozilla such as netscape 7), but because of the similarity between the two installer technologies, it is easy to convert your smartupdate files to xpinstall files. smartupdate involves a digitally signed jar file which contained the software components to be installed as well as a javascript install.js file (called the install script) ...
Writing to Files - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. to write to a file, an output stream is used. an output stream is an object which can be used to write bytes, strings and other values to a file. to create...
...methods available to write to a stream. for text files, you will usually use the writestring method. var file = io.getfile("desktop", "myinfo.txt"); var stream = io.newoutputstream(file, "text"); stream.writestring("this is some text"); stream.close(); in this example, a text input stream is created for the file 'myinfo.txt'. the writestring method is called to write a single string to the file, supplied as an argument to the method. finally, the stream is closed by calling the stream's close method. you should ensure that the file is closed, so that the data is properly written and that the file can be reopened for reading later. to write additional strings, call the writestring method multiple times. writing other character encodings the default character encoding is utf-8. if you want to ...
... want to write using a different encoding, you can specify a third argument to nsiscriptableio.newoutputstream() which specifies the encoding. this example opens a file using the utf-16 encoding. var stream = io.newinputstream(file, "text", "utf-16"); this third argument is not needed to write using utf-8. as utf-8 can store all characters, you will usually always use this default. for a list of supported character encodings, see supported character sets. the files can be written using the writestring method whichever character encoding is used. the difference is handled internally so you don't need to write any other part of the code differently. writing binary data in addition to text, binary values may be written to a file either as bytes or as numbers. a number of methods are available w...
...ds are available, all of which take one argument, which is the value to write: writeboolean will write a boolean value to a stream. if the argument is false, 0 is written, and if the argument is true, 1 is written. non-boolean values will be converted into booleans automatically. write8 will write a single byte. the 8 in the method name indicates that 8 bits of data are being written. if the supplied value is larger than 8 bits, only the lowest significant 8 bits are written. write16 will write two bytes to the stream. write32 will write four bytes. writefloat will write a floating point value in four bytes. writedouble will write a floating point value in eight bytes. in this example, the write16 method is used to write the value 1000 in two bytes. the write32 method performs a...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
rpose. you can also use this page to learn about extensions, and as a starting point if you plan to write a more complex extension. note that this extension is very simplified. use other tutorials and articles to find out more—the main extensions page here is a good starting point. in particular, the articles creating toolbar buttons and building an extension explain the process in more detail. supported applications you can use the steps on this page only with seamonkey 1.x versions. seamonkey 2 is being reworked to support the same process as firefox, thunderbird and others. this tutorial adds a customizable button to all seamonkey's toolbars. it adds a menu choice to chatzilla's menu bar (because chatzilla has no toolbar). note: for a similar tutorial that applies to seamonkey 2, fir...
... required tools you will need two tools. your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding. ...
...e of the special characters that your language uses. save the file. open the file in seamonkey (for example, by dragging it and dropping it in the navigator window, or by choosing file – open file... from seamonkey's menu bar). from seamonkey's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. you can optionally use a jar tool or zip tool to package your button as a cross-platform installable (xpi) for other people to install and use. making a button there are nine easy steps. when you have completed all the steps, you will have a struct...
.... duplicate the first two lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the curly brace on the last line of the file. for example, you could add this code for testing: 2: function () { alert("just testing again") }, create an image for the new button, naming the file button-2s.png. the images supplied here have a 256-colour palette and a transparent background. they are in png format. some other formats will also work. here are some more images that you can download and use: restart the application to find the new button. you can repeat these steps to add as many buttons as you need. positioning buttons to position your buttons on each toolbar, you can use their position a...
Custom toolbar button - Archive of obsolete content
ose. you can also use this page to learn about extensions, and as a starting point if you plan to write a more complex extension. note that this extension is very simplified. use other tutorials and articles to find out more—the main extensions page here is a good starting point. in particular, the articles creating toolbar buttons and building an extension explain the process in more detail. supported applications you can use the steps on this page with any or all of these mozilla applications: firefox 1.5 or a later version seamonkey 2.0 or a later version thunderbird 1.5 or a later version sunbird 0.3 or a later version pre-release versions of these (alphas, betas and release candidates) are also ok. in the rest of this page, the term application means the mozilla application...
...r a later version sunbird 0.3 or a later version pre-release versions of these (alphas, betas and release candidates) are also ok. in the rest of this page, the term application means the mozilla application where you want to add the button. note: there is a similar tutorial for seamonkey 1.x on the page: custom toolbar button:seamonkey earlier versions and other mozilla applications also support extensions, but some parts of this tutorial are not appropriate for them. required tools you will need two tools. your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding. if your language uses only plain latin (ascii) characters, se...
...e file, type some of the special characters that your language uses. save the file. open the file in firefox (for example, by dragging it and dropping it in firefox, or by choosing file – open file... from firefox's menu bar). from firefox's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. you can optionally use a jar tool or zip tool to package your button as a cross-platform installable (xpi) for other people to install and use. making a button there are ten easy steps. when you have completed all the steps, you will have a s...
...plicate the first three lines, changing the new lines to specify button-2. edit button.js and add javascript code for the new button. be sure to add the extra code before the curly brace on the last line of the file. for example, you could add this code for testing: 2: function () { alert("just testing again") }, create an image for the new button, naming the file button-2.png. the images supplied here are 40 pixels wide and 48 pixels high, with a 256-colour palette and a transparent background, in png format. some other formats will also work. here are some more images that you can download and use: restart the application and customize the toolbar to find the new button. you can repeat these steps to add as many buttons as you need. distributing your button to other user...
Styling a Tree - Archive of obsolete content
ecessary state. for columns and cells, one additional property, the id of the column or column the cell is in will be set. setting properties for the rdf-built trees for rdf-built trees, you can use the same syntax. however, you will often set the properties based on values in the datasource. setting properties for the custom view for trees with a custom view script, you can set properties by supplying the functions getrowproperties(), getcolumnproperties() and getcellproperties() in the view. these return information about an individual row, column and cell. arguments to these functions indicate which row and/or column. prior to gecko 22 the last argument to each of these functions is a properties list which the view is expected to fill with a list of properties. the function getcolumnp...
...ons getrowproperties(), getcolumnproperties() and getcellproperties() in the view. these return information about an individual row, column and cell. arguments to these functions indicate which row and/or column. prior to gecko 22 the last argument to each of these functions is a properties list which the view is expected to fill with a list of properties. the function getcolumnproperties() also supplies the corresponding treecol element for the column. getrowproperties : function(row,prop){} getcolumnproperties : function(column,columnelement,prop){} getcellproperties : function(row,column,prop){} from gecko 22 you can return a string of space-separated property names from these functions. getrowproperties : function(row){ return ''} getcolumnproperties : function(column,columnelement){...
...t, using the example from a previous section. we'll need to add code to the getcellproperties() function, to add a property 'makeitblue' for cells in every fourth row. (we don't use getrowproperties() as the text color will not be inherited into each cell.) prior to gecko 22 the properties object that is passed as the last argument to the getcellproperties() is an xpcom object that implements nsisupportsarray. it is really just an xpcom version of an array. it contains a function appendelement() which can be used to add an element to the array. we can use the interface nsiatomservice to construct string atoms for the properties. getcellproperties: function(row,col,props){ if ((row %4) == 0){ var aserv=components.classes["@mozilla.org/atom-service;1"]. getservice(componen...
...ings. we create them using the xpcom interface nsiatomservice and add them to the array using the appendelement() function. here, we create an atom 'makeitblue'. you can call appendelement() again to add additional properties. from gecko 22 your function should return a string containing the property. getcellproperties: function(row,col){ if ((row %4) == 0){ return "makeitblue"; } } to support gecko versions before and after this change use. getcellproperties: function(row,col,props){ if ((row %4) == 0){ if (props) { var aserv=components.classes["@mozilla.org/atom-service;1"]. getservice(components.interfaces.nsiatomservice); props.appendelement(aserv.getatom("makeitblue")); } else { return "makeitblue"; } } } this function would...
Templates - Archive of obsolete content
numerous datasources are provided with mozilla such as bookmarks, history and mail messages. more details on these will be provided in the later section. usually, elements such as treeitems and menuitems will be populated with data. however, you can use other elements if you want although they are more useful for specialized cases. ...
...ow resources in rdf can be referred to. here, we only use the name of the bookmark but numerous other fields are available. the label of the buttons is set to this special uri because we want the labels on the buttons to be set to the names of the bookmarks. we could have put a uri in any of the attributes of the button, or any other element. the values of these attributes are replaced with data supplied by the datasource which, in this case, is the bookmarks. so we end up with the labels on the buttons set to the names of the bookmarks. the example below shows how we might set other attributes of a button using a datasource. of course, this assumes that the datasource supplies the appropriate resources. if a particular one is not found, the value of the attribute will be set to an empty st...
...display too many items. it's also possible to use the content builder for trees as well, and a treeitem element and related elements will be created for each row. rules in the image of the earlier example, you may have noticed that the third button is simply a button with hyphens on it. this is a separator in the bookmark list. in the way that we have been using it, the rdf bookmarks datasource supplies the separators as if they were just regular bookmarks. what we would really like to do is add a small amount of spacing instead of a button for separator resources. that means that we want to have two different types of content be created, one type for regular bookmarks and a second type for separators. we can do this by using the rule element. we define a rule for each variation of element...
...ate> </vbox> </window> by using two rules, we have allowed the contents of the template to be selectively generated. in the first rule, bookmark separators are selected, as can be seen by the rdf:type attribute. the second rule does not have any attributes so all data matches it. all of the attributes placed on the rule tag are used as match criteria. in this case, the bookmarks datasource supplies a rdf:type property to distinguish separators. this attribute is set to a special value for separators in the rdf bookmarks datasource. this is how we can distinguish them from non-separators. you can use a similar technique for any attribute that might be on an rdf description element. the special url value given in the example above for the first rule is used for separators. that means th...
Using nsIXULAppInfo - Archive of obsolete content
starting with mozilla/xulrunner 1.8, there now is a way to find out which application, application version, and gecko version your code is running on. this is useful, for example, for extensions that support several mozilla-based applications or several versions of a single application. this is not useful for scripts on webpages, which should continue using the navigator object when it's not possible to rely on feature-detection. nsixulappinfo interface to distinguish between different mozilla-based applications, use the frozen nsixulappinfo interface. ...
... which should continue using the navigator object when it's not possible to rely on feature-detection. nsixulappinfo interface to distinguish between different mozilla-based applications, use the frozen nsixulappinfo interface. the following sections provide a few examples of using nsixulappinfo from javascript. note that while firefox 1.5, thunderbird 1.5, and xulrunner 1.8-based applications support nsixulappinfo, older applications, such as firefox and thunderbird 1.0, do not support it. you'll need to have additional code for those older versions. getting nsixulappinfo to get a component implementing nsixulappinfo use this code: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); (for explanation...
...s running under. for example, one of unfrozen functions you're relying on was changed. note: nsixulappinfo provides information about the application and the platform, be careful to use the right one, especially when dealing with xulrunner-based applications. in such cases, you probably want to check nsixulappinfo.version and/or nsixulappinfo.appbuildid. the latter is useful if you're trying to support nightly development builds of the application, and the former can be useful if you only support official releases, and to distinguish between branch and trunk builds. example 1: checking firefox version // assuming we're running under firefox var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); var versionc...
...fo in xpcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of xpcshell tests. see bug 809920, and in summary: // work around the fact that xpcshell doesn't have a proper app-info xpcom object. cu.import("resource://testing-common/appinfo.jsm"); updateappinfo(); older versions as stated above, older mozilla 1.7-based applications do not support nsixulappinfo. you'll have to write additional code if you choose to support those versions. for example, firefox and thunderbird 1.0 stored their id in the app.id preference (and their version in app.version), so you could use code like this to find out what application you're running under: function getappid() { var id; if("@mozilla.org/xre/app-info;1" in components.classes) { // ...
prefwindow - Archive of obsolete content
command with the ondialogextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma). warning: if the accept and cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply. if it is set to true any changes to settings are supposed to be applied immediately. the accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close the dialog in this situation (windows and linux) or might be hidden, too (mac os). the default setting of browser.preferences.instantapply currently is true on linux and mac os and false on windows (which however might or might not chang...
..., focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata acceptdialog() return type: no return value accepts the dialog and closes i...
...utton( type ) return type: button element returns the button element in the dialog corresponding to the given type. opensubdialog( url, features, params ) return type: window opens a child modal dialog. usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. openwindow( windowtype, url, features, params ) return type: window open a child window. the windowtype is a string specifying a window type. if a window with that type is already open, this method will just sw...
...rly when the main dialog is closed. openwindow( windowtype, url, features, params ) return type: window open a child window. the windowtype is a string specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. if a window of the type is not open, a new one is opened displaying the supplied url. showpane( prefpane ) return type: no return value switch to a particular pane. notes usage patterns opening/initializing a prefwindow note that you can define an initwithparams() function in your sub window - to handle parameters passed using openwindow() in case the window was already open. for example the permissions manager ui in firefox uses the same win...
textbox - Archive of obsolete content
ibute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but you should update your code. hidespinbuttons type: boolean if true, the number box does not have arrow buttons next to it to allow the user to adjust the value. the value may still be adjusted with the keyboard. the default value is false. increment type: integer the ...
...efore the timer fires a command event. there is no default. the timer starts after the user types a character. if the user types another character, the timer resets. type type: one of the values below you can set the type attribute to one of the values below for a more specialized type of textbox. don't set the type if you wish to use a regular textbox. autocomplete a textbox that supports autocomplete. for more information about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalpl...
...ing gets and sets the the default value in a textbox. disabled type: boolean gets and sets the value of the disabled attribute. editor type: nsieditor a reference to the nsieditor for editable text. this property is read only. emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value. this is superseded by the placeholder property in gecko 2.0. the old name is retained for compatibility, but you should update your code. increment type: integer gets and sets the value of the increment attribute. inputfield type: textbox element in mozilla, the xul textbox is implemented as a wrapper around an html input element. this read only property holds a reference to thi...
...these classes should be u...
window - Archive of obsolete content
trip (and, if currently displayed, the add-on bar) left showing. note: this has no effect if the tabs on top preference is turned off. disablefastfindtype: booleanput disablefastfind="true" on the root element of a xul document, which is intended to be loaded in a tab, to disable the find bar for the tab with this document. ...
...r for the tab with this document. this is used to prevent the find bar from being displayed when it's not supported by the content (such as in the add-ons manager tab). drawintitlebar type: boolean if this attribute is true, the top of the window's content area will begin at the top edge of the title bar, instead of below the title bar. this allows the window to draw in the title bar. this is supported only from window elements, and is ignored on platforms that don't support drawing into the title bar. fullscreenbutton type: boolean set this attribute to true to display a button in the window chrome to allow the user to switch the window into full screen mode. supported on mac os x 10.7 lion and later and on windows. the window receives a "fullscreen" event once the change has been m...
...his as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets. inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. lightweightthemes type: boolean true if the window supports lightweight themes, otherwise false. lightweightthemesfooter type: id specifies the id of an element to which a lightweight theme's footer image will be applied. screenx type: integer the horizontal position at which the window appears on the screen. screeny type: integer the vertical position at which the window appears on the screen. sizemode type: one of the va...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata see also: dom window object methods note the error message "xml parsing error: undefined enti...
Application Update - Archive of obsolete content
o construct. pref("app.update.auto", true); // defines how the application update service notifies the user about updates: // // aum set to: minor releases: major releases: // 0 download no prompt download no prompt // 1 download no prompt download no prompt if no incompatibilities // 2 download no prompt prompt // // see chart in nsupdateservice.js.in for more details // pref("app.update.mode", 1); // if set to true, the update service will present no ui for any event. pref("app.update.silent", false); // update service url: // you do not need to use all the %var% parameters. use what you need, %product%,%version%,%build_id%,%channel% for example pref("app.update.url", "https://yourserver.net/update/3/%product%/%version%/%bu...
..., "https://yourserver.net/update/3/%product%/%version%/%build_id%/%build_target%/%locale%/%channel%/%os_version%/%distribution%/%distribution_version%/update.xml"); // url user can browse to manually if for some reason all update installation // attempts fail. pref("app.update.url.manual", "http://yourserver.net/yourpage"); // a default value for the "more information about this update" link // supplied in the "an update is available" page of the update wizard. pref("app.update.url.details", "http://yourserver.net/yourpage"); // user-settable override to app.update.url for testing purposes. //pref("app.update.url.override", ""); // interval: time between checks for a new version (in seconds) // default=1 day pref("app.update.interval", 86400); // interval: time before prompting...
...pdate.nagtimer.restart", 1800); // interval: when all registered timers should be checked (in milliseconds) // default=5 seconds pref("app.update.timer", 600000); // whether or not we show a dialog box informing the user that the update was // successfully applied. ...
...ot we show a dialog box informing the user that the update was // successfully applied. this is off in firefox by default since we show a // upgrade start page instead! other apps may wish to show this ui, and supply // a whatsnewurl field in their brand.properties that contains a link to a page // which tells users what's new in this new update. pref("app.update.showinstalledui", false); // 0 = suppress prompting for incompatibilities if there are updates available // to newer versions of installed addons that resolve them. // 1 = suppress prompting for incompatibilities only if there are versioninfo // updates available to installed addons that resolve them, not newer // versions. pref("app.update.incompatible.mode", 0); update server follow the instructions here to setup a...
CommandLine - Archive of obsolete content
rs with registering and unregistering functions in your command line handler service. this has the advantage to accumulate unhandled arguments until a specific handler is added. this approach has been used in songbird. example notice the changes since gecko 2.0 (component registration has moved into the manifest file). ...
...n your command line handler service. this has the advantage to accumulate unhandled arguments until a specific handler is added. this approach has been used in songbird. example notice the changes since gecko 2.0 (component registration has moved into the manifest file). ...
...s.nsicommandlinehandler; const nsifactory = components.interfaces.nsifactory; const nsimodule = components.interfaces.nsimodule; const class_id = components.id("178cfbb6-503c-11dc-8314-0800200c9a66"); const class_name = "applicationnameclh"; const contract_id = "@example.com/applicationname/clh;1"; const cld_category = "m-applicationname"; var apphandler = { /* nsisupports */ queryinterface : function clh_qi(aiid) { if (aiid.equals(nsicommandlinehandler) || aiid.equals(nsifactory) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsicommandlinehandler */ handle : function clh_handle(acmdline) { var observerservice = components.classes["@mozilla.org/observer-service;1"...
...dline-args-changed", null); }, helpinfo : " -test <value> a test attribute\n", /* nsifactory */ createinstance : function mdh_ci(aouter, aiid) { if (aouter != null) { throw components.results.ns_error_no_aggregation; } return this.queryinterface(aiid); }, lockfactory : function mdh_lock(alock) { /* no-op */ } }; var apphandlermodule = { /* nsisupports */ queryinterface : function mod_qi(aiid) { if (aiid.equals(nsimodule) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsimodule */ getclassobject : function mod_gch(acompmgr, acid, aiid) { if (acid.equals(class_id)) return apphandler.queryinterface(aiid); throw components.results.ns_error_fail...
Mozilla release FAQ - Archive of obsolete content
and beos, and ports exist for some other platforms. what does mozilla lack that netscape 7 has? netscape 7 has versions with a number of plugins (which mozilla.org does not have the source for). netscape 7 also has icq/aim integration, as well as integration with an internet radio tool. ...
...mozilla.org does not have the source for). netscape 7 also has icq/aim integration, as well as integration with an internet radio tool. what does mozilla have that wasn't in communicator 4? mozilla has (at least) the following new features: xml support a highly configurable appearance (courtesy of xul) publicly available source code :) http compression exists on more platforms mathml support (somewhat limited at the moment) a significantly faster rendering engine better html support (css 1 and partial css 2, dom 1 and partial dom 2) plug-in jvm support tabbed browsing message filtering an irc client why is the animated icon different? the n logo is only to be present on netscape's communicator. this will serve as a way for an end-user to determine if they have mozill...
...onsidered a bad idea. i'd like to port mozilla to xxxos. any advice? if you're targeting a relatively recent unix, you probably will have very few problems. otherwise, the more unixlike the target system is, the easier your port will go. ...
...ems. otherwise, the more unixlike the target system is, the easier your port will go. i would suggest that before you devote much time and effort to your port, you consider: how many users the os has that are likely to use mozilla does the os support multitasking well enough for mozilla does the os have a sufficiently evolved gui for mozilla to work does the os have sufficient networking support for mozilla is the os typically run on systems that have the resources to run mozilla does gcc or some other easily available compiler exist for the target platform if many of these answers are no, then there will be large issues that will hamper the port. this is not meant to state that the port is not worthwhile, but that it will be difficult. how to help what projects are there for pr...
Extentsions FAQ - Archive of obsolete content
ity of ie in this respect? the ietab (opens ie in a firefox tab) should be able do this if you set it to always open "file://*" urls in an ie tab. the appearance with a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must remove updateurl from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the url in a new tab? var tab = gbrowser.addtab( url ); // and if you want it to ...
... can i backup some of the files before upgrade an extension and put them back afterward? do i need to write an installation script to achieve this? you shouldn't store data there, so there's nothing to backup. do not store files within the extension directory. the profile directory is ment to do so. storing files within the extension directory is a no-no because it might break the multi-user support of those mozilla products, as it is possible to install extensions directly within the application directory. inspector, talkback and the default theme are nowadays installed like this. does firefox clean up the preferences set by extension? if not, how to proceed? when user chooses to uninstall an extension, a nsiobserverservice notification is sent out. the problem is, while your exten...
...possible to create a sidebar on the top of the page? not unless you make it a separate window. there's a bug in bugzilla about stacking other widgets on top of browser/iframe, which hopefully will be fixed for gecko 1.9. could someone write an extension that zaps the google analytics cookie, the urchin cookie, switches gmail and google calender to https? customizegoogle extension already has support for switching gmail to https (and calendar possibly, too). does anyone know how write a bounce email extension? are you aware of the "mailredirect" extension? it allows bouncing to arbitrary addresses. it seems what you want is a one button access to that extension with a prefilled bounce address, right? could someone make an extension for thunderbird that preview upcomeing events and ...
...t preview upcomeing events and number of new messages? in our company i write this extension that connects to our groupware server (http). what server should souch extension work gainst? did you mean exchange? how to attach information using the stringproperties of an imap message with out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied. the list of "known" properties is: junkscore junkscoreorigin label priority keywords. keywords - in the gui they are called tags. they replace the old labels (although the la...
NPN_GetValue - Archive of obsolete content
the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error. npnvpri...
...the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error. ...
...the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error. npnvprivatemodebool: indicates whether or not the browser is currently in private browsing mode. ...
...npbool, which will be set appropriately if the function returns nperr_no_error. npnvdocumentorigin: the value for this variable is the unicode serialization of the origin converted to nfkc-encoded (normalized) utf-8. memory for this string must be freed by the plugin via npn_memfree(). for more information, see the document origin specification. npnvplugindrawingmodel: (mac only) npnvsupportsquickdrawbool : (mac only) npnvsupportscoregraphicsbool : (mac only) value function returns the name of the plug-in in the value parameter. gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported. returns if successful, the function returns nperr_no_error. if unsuccessful,...
Common Firefox theme issues and solutions - Archive of obsolete content
e menu bar is disabled, firefox is missing the min/max/restore/close button on the right side of the title bar. please see the following threads on mozillazine for solutions to this issue: http://forums.mozillazine.org/viewtopic.php?f=18&t=2131121 http://forums.mozillazine.org/viewtopic.php?f=18&t=1953371&start=60 windows 7 aero not going into full screen mode properly on win7 with aero glass support firefox doesn't always go to full screen mode from a normal window properly. the resolution to this issue is to add the following code to your browser.css file somewhere below where the main-window is made transparent to support aero glass. @media all and (-moz-windows-compositor) { /* make transition to fullscreen mode seamlessly in firefox 10+ */ #main-window[infullscreen="true"] { ...
...ked] > .inspector-breadcrumbs-id { .inspector-breadcrumbs-id, .inspector-breadcrumbs-classes { style inspector breadcrumb button backgrounds are not consistent between pre-ff14 and ff14+ the use of the styling rule fill in -moz-border-image is incompatible with versions of firefox older than firefox14, however, its use is needed for firefox 14 and later. themes that use -moz-border-image and support both firefox 14 and newer as well as older versions of firefox need to use both the older and newer methodologies like the following example. in most themes this issue specifically affects the breadcrumbs toolbar of the style inspector. .inspector-breadcrumbs-button { -moz-border-image: url("chrome://browser/skin/devtools/breadcrumbs/ltr-middle.png") 2 13 2 13 stretch; /* for ff13- */ -...
...e right after, and in addition to, the existing @namespace: @namespace html url("http://www.w3.org/1999/xhtml"); you can generate the error console message by going to mozilla's mission page. if you are using the extension console² you can easily filter out content related messages to see just chrome issues. warning: unknown property (obsolete css rules) -moz-border-radius firefox no longer supports -moz-border-radius style properties. use css standard border-radius properties instead (supported by firefox since firefox 4). -moz-box-shadow firefox no longer supports -moz-box-shadow style property. use css standard box-shadow property instead (supported by firefox since firefox 4). -moz-transition firefox no longer supports -moz-transition style property. use css standard transition ...
... resources amo editors theme testing guidelines when developing and testing your themes, please refer to the theme testing guidelines amo editors use to review themes. this guide will help you thoroughly test your theme to find and fix issues before you push updates to amo. ...
Processing XML with E4X - Archive of obsolete content
ithm instead. first introduced in javascript 1.6, e4x introduces a native xml object to the javascript language, and adds syntax for embedding literal xml documents in javascript code. a full definition of e4x can be found in the ecma-357 specification. this chapter provides a practical overview of the language; it is not a complete reference. compatibility issues prior to widespread browser support for the <script> element, it was common for javascript embedded in a page to be surrounded by html comment tags to prevent <script> unaware browsers from displaying javascript code to the user. this practice is no longer necessary, but remains in some legacy code. for backwards compatibility, e4x defaults to ignoring comments and cdata sections. you can add an e4x=1 argument to your <script> ...
...strings, it is necessary to convert the attribute first, even though the attribute may be converted to a string when used in other contexts (such as insertion into a textbox). if (languages.@type.tostring() === 'agile') { ... } or, simply: if (languages.@type == 'agile') { ... } working with xml objects xml objects provide a number of methods for inspecting and updating their contents. ...
...nlike javascript arrays length is a method, not a property, and must be called using length(). we can iterate through the matching elements like so: for (var i = 0; i < languages.lang.length(); i++) { alert(languages.lang[i].tostring()); } here we are using identical syntax to that used to access numbered items in an array. ...
...lang[i].tostring()); } here we are using identical syntax to that used to access numbered items in an array. despite these similarities to regular arrays, xmllist does not support array methods such as foreach, and array generics such as array.foreach() are not compatible with xmllist objects. we can also use the for each...in statement introduced in javascript 1.6 as part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also be used with regular javascript objects to iterate over the values (as opposed to the keys) contained in the object. as with for...in, using it with arrays is strongly discouraged. it is possible to create an xmllist using xml literal syntax without needing to create a well-formed xml document, using the...
@set - Archive of obsolete content
strings are not. ...
...strings are not. ...
...ersions. the @set statement creates variables used with conditional compilation statements. syntax @set @varname = term parameters varname valid javascript variable name. must be preceded by an "@" character at all times. term zero or more unary operators followed by a constant, conditional compilation variable, or parenthesized expression. ...
.... remarks numeric and boolean variables are supported for conditional compilation. strings are not. variables created using @set are generally used in conditional compilation statements, but can be used anywhere in javascript code. examples of variable declarations look like this: @set @myvar1 = 12 @set @myvar2 = (@myvar1 * 20) @set @myvar3 = @_jscript_version the following operators are supported in parenthesized expressions: ! ~ * / % + - << >> >>> < <= > >= == != === !== & ^ | && | | if a variable is used before it has been defined, its value is nan. nan can be checked for using the @if statement: @if (@newvar != @newvar) ... this works because nan is the only value not equal to itself. requirements supported in all versi...
Archived open Web documentation - Archive of obsolete content
en web topics. talk:background-size should not the "browser compatibility" table also list google chrome and konqueror? chome is not mentioned at all, but is becoming increasingly popular. konqueror is listed below the table, which seems inconsistent. znerd 04 august 2009 browser detection and cross browser support improper browser detection can lead to web maintenance nightmares. rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection. ...
...king the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection. browser feature detection an experimental approach to discovering degree of support for standards css obsolete css features displaying notifications (deprecated) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system provided by the operating system. e4x ...
...it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. ...
...the goal of parallelarray was to enable data-parallelism in web applications. the higher-order functions available on parallelarray attempted to execute in parallel, though they may fall back to sequential execution if necessary. to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports. properly using css and javascript in xhtml documents xhtml™ 1.0 the extensible hypertext markup language (second edition) defines xhtml to be a reformulation of html 4 as an xml 1.0 application. talk:javascript reference the guide section links to an intere...
The Business Benefits of Web Standards - Archive of obsolete content
tle need to plunge into the increasing costs and uncertain quality and integrity of proprietary pay per click campaigns. increase website traffic maintain contact with your user on multiple platforms standards-based code and cross-platform go hand in hand. while some browsers have quirks that cause different behavior by platform, mozilla-based browsers are designed to behave identically on all supported platforms (mac, linux, unix, windows...) web content is increasingly being accessed by a growing number of user agents other than browsers, or by browsers on different platforms - for example mobile telephones. feed content such as rss and atom simply will not work without being implemented by following the requisite standard. assumptions about the user and their platform based on erroneo...
...lving relevant content which in turn can act as fuel for social media dialogue with the user community. from this it follows that there needs to be a framework and a process for content contributors to post articles, to upload videos, sound or any other media. a web site is only a vehicle for carrying, navigating and displaying that content. content management systems attempt with some success to supply that level of functionality. they act as a very good example of real separation not only of style and content but the process by which those items - which are very different - are implemented. the process is therefore one of three stages:- the creation of content, applying the markup, and adding the style. looked at in that light it may seem surprising how clean, elegant and simple the web de...
...lighteningly fast. which is as it should be. if we have produced content we want to publish it now. not in 6 weeks time. furthermore by strictly marking the production process, time, budgets, and resources for both the initial development and the ongoing publishing of emerging content can be measured and controlled. this is a very powerful management tool. this is the power of web standards. it supplies a far better development framework, for content providers, for web developers, and for css stylists alike. it is simply not possible for everybody not to gain and share in the huge benefits of standards. customers, developers, digital media creators, can be freed from the tyranny of graphics led development, code generators, and incomprehensible markup. but the real value is at the bottom li...
...ration is impossible. coding to standards is then the only practical solution. in a ground breaking development microsoft have announced a new meta tag that can be used in sites to trigger ie 8 into web standards mode. at the same time in non standards mode existing legacy sites will still be seen as intended. although in some ways a controversial move - the announcement has attracted widespread support from leading developers and standards advocates, led by jeffrey zeldman. legacy user agents: netscape 4 and ie4 the only drawback in using css is that older browsers (specifically ie4 and ns4) will not be able to render as intended. in some cases, where a significant portion of the audience is running netscape 4.x, use of simple tables for layout and css for font control may be a solution. ...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
folder. build nptestplugin.dll with nsitestplugin.h included for compiling scriptable instance class implementaion. put nptestplugin.dll to the plugins folder. related sources the full sample plugin code can be found in the mozilla source tree under modules/plugin/samples/4x-scriptable/ ibm developer works has published a good article on xpcom. examples example 1. sample .idl file #include "nsisupports.idl" [scriptable, uuid(bedb0778-2ee0-11d5-9cf8-0060b0fbd8ac)] interface nsitestplugin : nsisupports { void nativemethod(); }; example 2. scriptable instance class #include "nsitestplugin.h" #include "nsiclassinfo.h" // we must implement nsiclassinfo because it signals the // mozilla security manager to allow calls from javascript. // helper class to implement all necessary nsiclass...
... return ns_ok;} ns_imethod getimplementationlanguage(pruint32 *aimplementationlanguage) {*aimplementationlanguage = nsiprogramminglanguage::cplusplus; return ns_ok;} // the rest of the methods can safely return error codes... ...
...escription) {return ns_error_not_implemented;} ns_imethod getclassid(nscid * *aclassid) {return ns_error_not_implemented;} ns_imethod getclassidnoalloc(nscid *aclassidnoalloc) {return ns_error_not_implemented;} }; class nsscriptablepeer : public nsitestplugin, public nsclassinfomixin { public: nsscriptablepeer(); ~nsscriptablepeer(); ns_decl_isupports ns_decl_nsitestplugin }; nsscriptablepeer::nsscriptablepeer() { ns_init_isupports(); } nsscriptablepeer::~nsscriptablepeer() { } // notice that we expose our claim to implement nsiclassinfo. ns_impl_isupports2(nsscriptablepeer, nsitestplugin, nsiclassinfo) // the following method will be callable from javascript ns_imethodimp nsscriptablepeer::nativemethod() { return ns_ok; }...
... = new nsscriptablepeer(); if (scriptablepeer) ns_addref(scriptablepeer); // addref for ourself, // don't forget to release on // shutdown to trigger its destruction } // add reference for the caller requesting the object ns_addref(scriptablepeer); *(nsisupports **)value = scriptablepeer; } else if (variable == nppvpluginscriptableiid) { nsiid* ptr = (nsiid *)npn_memalloc(sizeof(nsiid)); *ptr = scriptableiid; *(nsiid **)value = ptr; } return rv; } nperror npp_destroy (npp instance, npsaveddata** save) { if(instance == null) return nperr_invalid_instance_error; // release the scriptable object ...
Game distribution - Game development
ou will have to focus on if you truly want to succeed. mobile devices are where html5 technology can truly shine and show its advantages. there's no flash, and html5 is fully multiplatform. trying to compete with desktop games directly is very difficult. you can put your html5 games into the same arena (see native desktop, later on) and you should because it's good to diversify the platforms you support, but you have to remember that developers creating desktop games have years of experience, great tools and stable distribution channels. many html5 games will target different market segments than native desktop games, e.g. simple time killer games to be played while on the move rather than huge immersive experiences. such games are often designed to be played with two, or even one finger, so...
...ves little to no modification of the game itself — usually adding a manifest file containing necessary information in a zipped package containing all the resources is enough. the chrome web store is also an attractive option — again, having a manifest file ready, zipping your game and filling in the online submission form is about all that's required. tizen is also putting a high value on supporting apps written in javascript. their store is another available option. native mobile stores when it comes to the mobile market, there's the apple app store for ios, google play for android and all the rest of the competition. native stores are already filled with established devs selling great games, so you have to be talented and lucky to get noticed. the ios app store is quite hard t...
...ferent types of app stores you can check the list of mobile software distribution platforms article on wikipedia. native desktop to broaden your audience you can hit the desktop ecosystem with your html5 games too — just remember all the popular aaa games that take most of the market share, and think carefully about whether this suits your strategy. to do the desktop thing properly you should support all three operating systems: windows, mac os and linux. the biggest desktop store for games is definitely steam — indie developers can get on steam via the steam direct program. remember that you have to deal with the cross-platform issues yourself by uploading separate versions for different platforms. after you've covered steam, there's plenty of buzz around initiatives like humble bundl...
...ed frameworks or target platforms. it's all about picking the best tool for your particular task. phonegap — based on cordova, this is the most popular tool for building/packaging javascript apps for native platforms. cocoonio — the most popular tool specifically for building html5 games for multiple native stores. it has it's own performance optimizations for games rendered on canvas and supports many game frameworks. ejecta — a tool specifically for packaging games created with the impactjs framework for ios, built by the impactjs author. it provides seamless integration with impactjs, but it only supports only one framework and app store. nw.js — formerly known as node-webkit, this is the first choice when it comes to building a desktop game that works on windows, mac and lin...
WebGL - MDN Web Docs Glossary: Definitions of Web-related terms
webgl (web graphics library) is a javascript api that draws interactive 2d and 3d graphics. the khronos group maintains webgl, which is based on opengl es 2.0. you can invoke webgl within the html <canvas> element, which provides a rendering surface. ...
... webgl (web graphics library) is a javascript api that draws interactive 2d and 3d graphics. the khronos group maintains webgl, which is based on opengl es 2.0. you can invoke webgl within the html <canvas> element, which provides a rendering surface. ...
...vascript api that draws interactive 2d and 3d graphics. the khronos group maintains webgl, which is based on opengl es 2.0. you can invoke webgl within the html <canvas> element, which provides a rendering surface. ...
... graphics. the khronos group maintains webgl, which is based on opengl es 2.0. you can invoke webgl within the html <canvas> element, which provides a rendering surface. ...
HTML: A good basis for accessibility - Learn web development
to be looked at (although some screen readers can guess the difference between table layouts and data tables). you'll then likely (depending on which screen reader you're using) have to go down into the table as an object and look at its features separately, then get out of the table again to carry on navigating the content. table layouts are a relic of the past — they made sense back when css support was not widespread in browsers, but now they just create confusion for screen reader users. additionally, their source code requires more markup, which makes them less flexible and more difficult to maintain. you can verify these claims by comparing your previous experience with a more modern website structure example, which could look something like this: <header> <h1>header</h1> </header...
... example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc. these provide extra semantics for screen readers (and other tools) to give user extra clues about the content they are navigating (see screen reader support for new html5 section elements for an idea of what screen reader support is like). note: in addition to having good semantics and an attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sen...
...te that is meant to point to a separate web document containing an extended description of the image, for example: <img src="dinosaur.png" longdesc="dino-info.html"> this sounds like a good idea, especially for infographics like big charts with lots of information on them that could perhaps be represented as an accessible data table instead (see accessible data tables). ...
...accessible data table instead (see accessible data tables). however, longdesc is not supported consistently by screen readers, and the content is completely inaccessible to non-screen reader users. it is arguably much better to include the long description on the same page as the image, or link to it with a regular link. ...
HTML: A good basis for accessibility - Learn web development
to be looked at (although some screen readers can guess the difference between table layouts and data tables). you'll then likely (depending on which screen reader you're using) have to go down into the table as an object and look at its features separately, then get out of the table again to carry on navigating the content. table layouts are a relic of the past — they made sense back when css support was not widespread in browsers, but now they just create confusion for screen reader users. additionally, their source code requires more markup, which makes them less flexible and more difficult to maintain. you can verify these claims by comparing your previous experience with a more modern website structure example, which could look something like this: <header> <h1>header</h1> </header...
... example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc. these provide extra semantics for screen readers (and other tools) to give user extra clues about the content they are navigating (see screen reader support for new html5 section elements for an idea of what screen reader support is like). note: in addition to having good semantics and an attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sen...
...te that is meant to point to a separate web document containing an extended description of the image, for example: <img src="dinosaur.png" longdesc="dino-info.html"> this sounds like a good idea, especially for infographics like big charts with lots of information on them that could perhaps be represented as an accessible data table instead (see accessible data tables). ...
...accessible data table instead (see accessible data tables). however, longdesc is not supported consistently by screen readers, and the content is completely inaccessible to non-screen reader users. it is arguably much better to include the long description on the same page as the image, or link to it with a regular link. ...
Debugging CSS - Learn web development
have mistakes in your code the browser needs to make a guess at what you meant, and it might make a different decision to what you had in mind. in addition, two different browsers might cope with the problem in two different ways. a good first step therefore is to run your html and css through a validator, to pick up and fix any errors. ...
.... in addition, two different browsers might cope with the problem in two different ways. a good first step therefore is to run your html and css through a validator, to pick up and fix any errors. css validator html validator is the property and value supported by the browser you are testing in? browsers simply ignore css they don't understand. if the property or value you are using is not supported by the browser you are testing in then nothing will break, but that css won't be applied. devtools will generally highlight unsupported properties and values in some way. in the screenshot below the browser does not support the subgrid value of grid-template-columns. you can also take a look at the browser compatibility tables at the bottom of each property page on mdn. these show you br...
...the below table shows the compat data for the shape-outside property. no compatibility data found. ...
...the below table shows the compat data for the shape-outside property. no compatibility data found. please contribute data for "css.shape-outside" (depth: 1) to the mdn compatibility data repository. ...
CSS values and units - Learn web development
round using the rgb() function: h1 { color: black; background-color: rgb(197,93,161); } a value in css is a way to define a collection of allowable sub-values. this means that if you see <color> as valid you don't need to wonder which of the different types of color value can be used — keywords, hex values, rgb() functions, etc. you can use any available <color> values assuming they are supported by your browser. the page on mdn for each value will give you information about browser support. for example, if you look at the page for <color> you will see that the browser compatibility section lists different types of color value and support for them. let's have a look at some of the types of value and unit you may frequently encounter, with examples so that you can try out different ...
...odern computers is 24 bit, which allows the display of about 16.7 million distinct colors via a combination of different red, green and blue channels with 256 different values per channel (256 x 256 x 256 = 16,777,216.) let's have a look at some of the ways in which we can specify colors in css. note: in this tutorial we will look at the common methods of specifying color that have good browser support; there are others but they don't have as good support and are less common. color keywords quite often in examples here in the learn section or elsewhere on mdn you will see the color keywords used, as they are a simple and understandable way of specifying color. there are a number of these keywords, some of which have fairly entertaining names! you can see a full list on the page for the <...
...other and started to behave exactly the same. so for example both rgba() and rgb() accept colors with and without alpha channel values. try changing the above example's rgba() functions to rgb() and see if the colors still work! which style you use is up to you, but separating out non-transparent and transparent color definitions to use the different functions gives (very) slightly better browser support and can act as a visual indicator of where transparent colors are being defined in your code. hsl and hsla values slightly less well-supported than rgb is the hsl color model (not supported on old versions of ie), which was implemented after much interest from designers. instead of red, green, and blue values, the hsl() function accepts hue, saturation, and lightness values, which are used...
...e! images the <image> data type is used wherever an image is a valid value. this can be an actual image file pointed to via a url() function, or a gradient. in the example below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you want to read about them. position the <position> data type represents a set of 2d coordinates, used to position an item such as a background image (via background-position). it can take keywords such as top, left, bottom, right, and center to align items with specific bounds of a 2d box, along with lengths, which represent offsets...
Flexbox - Learn web development
teresting effect, which you'll see if you try resizing your browser window width. the buttons will take up as much space as they can and sit as many on the same line as they can, but when they can no longer fit comfortably on the same line, they'll drop down to create new lines. ...
...fortably on the same line, they'll drop down to create new lines. button { flex: 1 auto; margin: 5px; font-size: 18px; line-height: 1.5; } cross browser compatibility flexbox support is available in most new browsers — firefox, chrome, opera, microsoft edge and ie 11, newer versions of android/ios, etc. however you should be aware that there are still older browsers in use that don't support flexbox (or do, but support a really old, out-of-date version of it.) while you are just learning and experimenting, this doesn't matter too much; however if you are considering using flexbox in a real website you need to do testing and make sure that your user experience is still acceptable in as many browsers as possible. flexbox is a bit trickier than some css features. for example, if a...
...are just learning and experimenting, this doesn't matter too much; however if you are considering using flexbox in a real website you need to do testing and make sure that your user experience is still acceptable in as many browsers as possible. flexbox is a bit trickier than some css features. for example, if a browser is missing a css drop shadow, then the site will likely still be usable. not supporting flexbox features however will probably break a layout completely, making it unusable. we discuss strategies for overcoming cross browser support issues in our cross browser testing module. test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you...
...ll have a good play around with it as you travel forward with your learning. ...
How CSS works - Learn web development
...
...doesn't recognise. the answer is that it does nothing, and just moves on to the next bit of css! if a browser is parsing your rules, and encounters a property or value that it doesn't understand, it ignores it and moves on to the next declaration. it will do this if you have made an error and misspelled a property or value, or if the property or value is just too new and the browser doesn't yet support it. similarly, if a browser encounters a selector that it doesn't understand, it will just ignore the whole rule and move on to the next one. in the example below i have used the british english spelling for color, which makes that property invalid as it is not recognised. so my paragraph has not been colored blue. all of the other css have been applied however; only the invalid line is ign...
... it means that you can use new css as an enhancement, knowing that no error will occur if it is not understood — the browser will either get the new feature or not. coupled with the way that the cascade works, and the fact that browsers will use the last css they come across in a stylesheet when you have two rules with the same specificity you can also offer alternatives for browsers that don't support new css. this works particularly well when you want to use a value that is quite new and not supported everywhere. for example, some older browsers do not support calc() as a value. i might give a fallback width for a box in pixels, then go on to give a width with a calc() value of 100% - 50px. old browsers will use the pixel version, ignoring the line about calc() as they don't understand i...
...els, then go on to give a width with a calc() value of 100% - 50px. old browsers will use the pixel version, ignoring the line about calc() as they don't understand it. new browsers will interpret the line using pixels, but then override it with the line using calc() as that line appears later in the cascade. .box { width: 500px; width: calc(100% - 50px); } we will look at many more ways to support varying browsers in later lessons. and finally you've nearly finished this module; we only have one more thing to do. in the next article you'll use your new knowledge to restyle an example, testing out some css in the process. previous overview: first steps next in this module what is css? getting started with css how css is structured how css works using your new knowledg...
Fundamental text and font styling - Learn web development
ngs. my big red elephant cursive fonts that are intended to emulate handwriting, with flowing, connected strokes. my big red elephant fantasy fonts that are intended to be decorative. my big red elephant font stacks since you can't guarantee the availability of the fonts you want to use on your webpages (even a web font could fail for some reason), you can supply a font stack so that the browser has multiple fonts it can choose from. this simply involves a font-family value consisting of multiple font names separated by commas, e.g. p { font-family: "trebuchet ms", verdana, sans-serif; } in such a case, the browser starts at the beginning of the list and looks to see if that font is available on the machine. if it is, it applies that font to the se...
...e you get used to it, and you can use em to size everything, not just text. you can have an entire website sized using em, which makes maintenance easy. rems: these work just like em, except that 1 rem is equal to the font size set on the root element of the document (i.e. <html>), not the parent element. this makes doing the maths to work out your font sizes much easier, although if you want to support really old browsers, you might struggle — rem is not supported in internet explorer 8 and below. the font-size of an element is inherited from that element's parent element. this all starts with the root element of the entire document — <html> — the font-size of which is set to 16px as standard across browsers. any paragraph (or another element that doesn't have a different size set b...
...ont-variant-east-asian: control the usage of alternate glyphs for east asian scripts, like japanese and chinese. font-variant-ligatures: control which ligatures and contextual forms are used in text. font-variant-numeric: control the usage of alternate glyphs for numbers, fractions, and ordinal markers. font-variant-position: control the usage of alternate glyphs of smaller sizes positioned as superscript or subscript. font-size-adjust: adjust the visual size of the font independently of its actual font size. font-stretch: switch between possible alternative stretched versions of a given font. text-underline-position: specify the position of underlines set using the text-decoration-line property underline value. text-rendering: try to perform some text rendering optimization. text la...
...t that is not displayed is signaled to users. white-space: define how whitespace and associated line breaks inside the element are handled. word-break: specify whether to break lines within words. direction: define the text direction (this depends on the language and usually it's better to let html handle that part as it is tied to the text content.) hyphens: switch on and off hyphenation for supported languages. line-break: relax or strengthen line breaking for asian languages. text-align-last: define how the last line of a block or a line, right before a forced line break, is aligned. text-orientation: define the orientation of the text in a line. overflow-wrap: specify whether or not the browser may break lines within words in order to prevent overflow. writing-mode: define whethe...
Advanced text formatting - Learn web development
ion to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article. the elements described in this article are less known, but still useful to know about (and this is still not a complete list by any means). here you'll learn about marking up quotations, description lists, computer code and other related text, subscript and superscript, contact information, and more. prerequisites: basic html familiarity, as covered in getting started with html. html text formatting, as covered in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked through how to mark up basic lists...
...>rev.</abbr> green did it in the kitchen with the chainsaw.</p> these will come out looking something like this (the expansion will appear in a tooltip when the term is hovered over): note: there is another element, <acronym>, which basically does the same thing as <abbr>, and was intended specifically for acronyms rather than abbreviations. this however has fallen into disuse — it wasn't supported in browsers as well as <abbr>, and <abbr> has such a similar function that it was considered pointless to have both. just use <abbr> instead. active learning: marking up an abbreviation for this simple active learning assignment, we'd like you to simply mark up an abbreviation. you can use our sample below, or replace it with one of your own. playable code <h2>live output</h2> <div ...
...mple: <address> <p> chris mills<br> manchester<br> the grim north<br> uk </p> <ul> <li>tel: 01234 567 890</li> <li>email: me@grim-north.co.uk</li> </ul> </address> note that something like this would also be ok, if the linked page contained the contact information: <address> <p>page written by <a href="../authors/chris-mills/">chris mills</a>.</p> </address> superscript and subscript you will occasionally need to use superscript and subscript when marking up items like dates, chemical formulae, and mathematical equations so they have the correct meaning. the <sup> and <sub> elements handle this job. for example: <p>my birthday is on the 25<sup>th</sup> of may 2001.</p> <p>caffeine's chemical formula is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</s...
...cript you will occasionally need to use superscript and subscript when marking up items like dates, chemical formulae, and mathematical equations so they have the correct meaning. the <sup> and <sub> elements handle this job. for example: <p>my birthday is on the 25<sup>th</sup> of may 2001.</p> <p>caffeine's chemical formula is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>.</p> <p>if x<sup>2</sup> is 9, x must equal 3 or -3.</p> the output of this code looks like so: representing computer code there are a number of elements available for marking up computer code using html: <code>: for marking up generic pieces of computer code. <pre>: for retaining whitespace (generally code blocks) — if you use indentation or excess whitespace inside your text, browsers will ignore it ...
Introduction to events - Learn web development
listener() and removeeventlistener() reference pages. what mechanism should i use? of the three mechanisms, you shouldn't use the html event handler attributes — these are outdated, and bad practice, as mentioned above. the other two are relatively interchangeable, at least for simple uses: event handler properties have less power and options, but better cross-browser compatibility (being supported as far back as internet explorer 8). you should probably start with these as you begin learning. dom level 2 events (addeventlistener(), etc.) are more powerful, but can also become complex and are less well supported (supported as far back as internet explorer 9). you should also experiment with these, and try to use them where possible. the main advantages of the third mechanism are th...
...equired. for example, you can call addeventlistener('click', function() { ... }) on an element multiple times, with different functions specified in the second argument. this is impossible with event handler properties because any subsequent attempts to set a property will overwrite earlier ones, e.g.: element.onclick = function1; element.onclick = function2; etc. note: if you are called on to support browsers older than internet explorer 8, you may run into difficulties, as such ancient browsers use different event models from newer browsers. but never fear, most javascript libraries (for example jquery) have built-in functions that abstract away cross-browser differences. don't worry about this too much at this stage in your learning journey. other event concepts in this section, we b...
... on the server for processing, and the browser to be redirected to a "success message" page of some kind (or the same page, if another is not specified.) the trouble comes when the user has not submitted the data correctly — as a developer, you want to prevent the submission to the server and give an error message saying what's wrong and what needs to be done to put things right. some browsers support automatic form data validation features, but since many don't, you are advised to not rely on those and implement your own validation checks. let's look at a simple example. first, a simple html form that requires you to enter your first and last name: <form> <div> <label for="fname">first name: </label> <input id="fname" type="text"> </div> <div> <label for="lname">last n...
...here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> </div> when the <button> is selected, the video is displayed, by changing the class attribute on the <div> from hidden to showing (the example's css contains these two classes, which position the box off the screen and on the screen, respectively): btn.onclick = function() { videobox.setattribute(...
Client-side storage - Learn web development
this lets you persist data for long-term storage, save sites or documents for offline use, retain user-specific settings for your site, and more. this article explains the very basics of how these work. prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to use client-side storage apis to store application data. ...
... name, whether they are logged in, what color to use for the background of the screen, etc. the indexeddb api provides the browser with a complete database system for storing complex data. this can be used for things from complete sets of customer records to even complex data types like audio or video files. you'll learn more about these apis below. the future: cache api some modern browsers support the new cache api. this api is designed for storing http responses to specific requests, and is very useful for doing things like storing website assets offline so the site can subsequently be used without a network connection. cache is usually used in combination with the service worker api, although it doesn't have to be. use of cache and service workers is an advanced topic, and we won't ...
...network responses offline and then providing those in response to a request instead of the responses from the network. in effect, it allows you to make a web site work completely offline. the cache api is a another client-side storage mechanism, with a bit of a difference — it is designed to save http responses, and so works very well with service workers. note: service workers and cache are supported in most modern browsers now. at the time of writing, safari was still busy implementing it, but it should be there soon. a service worker example let's look at an example, to give you a bit of an idea of what this might look like. we have created another version of the video store example we saw in the previous section — this functions identically, except that it also saves the html, c...
...th service worker running live, and also see the source code. registering the service worker the first thing to note is that there's an extra bit of code placed in the main javascript file (see index.js). first we do a feature detection test to see if the serviceworker member is available in the navigator object. if this returns true, then we know that at least the basics of service workers are supported. inside here we use the serviceworkercontainer.register() method to register a service worker contained in the sw.js file against the origin it resides at, so it can control pages in the same directory as it, or subdirectories. when its promise fulfills, the service worker is deemed registered. // register service worker to control making site work offline if('serviceworker' in naviga...
Drawing graphics - Learn web development
rwise manipulate) svg vector images — as they are represented by markup — there was still no way to do the same for bitmap images, and the tools available were rather limited. the web still had no way to effectively create animations, games, 3d scenes, and other requirements commonly handled by lower level languages such as c++ or java. the situation started to improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed. as you'll see below, canvas provides many useful tools for creating 2d animations, games, data visualizations, and other types of app, especially when combined with some of the other apis the web platform provides. the below example s...
... create real 3d graphics inside your web browser; the below example shows a simple rotating webgl cube: this article will focus mainly on 2d canvas, as raw webgl code is very complex. we will however show how to use a webgl library to create a 3d scene more easily, and you can find a tutorial covering raw webgl elsewhere — see getting started with webgl. note: basic canvas functionality is supported well across browsers, with the exception of ie 8 and below for 2d canvas, and ie 11 and below for webgl. active learning: getting started with a <canvas> if you want to create a 2d or 3d scene on a web page, you need to start with an html <canvas> element. this element is used to define the area on the page into which the image will be drawn. this is as simple as including the element on...
...rt with an html <canvas> element. this element is used to define the area on the page into which the image will be drawn. this is as simple as including the element on the page: <canvas width="320" height="240"></canvas> this will create a canvas on the page with a size of 320 by 240 pixels. inside the canvas tags, you can put some fallback content, which is shown if the user's browser doesn't support canvas. <canvas width="320" height="240"> <p>your browser doesn't support canvas. boo hoo!</p> </canvas> of course, the above message is really unhelpful! in a real example you'd want to relate the fallback content to the canvas content. for example, if you were rendering a constantly updating graph of stock prices, the fallback content could be a static image of the latest stock graph, w...
...oolbar. if we drew it with just cury as the y coordinate, it would appear 85 pixels lower than the mouse position. function draw() { if(pressed) { ctx.fillstyle = colorpicker.value; ctx.beginpath(); ctx.arc(curx, cury-85, sizepicker.value, degtorad(0), degtorad(360), false); ctx.fill(); } requestanimationframe(draw); } draw(); note: the <input> range and color types are supported fairly well across browsers, with the exception of internet explorer versions less than 10; also safari doesn't yet support color. if your browser doesn't support these inputs, they will fall back to simple text fields and you'll just have to enter valid color/number values yourself. webgl it's now time to leave 2d behind, and take a quick look at 3d canvas. 3d canvas content is specifie...
Multimedia: Images - Learn web development
less colors an image has and the less photographic it is, the better it is to use the svg format. this requires the source to be available as in a vector graphic format. should such an image only exist as a bitmap, then png would be the fallback format to chose. examples for these types of motifs are logos, illustrations, charts or icons (note: svgs are far better than icon fonts!). both formats support transparency. pngs can be saved with three different output combinations: 24 bit color + 8 bit transparency — offer full color acurracy and smooth transparencies at the expense of size. you probably want to avoid this combination in favor for webp (see below). 8 bit color + 8 bit transparency — offer no more than 255 colors but maintain smooth transparencies. the size is not too big.
...solution top-to-bottom or even only rendering once completely downloaded. a good compressor for these would be mozjpeg, e.g. available to use in the online image optimization tool squoosh. a quality setting of 75% should yield decent results. other formats improve on jpeg's capabilities in regards to compression, but are not available on every browser: webp — created by google and nowadays supported by all major browsers except safari. supports transparency and also animation, but not progressive display. jpeg-xr — created by microsoft and only available in internet explorer and edgehtml based edge. doesn't support progressive display and the image decoding is not hardware accellerated and therefore resource intensive on the browser's main thread. jpeg2000 — once to be successor...
...r browsers except safari. supports transparency and also animation, but not progressive display. jpeg-xr — created by microsoft and only available in internet explorer and edgehtml based edge. doesn't support progressive display and the image decoding is not hardware accellerated and therefore resource intensive on the browser's main thread. jpeg2000 — once to be successor to jpeg but only supported in safari. doesn't support progressive display either. in the future browsers might add support for even more advanced formats like high efficiency image file format (heif) or av1 still image file format (avif). given the narrow support for jpeg-xr and jpeg2000, and also taking decode costs into the equation, the only serious contender for jpeg today is webp. which is why you could consi...
...this can be done via the <picture> element with the help of a <source> element equipped with a type attribute. ...
Working with Svelte stores - Learn web development
th npx degit opensas/mdn-svelte-tutorial/06-stores. so, to implement a custom store that saves its content to web storage, we will need a writable store that: initially reads the value from web storage, and if it's not present initializes it with a default value. whenever the value is modified, updates the store itself and also the data in local storage. moreover, because web storage only supports saving string values, we will have to convert from string to object when saving, and vice versa when we are loading the value from local storage. create a new file called localstore.js, in your src directory. give it the following content: import { writable } from 'svelte/store'; export const localstore = (key, initial) => { // receives the key of the local st...
...app for production with npm run build, our public/build/bundle.js file will weight a little less than 22kb. if we remove the transitions:fly directive svelte is smart enough to realize the fly function is not being used and the bundle.js file size will drop down to just 18kb. this is just the tip of the iceberg. svelte has lots of options for dealing with animations and transitions. svelte also supports specifying different transitions to apply when the element is added or removed from the dom with the in:fn/out:fn directives, and it also allows you to define your custom css and javascript transitions. it also has several easing functions to specify the rate of change over time. have a look at the ease visualizer to explore the various ease functions available. the code so far git to see...
...saw how to auto-subscribe to stores to seamlessly integrate them with the svelte reactivity system. then we saw how to implement our own store from scratch, and also how to extend svelte's writable store to persist data to web storage. at the end we had a look at using the svelte transition directive to implement animations on dom elements. in the next article we will learn how add typescript support to our svelte application. to take advantage of all its features, we will also port our entire application to typescript. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interacti...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Introduction to automated testing - Learn web development
device; choices without that icon will be run on an emulator. you'll find that you can enter urls into the address bar, and use the other controls like you'd expect on a real device. you can even do things like copy and paste from the device to your clipboard, scroll up and down by dragging with the mouse, or use appropriate gestures (e.g. pinch/zoom, two fingers to scroll) on the touchpads of supporting devices (e.g. macbook). note that not all features are available on all devices. you'll also see a menu that allows you to control the session. the features here are as follows: switch — change to another platform/device/browser combination. orientation (looks like a reload icon) — switch orientation between portrait and landscape. fit to screen (looks like a full screen icon)...
...ike a full screen icon) — fill the testing areas as much as possible with the device. capture a bug (looks like a camera) — takes a screenshot, then allows you to annotate and save it. issue tracker (looks like a deck of cards) — view previously captured bugs/screenshots. settings (cog icon) — allows you to alter general settings for the session. ...
... stop — ends the session. note: this is already very useful, and way more convenient than having to set up all these emulators and virtual machines by yourself. ...
... stop — ends the session. note: this is already very useful, and way more convenient than having to set up all these emulators and virtual machines by yourself. ...
Client-side tooling overview - Learn web development
ploy, and also adds dependencies for you automatically whenever you try to use them. it can even handle some code transformation duties for you. webpack is another very popular packaging tool that does similar things. transformation this stage of your web app lifecycle typically allows you to code in either "future code" (such as the latest css or javascript features that might not have native support in browsers yet) or code using another language entirely, such as typescript. transformation tools will then generate browser-compatible code for you, to be used in production. generally web development is thought of as three languages: html, css, and javascript, and there are transformation tools for all of these languages. transformation offers two main benefits (amongst others): the ab...
...rmation tools for all of these languages. transformation offers two main benefits (amongst others): the ability to write code using the latest language features and have that transformed into code that works on everyday devices. for example, you might want to write javascript using cutting-edge new language features, but still have your final production code work on older browsers that don’t support those features. good examples here include: babel: a javascript compiler that allows developers to write their code using cutting-edge javascript, which babel then takes and converts into old-fashioned javascript that more browsers can understand. developers can also write and publish plugins for babel. postcss: does the same kind of thing as babel, but for cutting-edge css features.
... effect you want. the option to write your code in an entirely different language and have it transformed into a web-compatible language. for example: sass/scss: this css extension allows you to use variables, nested rules, mixins, functions, and many other features, some of which are available in native css (such as variables), and some of which aren't. typescript: typescript is a superset of javascript that offers a bunch of additional features. the typescript compiler converts typescript code to javascript when building for production. frameworks such as react, ember, and vue: frameworks provide a lot of functionality for free and allow you to use it via custom syntax built on top of vanilla javascript. in the background, the framework’s javascript code works hard to in...
...t to find some dedicated tutorials on getting started with particular types of tools. great starting places is to search web sites like css tricks, dev, freecodecamp, and smashing magazine, as they’re tailored to the web development industry. again, you’ll probably go through several different tools as you search for the right ones for you, trying them out to see if they make sense, are well-supported, and do what you want them to do. this is fine — it is all good for learning, and the road will get smoother as you get more experience. summary that rounds off our gentle introduction to the topic of client-side web tooling, from a high level. next up we provide you with a crash course on the command line, which is where a lot of tooling is invoked from. we’ll take a look at what the...
Information for Assistive Technology Vendors
information for assistive technology vendors accessibility features in mozilla & call for testers! mozilla now has enough accessibility support that we're reading for early adopters and testers to start giving it a try. please read this page if you're interested in an alternative accessible browser. keyboard documentation this lists mozilla's keyboard docs in a single long document. gecko info for windows accessibility vendors mozilla supports msaa (microsoft active accessibility) in html and in our user interface (based on xul technology). this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. in addition, we provide some simple interfaces via whic...
...orts msaa (microsoft active accessibility) in html and in our user interface (based on xul technology). this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. in addition, we provide some simple interfaces via which we expose a read-only dom (document object model). mozilla support for linux/unix assistive technology developers mozilla supports the at-spi (assistive technology service provider interface) in html and in our user interface (based on xul technology). this makes it possible for the developers of linux and unix accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. join the mozilla...
...is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Information for External Developers Dealing with Accessibility
contains info on accessible roles, states and events. accessible toolkit checklist a list of what needs to be done for accessibility when building new toolkits, widget by widget. ...
...contains info on accessible roles, states and events. accessible toolkit checklist a list of what needs to be done for accessibility when building new toolkits, widget by widget. ...
...is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Windows SDK versions
if it does, several features will be disabled if you build with an sdk older than the default, which means that you'll have to specify a non-default sdk version explicitly. quick start follow the instructions for whichever version of visual c++ you're using. visual studio professional 2013 this comes with the windows 8.1 sdk included. visual studio express 2013 for windows desktop this comes with the windows 8.1 sdk included. visual studio professional 2012 this comes with the windows 8.0 sdk included. visual studio 2012 express for windows desktop this comes with the windows 8.0 sdk included. ...
...udio professional 2012 this comes with the windows 8.0 sdk included. visual studio 2012 express for windows desktop this comes with the windows 8.0 sdk included. visual c++ 10 (vs2010) professional this comes with the windows 7 sdk, so you should be all set out of the box. visual c++ 10 (vs2010) express download and install the windows 7 sdk. older versions some of the older version are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. windows 8 sdk (official) features that depend on this sdk include: metro firefox front end gamepad api support you can download the sdk from the microsoft download center [web setup]. windows 7 sdk features that depend on this sdk include: windows 7 taskbar previews windows 7 d...
...icle. windows 8 sdk (official) features that depend on this sdk include: metro firefox front end gamepad api support you can download the sdk from the microsoft download center [web setup]. windows 7 sdk features that depend on this sdk include: windows 7 taskbar previews windows 7 download taskbar progress windows 7 jump lists you can download the sdk (v7.0 [web setup or iso image] or unsupported v7.1 [web setup or iso image]) from the microsoft download center. note that if you're running a 64 bit version of windows you may require the "amd" version of the sdk even if you have an intel processor, and you may need to deselect the documentation component in the installer in order to avoid an installation error. (this was certainly the case for 64 bit windows 7 on a late 2008 macbook ...
...n installation error. (this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%". older sdks these are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still failing! try the following things in order: run the windows sdk configuration tool (if available) and make sure the right sdk is selected. restart the msys console. delete your entire object directory an...
The Firefox codebase: CSS Guidelines
, an overflow scrollbar will show on the left. write padding: 0 3px 4px; instead of padding: 0 3px 4px 3px;. this makes it more obvious that the padding is symmetrical (so rtl won't be an issue). note: see css logical properties and values for more information. testing to test for rtl layouts, you can go to about:config and set intl.uidirection to -1. ...
...ac-yosemite-theme targets macos 10.10 and higher, so it should be privileged over the styling for macos 10.9. do this: @media (-moz-mac-yosemite-theme: 0) { #placeslist { box-shadow: inset -2px 0 0 hsla(0,0%,100%,.2); } } not this: #placeslist { box-shadow: inset -2px 0 0 hsla(0,0%,100%,.2); } @media (-moz-mac-yosemite-theme) { #placeslist { box-shadow: none; } } theme support firefox comes built-in with 3 themes: default, light and dark. the built-in light/dark themes are a bit special as they load the compacttheme.css stylesheet. in addition to this, firefox supports a variety of webextension themes that can be installed from amo. for testing purposes, here is an example of a webextension theme. writing theme-friendly css some css variables that are pre-adju...
...pecial as they load the compacttheme.css stylesheet. in addition to this, firefox supports a variety of webextension themes that can be installed from amo. for testing purposes, here is an example of a webextension theme. writing theme-friendly css some css variables that are pre-adjusted for different platforms are also pre-adjusted for themes, so it's again a good idea to use them for theme support. the text color of elements often contains valuable information from the theme colors, so currentcolor/inheritance is again a good idea for theme support. never write css specially for the built-in light/dark theme in compacttheme.css unless that css isn't supposed to affect webextension themes. these selectors can be used to target dark areas: :-moz-lwtheme-brighttext: dark window f...
...ad to undefined behaviour. css selectors when targetting the root element of a page, using :root is the most performant way of doing so. reflows and style flushes see performance best practices for firefox front-end engineers for more information about this. misc text aliasing when convenient, avoid setting the opacity property on text as it will cause text to be aliased differently. hdpi support it's recommended to use svg since it keeps the css clean when supporting multiple resolutions. see the svg guidelines for more information on svg usage. however, if only 1x and 2x png assets are available, you can use this @media query to target higher density displays (hdpi): @media (min-resolution: 1.1dppx) ...
Eclipse CDT
and use the context menu to select "open call hierarchy". note that there are buttons to the right of the "open call hierarchy" tab that open to switch between "show callers" and "show callees". to see the inheritance tree for a class, select its name in an editor window and select "open type hierarchy" from the context menu. note that you can switch between "show the type hierarchy", "show the supertype hierarchy", and "show the subtype hierarchy" using the buttons to the right of the "type hierarchy" tab. to see the overrides of a virtual method, select that method's name in an editor window and select "open type hierarchy" or, "quick type hierarchy" from the context menu. the results for "open type hierarchy" will show all classes in the class inheritance tree, and the classes that have...
... > open perspective > c/c++". upgrading gdb on mac the ancient, barely maintained apple fork of gdb that comes with xcode on mac is really horrible. if you use mac, you may want to build the latest fsf version of gdb and set eclipse to use that gdb for debugging. one suggested configuration for building gdb is '--prefix="$home" --disable-debug --with-python=/usr' (create an optimized build with support for python (so that you can use python to much better control when you break etc.), and install it in $home/bin). that done, open the workspace preferences, select "c/c++ > debug > gdb", and set "gdb debugger" to the full path of your new gdb executable. gdb unexpectedly detaching if gdb starts ignoring your breakpoints, or unexpectedly terminates or detaches from the firefox process, this ...
...ect directory in order to produce good results, we can't have eclipse ignore the object directory. but then there's no way to tell eclipse that any given file in the object directory is actually just a copy of a given file in the source directory and that it should always show the user the copy in the source directory while using the file in the object directory for indexing. building eclipse's support for building only in certain directories is non-existent. it would be great if the console tab gave you a shell prompt so that you could invoke commands to build directly from there. failing that, it would be nice if eclipse could at least pass information about what files have changed to the build process, which could then decide on a faster way to do the build (e.g., "just make in layout/"...
...ou're on your own.) simply delete the .project and .cproject files and the .settings directory (if it exists) from the root of your mozilla tree, and then delete the workspace directory corresponding to your tree. that's it; you can now create a new eclipse workspace and project for your tree from scratch. isn't there a better method of build option discovery? yes, but eclipse doesn't currently support it. instead of processing build console output, eclipse could use something like ld_preload to load its own little library into all the processes that are invoked as part of the build process. this library could then check whether the process is a compiler instance and, if so, use the processes' current working directory and the arguments that were passed to it to reliably obtain the informat...
Embedding the editor
at editor needs to deal with. note here that i use the term 'composer' to mean an html-savvy compose widget that does rich text editing, and 'editor' to mean a plain text editor (as well as the underlying technology for composer). <htmlarea> is intended as a shorthand for a rich-text multiline text widget embedded in an html document, and is not meant to infer that future versions of mozilla will support this specific tag. composer embedded in a xul application developers need to embed composer widgets in their xul applications, by using the <editor> tag as we do today. they should need to do as little work as possible to get basic editing functionality, be able to have any number of <editor>s per window, and control whether those <editor>s are in html or plain text mode. composer embedded in...
...et. this type of embedding requires that the composer code is agnostic to where its ui is coming from; communication between the core editor and the ui needs to go through one or more interfaces that insulate the editor from its host application. (the current nseditorshell makes assumptions about the hosting xul document, which need to be broken.) composer embedded in a web page (<htmlarea>) ie 5 supports the <htmlarea> element; if mozilla is to support something similar, editor needs to be embeddable to the extent that this can be done. it is likely that we'd use xbl to implement this type of widget, as is the plan for other form controls. as is the case for composer embedded in a native application, there is a requirement here that the composer ui be configurable, such that it can be displa...
... changes such that the embedding applications above can be fulfilled, and these changes will need to address the current problems. briefly, the embedding objectives are: <editor> should get you a working editor in a xul application should be able to have multiple <editor>s per xul window should be able to embed an editable content frame in a native application embedders should be able to supply their own chrome (toolbars etc). meeting these objectives will also solve the following existing composer problems: composer should handle frameset documents composer should handle documents with <iframe>s. composer shouldn't rely on certain xul document structure proposed solutions fixing editor rooting as described above, editor rooting needs to be changed so that an editor lives on...
...the xul nodes. fix existing js and c++ code which explicitly addresses elements in the xul document to go through nsieditoruserinterface. steps to embedding this section attempts to lay out an implementation plan, with the aim of keeping everything working as the various steps are taken. some of these tasks can be done concurrently. ...
How to implement a custom autocomplete search component
the xul textbox element supports an autocomplete mechanism that is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. there are actually two autocomplete mechanisms: an older mechanism that is part of the "xpfe" codebase and is used in older applications such as thunderbird and seamonkey. a newer and slightly simplified mechanism that is used in "toolkit" applications such as firefox and xulrunner. thunderbird 2.x and seamonkey 1.1.x support the toolkit interfaces, although they do not use the same autocomplete widget. to use autocomplete with a xul textbox, all you need to do is set some attributes: <textbox type="autocomplete" autocompletesearch="history"/> the type="autocomplete" turns on the autocomplete mec...
...utocomplete with a xul textbox, all you need to do is set some attributes: <textbox type="autocomplete" autocompletesearch="history"/> the type="autocomplete" turns on the autocomplete mechanism and the autocompletesearch="history" sets the source for the autocomplete. there are more options and features, see xul:textbox_(firefox_autocomplete) for more details. the toolkit mechanism has built-in support for several autocomplete sources, including: history: search the browser's url history (firefox: 1.0+; seamonkey: 1.1+) form-history: search the values that the user has entered into form fields. (firefox: 1.0+; seamonkey: 2.0+) file: search file names (firefox: 2.0+; thunderbird: 2.0+; seamonkey: 1.1+; gtk builds only). the component uses the autocompletesearchparam attribute or searchpa...
...he value at the given index from the autocomplete results. * if removefromdb is set to true, the value should be removed from * persistent storage as well. ...
... } var newresult = new simpleautocompleteresult(searchstring, ci.nsiautocompleteresult.result_success, 0, "", results, comments); listener.onsearchresult(this, newresult); } }, /* * stop an asynchronous search that is in progress */ stopsearch: function() { }, queryinterface: function(aiid) { if (!aiid.equals(ci.nsiautocompletesearch) && !aiid.equals(ci.nsisupports)) throw components.results.ns_error_no_interface; return this; } }; // factory var simpleautocompletesearchfactory = { singleton: null, createinstance: function (aouter, aiid) { if (aouter != null) throw components.results.ns_error_no_aggregation; if (this.singleton == null) this.singleton = new simpleautocompletesearch(); return this.singleton.quer...
OS.File for the main thread
more recent version. example: path manipulation the following snippet obtains the path to file "sessionstore.js", contained in the user's profile directory. let sessionstore = os.path.join(os.constants.path.profiledir, "sessionstore.js"); // under linux, this is generally "$home/.firefox/profiles/$profilename/sessionstore.js" // under macos, this is generally "$home/library/application support/firefox/$profilename/sessionstore.js" // under windows, this is generally "%appdata%\local\temp\%profilename%"\sessionstore.js // etc. example: determine if a file is a directory the following snippet determines if some path represents a file or a directory: let promise = os.file.stat(somepath); promise = promise.then( function onsuccess(stat) { if (stat.isdir) { // the...
....path.desktopdir, 'my.png')); //do it like this for images on disk var path = 'https://mozorg.cdn.mozilla.net/media/img/firefox/channel/toggler-beta.png?2013-06'; //do like this for images online img.src = path; example: append to file this example shows how to use open, write, and close to append to a file. if the file does not exist, it is created. at the time of this writing, write does not support encoding option so the text to be written has to be encoded with textencoder. this example also shows the resolve value of open (an instance of os.file, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), and close (undefined, meaning there is no resolve value). var pth = os.path.join(os.constants.path.desktopdir, 'app.txt'); os.file...
...nt8array> read( in string path, [optional] in object options ) arguments path the full path to the file to read. optionsoptional an optional object used to control the behavior of this function. you may pass an object with a subset of the following fields: bytes the number of bytes to read. if unspecified, read the complete file. encoding instead of using textdecoder, you can supply a string to this option. for example, instead of: let decoder = new textdecoder(); let promise = os.file.read("file.txt"); promise = promise.then( function onsuccess(array) { return decoder.decode(array); // convert this array to a text } ); you can simply do: let promise = os.file.read("file.txt", { encoding: "utf-8" }); promise = promise.then( function onsuccess(text)...
...vailable since firefox 30. if specified, backup the destination file as backupto. note that this function renames the destination file before overwriting it. if the process or the operating system freezes or crashes during the short window between these operations, the destination file will have been moved to its backup. encoding available since firefox 22. instead of using textencoder, you can supply a string to this option. for example, instead of: let encoder = new textencoder(); let array = encoder.encode("this is some text"); let promise = os.file.writeatomic("file.txt", array, {tmppath: "file.txt.tmp"}); you can simply do: let promise = os.file.writeatomic("file.txt", "this is some text", { encoding: "utf-8", tmppath: "file.txt.tmp" }) limitations in a few extreme cases (har...
WebRequest.jsm
see some examples of using filter. modifying & canceling requests you can use the webrequest api to modify and cancel network requests. what exactly you're able to do to a network request depends on the stage at which you have intercepted the request: that is, the webrequest event that your listener is ...
...pattern("https:/developer.mozilla.org/*"); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern(["https://mozorg.cdn.mozilla.net/*", "https://mdn.mozillademos.org/*", "https://developer.cdn.mozilla.net/*"]); see the match patterns article for details on the syntax of the strings you supply. if you supply an array of strings, then a url matches if it matches any of the strings. see some examples of using filter. modifying & canceling requests you can use the webrequest api to modify and cancel network requests. what exactly you're able to do to a network request depends on the stage at which you have intercepted the request: that is, the webrequest event that your listener is attached to. fo...
...eived. this is only included if you set "responseheaders" in the opt_extrainfospec argument. statuscode number http response code. types resource types the resource type string identifies the kind of resource being fetched. it's used in two places: filtering requests by type, and as the type property of the argument passed to the listener. ...
...e and value: name type description name string header name, for example "content-type" value string header value, for example "image/png" chrome incompatibilities although this api is modeled on chrome's webrequest extension api, there are some differences. we're working on addressing them, though. filtering by windowid and tabid is not supported. the onauthrequired, onbeforeredirect, and onerroroccurred events are not supported. the "requestbody" instruction in opt_extrainfospec is not supported. redirection is not allowed in onbeforerequest or onheadersreceived, but is allowed in onbeforesendheaders. see bug 1176092. handlerbehaviorchanged() is not supported. requestid is not included in the argument passed to the listener. ...
Localization content best practices
cal details. localization files choose good key ids the ids (names) chosen for your keys, regardless of the file format, should always be descriptive of the string, and its role in the interface (button label, title, etc.). think of them as long variable names. when you have to change a key id, adding a progressive number to the existing key should always be used as a last resort. for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is definitely a better choice for the new string than new-event-header1. if a string is tied to an accesskey or a tooltip, use string ids that highlight this relation: neweventbtn.label = add event neweventbtn.accesskey = a neweventbtn.tooltip = add a new event don't duplicate ...
...hese two translations will be ignored. add localization notes localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. these comments are generally referred to as localization notes. don't forget to add a localization note when: part of the string is not supposed to be localized (for example, the name of an html attribute in a warning). string includes variables: always explain what will be the value of these variables at run-time. english could be ambiguous. for example: bookmark. is this a noun or a verb? using meaningful ids could also help in these cases. strings are used in a specific context. for example accessibility (a11y) strings: in this...
... the' or 'from the', basque adds an ending to a word to express the same concept. for example from the menu in basque is menutik and to the printers is inprimagailuei. implication: using placeholders for something like 'the text' or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. as a native english speaker, you might find it natural to use delete-cookie = delete cookie delete-cookies = delete cookies in firefox this should be # localization note (delete-cookies): semi-colon list of plural forms. # see: http://developer.mozilla.org/en/docs/localization_and_plurals # #1 is the number of cookies to delete # example: delete-cookies = delete #1 c...
...self, that would need copywriters), it's definitely good to ask feedback. keywords: l12y, late-l10n two keywords are generally used on bugzilla: l12y: it's used to track "localizability" bugs. a bug marked with l12y describes an issue that prevents localizers to create a good quality localization. some examples: hard-coded strings, implicit grammar structure in the code, lack of plural forms support, ui that breaks with long strings, etc. late-l10n: it's used by release-drivers to identify bugs, involving new strings, that will land late in the cycle, typically after soft string freeze in firefox os. alias :l10n the :l10n alias on bugzilla (community@localization.bugs) is followed by some localizers and it could be cc'd to gather opinions from the wider l10n community (no point in op...
Updates
this page is not maintained frequently. please follow our monthly irc meeting for the latest updates. march 22, 2011 firefox 4.0 has been released! this new version comes with several bug fixes and new features for mathml. some improvements are particularly worth noting: a new html parser, which lets you use mathml inside non-xhtml documents. complete support for stix fonts 1.0. better rendering of mathematical symbols, especially stretchy operators. october 21, 2010 mathml 3.0 is now a w3c recommendation! june 11, 2010 stix fonts version 1.0 are now compatible with trunk. may 28, 2010 stix fonts version 1.0 released. april 2010 new web pages for the mozilla mathml project! documentation is now available on mdc and wiki.mozilla.org. feel free to complete and improve i...
...cumentation is now available on mdc and wiki.mozilla.org. feel free to complete and improve it! may 8, 2007 mozilla ceo speaks out on the future of firefox: the complete 8,000 word interview. interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml. ...
...eaks out on the future of firefox: the complete 8,000 word interview. interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml. june 5, 2002 mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others. ...
... mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others. mozilla 1.0 features full support for html 4.0, xml 1.0, resource description framework (rdf), cascading style sheets level 1 (css1), and the w3c document object model level 1 (dom1) [...] as well as support for display of mathematical equations using mathml." december 7, 2001 status report october 2000 the first international mathml conference april 14, 2000 status report february 12, 2000 mathml-enabled m13 builds for win32 september 21, 1999 mathml has landed. september 18, 1999 status report - mozillazine annoucement september 3, 1999 xsl coming to mozilla? mathml too? may 23,...
Profiling with the Firefox Profiler
hard to find issues that have already been reported. therefore, it's usually a good idea to file a bug. profiling local windows builds if you built firefox for windows locally and you would like to use the local symbols with the profiler, you will need to run an additional tool; see profiling with the firefox profiler and local symbols on windows. profiling try builds profiling try builds is supported, but to have symbols in the profiles, they need to be available on the symbol server. symbols for try builds are not uploaded to the symbol server automatically, you need to trigger a "sym" job on treeherder: using treeherder's add new jobs ui, schedule a "sym" job for each platform whose "b" job you want symbols for. (and "symn" if you have an "n" job you want symbols for, i.e. a build jo...
...erver. symbols for try builds are not uploaded to the symbol server automatically, you need to trigger a "sym" job on treeherder: using treeherder's add new jobs ui, schedule a "sym" job for each platform whose "b" job you want symbols for. (and "symn" if you have an "n" job you want symbols for, i.e. a build job with the "nightly configuration.) profiling firefox mobile firefox 61 for android supports gecko profiler again; see remote profiling on android for details. the following information is old version of firefox for android. for local builds of fennec, you should build with optimization and strip_flags="--strip-debug" but not with --enable-profiling. nightly builds are already built with the appropriate flags. you'll need to have adb and arm-eabi-addr2line (which is part of the...
...om your binary. your profile will now, hopefully, be updated with symbols. upload it for further analysis! i haven’t yet had the opportunity to try this, but i hope to next week. i’d be eager to hear people’s experience giving this a go – it might be a great tool in determining what’s going on in firefox when it’s hung! profiling threads the firefox profiler has rudimentary support for profiling multiple threads. to enable it, check the 'multi-thread' box then enter one or more thread names into the textbox beside it. thread names are the strings passed to the base::thread class at initialization. at present there is no central list of these thread names, but you can find them by grepping the source. examples: 1 2 if the filter you entered is invalid, no threads will ...
... there is no central list of these thread names, but you can find them by grepping the source. examples: 1 2 if the filter you entered is invalid, no threads will be profiled. you can identify this by hitting analyze (cleopatra will show you an error message). if the filter is left empty, only the main thread is captured (as if you had not enabled multi-thread.) profiler features the profiler supports several features. these are options to gather additional data in your profiles. each option will increase the performance overhead of profiling so it's important to activate only options that will provide useful information for your particular problem to reduce the distortion. all options may be set in about:profiling or through the moz_profiler_startup_features environement variable. here ...
Refcount tracing and balancing
refcount tracing and balancing are advanced techniques for tracking down leak of refcounted objects found with bloatview. the first step is to run firefox with refcount tracing enabled, which produces one or more log files. refcount tracing logs calls to addref and release, preferably for a particular set of classes, including call-stacks in symbolic form (on platforms that support this). refcount balancing is a follow-up step that analyzes the resulting log to help a developer figure out where refcounting went wrong. how to build for refcount tracing build with --enable-debug or --enable-logrefcnt. how to run with refcount tracing on there are several environment variables that can be used. first, you select one of three environment variables to choose what kind of logging you w...
...uld never use this without xpcom_mem_log_classes and/or xpcom_mem_log_objects, because without some filtering the logging will be completely useless due to how slow the browser will run and how large the logs it produces will be. xpcom_mem_comptr_log this environment variable enables logging of additions and releases of objects into nscomptrs. ...
...this results in slower code, but at least you get some data about where the leaks might be occurring from. ...
... on all platforms. however, having an nscomptr log and using it in the creation of the balance tree allows addref and release calls that we know are matched to be eliminated from the tree, so it makes it much easier to debug reference count leaks of objects that have a large amount of reference counting traffic. xpcom_mem_alloc_log for platforms that don't have stack-crawl support, xpcom supports logging at the call site to addref/release using the usual cpp __file__ and __line__ number macro expansion hackery. this results in slower code, but at least you get some data about where the leaks might be occurring from. you must also set one or two additional environment variables, xpcom_mem_log_classes and xpcom_mem_log_objects, to reduce the set of objects being logged, in order to i...
Phishing: a short definition
world of second factors. a second factor is something a user possesses to further authenticate with a service. for example, a usb token, bluetooth device, mobile phone, or simply a key stored on a separate device. the first factor is usually the password and username. if both factors don’t match, the service will reject authentication requests. ...
... usb token, bluetooth device, mobile phone, or simply a key stored on a separate device. the first factor is usually the password and username. if both factors don’t match, the service will reject authentication requests. public key cryptography many services will soon support w3c web authentication, a powerful technology to evade phishing, based on public key cryptography. web authentication supports millions of readily avilable fido u2f usb security keys, and will support the more advanced fido 2.0 keys, once made available. verification via text message if a service supports verification, via sms, it sends a text message with a one-time pin to the user’s phone number. the user then enter this pin after the web service verifies the username and password. this was chosen as an early...
...the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial. one-time password algorithms a better way to use phones as second factor, are one-time password (otp) protocols, like totp and hotp. ...
...ion, the provider will often generate a qr code to be read by an otp app. this qr code is nothing more than a random, secret key, that is stored on the user’s phone. after verifying username and password, the user is prompted 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. otp is the most widely supported second factor schemes and can be used to secure your most important accounts. unfortunately, some users still feel it's too tedious unlocking a phone, opening the otp app, and manually typing a few digits each time a provider requests a new token. this can be phished by an attacker, though with totp apps the attacker has limited time to make their unauthorized login. ...
NSS 3.12.6 release notes
s are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.4/. new in nss 3.12.6 ssl3 & tls renegotiation indication extension (rfc 5746) by default, nss 3.12.6 uses the new tls renegotiation indication extension for tls renegotiation but allows simple ssl/tls connections (without renegotiation) with peers that don't support the tls renegotiation indication extension. the behavior of nss for renegotiation can be changed through api function calls, or with the following environment variables: nss_ssl_enable_renegotiation values: [0|n|n]: ssl_renegotiate_never never allow renegotiation ...
... nss_ssl_require_safe_negotiation values: 1: requiresafenegotiation = true unset: requiresafenegotiation = false controls whether safe renegotiation indication is required for initial handshake. if true, a connection will be dropped at initial handshake if the peer server or client does not support safe renegotiation. the default setting for this option is false. these options can also be set with the following ssl options: ssloptions.enablerenegotiation ssloptions.requiresafenegotiation new pseudo cipher suite value: tls_empty_renegotiation_info_scsv (cannot be negotiated) ...
...t, nss logs rsa pre-master secrets to this file. this allows packet sniffers to decrypt tls connections. see documentation. note: the code must be built with trace defined to use this functionality. bugs fixed the following bugs have been fixed in nss 3.12.6. ...
...532417: build problem with spaces in path names bug 534943: clean up the makefiles in lib/ckfw/builtins bug 534945: lib/dev does not need to include headers from lib/ckfw bug 535669: move common makefile code in if and else to the outside bug 536023: der_utctimetotime and der_generalizedtimetotime ignore all bytes after an embedded null bug 536474: add support for logging pre-master secrets bug 537356: implement new safe ssl3 & tls renegotiation bug 537795: nss_initcontext does not work with nss_registershutdown bug 537829: allow nss to build for android bug 540304: implement ssl_handshakenegotiatedextension bug 541228: remove an obsolete nspr version check in lib/util/secport.c bug 541231: nssi...
NSS 3.14.2 release notes
have been added. they are still under review, and contributions are welcome. the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and pclmulqdq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and ht...
...(https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. ...
...ws, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=837799 if you build nss with the system sqlite library and your system sqlite library is older than 3.7.15. bug 816853 - when using libpkix for certificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been t...
...aded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been tested. bug 373108 - fixed a bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 - fixed a crash in dtls_freeha...
NSS 3.16.2 release notes
3.16.2 are described in the "bugs fixed" section below. distribution information the hg tag is nss_3_16_2_rtm. nss 3.16.2 requires nspr 4.10.6 or newer. nss 3.16.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_2_rtm/src/ new in nss 3.16.2 new functionality dtls 1.2 is supported. the tls application layer protocol negotiation (alpn) extension is also supported on the server side. rsa-oeap is supported. use the new pk11_privdecrypt and pk11_pubencrypt functions with the ckm_rsa_pkcs_oaep mechanism. new intel aes assembly code for 32-bit and 64-bit windows, contributed by shay gueron and vlad krasnov of intel. new functions in cert.h ​cert_addextensionb...
...sm_type. pk11_pubencrypt - encrypts with a public key. the algorithm is specified with a ck_mechanism_type. new macros in sslerr.h ssl_error_next_protocol_no_callback - an ssl error code that means the next protcol negotiation extension was enabled, but the callback was cleared prior to being needed. ...
...ssl_error_next_protocol_no_protocol - an ssl error code that means the server supports no protocols that the client advertises in the alpn extension. notable changes in nss 3.16.2 the btoa command has a new command-line option -w suffix, which causes the output to be wrapped in begin/end lines with the given suffix. use "c" as a shorthand for the suffix certificate. the certutil commands supports additionals types of subject alt name extensions: --extsan type:name[,type:name]... ...
...in the alpn extension. notable changes in nss 3.16.2 the btoa command has a new command-line option -w suffix, which causes the output to be wrapped in begin/end lines with the given suffix. use "c" as a shorthand for the suffix certificate. the certutil commands supports additionals types of subject alt name extensions: --extsan type:name[,type:name]... the certutil commands supports generic certificate extensions, by loading binary data from files, which have been prepared using external tools, or which have been extracted and dumped to file from other existing certificates: --dump-ext-val oid --extgeneric oid:critical-flag:filename[,oid:critical-flag:filename]... the certutil command has three new certificate usage specifiers: l: certificateusages...
NSS 3.21 release notes
_rtm. nss 3.21 requires nspr 4.10.10 or newer. nss 3.21 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_rtm/src/ security fixes in nss 3.21 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. ...
... secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_rtm/src/ security fixes in nss 3.21 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. ...
...s_kdf are identifiers for additional pkcs#12 mechanisms for tls 1.2 that are currently unused in nss. ...
... computes tls finished mac in secoidt.h nss_use_alg_in_ssl_kx - policy flag indicating that keys are used in tls key exchange in sslerr.h ssl_error_rx_short_dtls_read - error code for failure to include a complete dtls record in a udp packet ssl_error_no_supported_signature_algorithm - error code for when no valid signature and hash algorithm is available ssl_error_unsupported_signature_algorithm - error code for when an unsupported signature and hash algorithm is configured ssl_error_missing_extended_master_secret - error code for when the extended master secret is missing after having been negotiated ssl_error_unexpected_extended_master_secret - error code for receiving an extended master secret when previously not negotiated in sslt.h ssl_ena...
NSS 3.24 release notes
itly to select a "slot" into which the certificate is configured (which incorrectly identifies a key agreement type rather than a certificate). separate functions for configuring online certificate status protocol (ocsp) responses or signed certificate timestamps are not needed, since these can be added to the optional sslextraservercertdata struct provided to ssl_configservercert. also, partial support for rsa probabilistic signature scheme (rsa-pss) certificates has been added. although these certificates can be configured, they will not be used by nss in this version. for functions that use temporary arenas, allocating a portcheaparena on the stack is more performant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_free...
...te key, and other information. in secport.h port_initcheaparena - initializes an arena that was created on the stack. (see portcheaparenapool.) port_destroycheaparena - destroys an arena that was created on the stack. (see portcheaparenapool.) new types in sslt.h sslextraservercertdata - optionally passed as an argument to ssl_configservercert. this struct contains supplementary information about a certificate, such as the intended type of the certificate, stapled ocsp responses, or signed certificate timestamps (used for certificate transparency). in secport.h portcheaparenapool - a stack-allocated arena pool, to be used for temporary arena allocations. new macros in pkcs11t.h ckm_tls12_mac in secoidt.h sec_oid_tls_ecdh...
...sslciphersuiteinfo. instead, applications should use the newly added attribute authtype. rename ssl_auth_rsa to ssl_auth_rsa_decrypt. add a shared library (libfreeblpriv3) on linux platforms that define freebl_lowhash. remove most code related to ssl v2, including the ability to actively send a sslv2-compatible client hello. however, the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set. to enable the functionality in optimized builds, you must define the symbol nss_allow_sslkeylogfile when building nss. update nss to protect it against the cachebleed attack. disable...
...orts processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable is set. to enable the functionality in optimized builds, you must define the symbol nss_allow_sslkeylogfile when building nss. update nss to protect it against the cachebleed attack. disable support for dtls compression. improve support for tls 1.3. this includes support for dtls 1.3. note that tls 1.3 support is experimental and not suitable for production use. bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.24 ...
Overview of NSS
nss provides a complete open-source implementation of the crypto libraries used by aol, red hat, google, and other companies in a variety of products, including the following: mozilla products, including firefox, thunderbird, seamonkey, and firefox os. aol instant messenger (aim) open source client applications such as evolution, pidgin, apache openoffice, and libreoffice. ...
...ns such as evolution, pidgin, apache openoffice, and libreoffice. server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server. server products from oracle (formerly sun java enterprise system), including oracle communications messaging server and oracle directory server enterprise edition. suse linux enterprise server supports nss and the mod_nss ssl module for the apache web server. nss includes a framework to which developers and oems can contribute patches, such as assembler code, to optimize performance on their platforms. nss 3.x has been certified on 18 platforms. for more detailed information about nss, see wiki.mozilla.org and nss faq. source code for a java interface to nss is available in the mozilla...
...the mozilla cvs tree. for details, see network security services for java. nss makes use of netscape portable runtime (nspr), a platform-neutral open-source api for system functions designed to facilitate cross-platform development. like nss, nspr has been battle-tested in multiple products. for more information, see the nspr project page. interoperability and open standards you can use nss to support a range of security standards in your application, including the following: ssl v3. the secure sockets layer (ssl) protocol allows mutual authentication between a client and server and the establishment of an authenticated and encrypted connection. tls v1.3 (rfc 8446), tls v1.2 (rfc 5246), tls v1.1 (rfc 4346), tls v1 (rfc 2246). the transport layer security (tls) protocol from the ietf th...
...t a range of security standards in your application, including the following: ssl v3. the secure sockets layer (ssl) protocol allows mutual authentication between a client and server and the establishment of an authenticated and encrypted connection. tls v1.3 (rfc 8446), tls v1.2 (rfc 5246), tls v1.1 (rfc 4346), tls v1 (rfc 2246). the transport layer security (tls) protocol from the ietf that supersedes ssl. pkcs #1. rsa standard that governs implementation of public-key cryptography based on the rsa algorithm. pkcs #3. rsa standard that governs implementation of diffie-hellman key agreement. pkcs #5. rsa standard that governs password-based cryptography, for example to encrypt private keys for storage. pkcs #7. rsa standard that governs the application of cryptography to data, for ex...
PKCS #11 Module Specs
libraries which accept parameters must check if the 'new' preserved field is null if and only if libraryparameters field is not null. nss specific parameters in module specs here are the nss application specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use them). nss="nss_params" nss_params are themselves name/value pairs, parsed with the same rules described above. valid names inside nss_params are: flags - comma separated list of flag values, parsed case-insensitive. valid flag values are: internal - this library is actually the netscape internal library fips - this library is the netscape internal fips library. crit...
...id names inside nss_params are: flags - comma separated list of flag values, parsed case-insensitive. valid flag values are: internal - this library is actually the netscape internal library fips - this library is the netscape internal fips library. critical - if this library cannot be loaded, completely fail initialization. moduledb - this library includes nss specific functions to supply additional module specs for loading. moduledbonly - this library has no pkcs #11 functions and is only used for loading additional modules. trustorder - integer value specifying the order in which the trust information for certificates specified by tokens on this pkcs #11 library should be rolled up. '0' means that tokens on this library should not supply trust information (default). the re...
...s="keyfile=/u/relyea/keyfile" nss="trustorder=50 ciphers=fortezza slotparams=0x1=[slotflags='fortezza']" library=core32.dll name="litronic netsign" softoken specific parameters the internal nss pkcs #11 implementation (softoken) requires applications parameters. it will not initialize if the parameters= is not specified. if another application wishes to load the softoken, that application must supply a non-null libraryparameters value in the ck_c_initialize_args structure passed at c_initialize time. the parameter passed to softoken is a space separated list of name/value pairs exactly like those specified in the pkcs #11 module spec. valid values are: configdir configuration directory where nss can store persistant state information (typically databases). secmod name of the secmo...
... fipsslotdescription override the default slotdecription value for the internal fips token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partial utf8 characters dropped). flags comma separated list of flag values, parsed case-insensitive. flags valid flags are: nomoddb don't open secmod.db and try to supply the strings. the mod db function is not through standard pkcs #11 interfaces. readonly databases should be opened read only. nocertdb don't try to open a certificate database. nokeydb don't try to open a key database. forceopen don't fail to initialize the token if the databases could not be opened. passwordrequired zero length passwords are not acceptable (valid only if there i...
NSS Tools crlutil
netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in the same directory. -i crl-import-file specify the file which contains the crl to import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 ...
...: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer. this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl. add revocation reason code extension: the reasoncode is a non-critical crl entry extension that ide...
...on for the certificate revocation. ...
... ...
NSS Tools modutil
ipher flags. the jar file should also contain any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. see the section jar installation file for information on creating the special script needed to perform an installation through a server or with the security module database tool (that is, in environments without javascript support). for general installation instructions and to install a module in environments where javascript support is available (as in netscape communicator), see the document using the jar installation manager to install a pkcs #11 cryptographic module. -delete modulename delete the named module. note that you cannot delete the netscape communicator internal pkcs #11 module. -changepw tokenname ch...
...ions and arguments. the options and arguments in square brackets are optional, those without square brackets are required. ...
... this information file contains special scripting and must be declared in the jar archive's manifest file. the script can have any na...
...s, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens. keys keys are case-insensitive. this section discusses the following keys: global keysper-platform keysper-file keys global keys forwardcompatible gives a list of platforms that are forward compatible. if the current platform cannot be found in the list of supported platforms, then the forwardcompatible list is checked for any platforms that have the same os and architecture in an earlier version. if one is found, its attributes are used for the current platform. platforms (required) gives a list of platforms. each entry in the list is itself a key-value pair: the key is the name of the platform and the value list contains various attributes of the...
NSS tools : signtool
agement system: you must download the the ca certificate in addition to obtaining your own signing certificate. ca certificates for several certificate authorities are preinstalled in the communicator certificate database. when you receive an object-signing certificate for your own use, it is automatically installed in your copy of the communicator client software. communicator supports the public-key cryptography standard known as pkcs #12, which governs key portability. you can, for example, move an object-signing certificate and its associated private key from one computer to another on a credit-card-sized device called a smart card. options -b basename specifies the base filename for the .rsa and .sf files in the meta-inf directory t...
...o list detailed information about a particular signing certificate. the -l option is available in netscape signing tool 1.0 and later versions only. -j signs a directory of html files containing javascript and creates as many archive files as are specified in the html tags. even if signtool creates more than one archive file, you need to supply the key database password only once. the -j option is available only in netscape signing tool 1.0 and later versions. the -j option cannot be used at the same time as the -z option. if the -c# option is not used with the -j option, the default compression value is 6. note that versions 1.1 and later of netscape signing tool corr...
... in the certificate database, that the ca's digital signature on the object-signing certificate is valid, that the relevant certificates have not expired, and so on. --verbosity value sets the quantity of information netscape signing tool generates in operation. a value of 0 (zero) is the default and gives full information. a value of -1 suppresses most messages, but not error messages. -w archive displays the names of signers of any files in the archive. -x directory excludes the specified directory from signing. note that with netscape signing tool version 1.1 and later this option can appear multiple times on one command line, making it possible to specify ...
...n external module) dll name: core32 slots: 1 slots attached status: loaded slot: litronic 210 token: ----------------------------------------------- using netscape signing tool and a smart card to sign files the signtool command normally takes an argument of the -k option to specify a signing certificate. to sign with a smart card, you supply only the fully qualified name of the certificate. to see fully qualified certificate names when you run communicator, click the security button in navigator, then click yours under certificates in the left frame. fully qualified names are of the format smart card:certificate, for example "mycard:my signing cert". you use this name with the -k argument as follows: signtool ...
Proxies in Necko
rmation about the type of the proxy, its host and its port. nsiioservice the decision whether to use a proxy is made in nsioservice::newchannelfromuri. it first asks the nsiprotocolproxyservice for an nsiproxyinfo. ...
...yinfo - if the channel supports nsiproxiedprotocolhandler. otherwise, the proxy info is discarded. nsiprotocolproxyservice the most important function on nsiprotocolproxyservice is resolve. it checks whether the passed-in uri should use a proxy, and returns an nsiproxyinfo if so. this works by examining the protocolflags of the protocol handler for the given uri. if this protocol handler does not support proxies, resolve returns null. alternatively, if proxies are disabled, or this host is in the list of hosts for which no proxy should be used, null is also returned. if pac (proxy autoconfiguration) is enabled, it is asked for the proxy string for the given uri, which determines whether to use a proxy. ...
...finally, depending on the protocol, the proxy info will be created with the appropriate type, host and port. socks and nsisockettransportservice the aforementioned methods work very well for application-level proxies. ...
...indicated by its protocol flags. finally, depending on the protocol, the proxy info will be created with the appropriate type, host and port. socks and nsisockettransportservice the aforementioned methods work very well for application-level proxies. however, socks is transparent to upper-level protocols, and can transport any other tcp- or udp-based protocol. therefore, nsisockettransportservice supports creating socket transports using an nsiproxyinfo. this proxy info will only be used if it specifies a socks proxy, through which the connection is then made. note that socks is implemented as an nsisocketprovider, and the socket transport service will therefore use it as as the downmost socket type. proxies and local hosts requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey...
Rhino overview
of code that it may in turn generate). these features allow for the implementation of a traditional url-based security policy for javascript as in netscape navigator. embeddings that trust the javascript code they execute may ignore the security features. embeddings that run untrusted javascript code must do two things to enable the security features. first, every context that is created must be supplied an instance of an object that implements the securitysupport interface. this will provide rhino the support functionality it needs to perform security-related tasks. second, the value of the property security.requiresecuritydomain should be changed to true in the resource bundle org.mozilla.javascript.resources.security. the value of this property can be determined at runtime by calling the...
...perform security-related tasks. second, the value of the property security.requiresecuritydomain should be changed to true in the resource bundle org.mozilla.javascript.resources.security. the value of this property can be determined at runtime by calling the issecuritydomainrequired method of context. setting this property to true requires that any calls that compile or evaluate javascript must supply a security domain object of any object type that will be used to identify javascript code. in a typical client embedding, this object might be a string with the url of the server that supplied the script, or an object that contains a representation of the signers of a piece of code for certificate-based security policies. when javascript code attempts a restricted action, the security domain ...
...uritymanager.getclasscontext()). then, the class of the code that called to request the restricted action can be obtained by looking an appropriate index into the class context array. if the caller is javascript the class obtained may be one of two types. first, it may be the class of the interpreter if interpretive mode is in effect. second, it may be a generated class if classfile generation is supported. an embedding can distinguish the two cases by calling isinterpreterclass() in the context class. if it is the interpreter class, call the getinterpretersecuritydomain() method of context to obtain the security domain of the currently executing interpreted script or function. otherwise, it must be a generated class, and an embedding can call getsecuritydomain() in the class implementing sec...
...d. an embedding can distinguish the two cases by calling isinterpreterclass() in the context class. if it is the interpreter class, call the getinterpretersecuritydomain() method of context to obtain the security domain of the currently executing interpreted script or function. otherwise, it must be a generated class, and an embedding can call getsecuritydomain() in the class implementing securitysupport. when the class was defined and loaded, the appropriate security domain was associated with it, and can be retrieved by calling this method. once the security domain has been determined, an embedding can perform whatever checks are appropriate to determine whether access should be allowed. ...
JS_SetOptions
ct) as the ecma "variables object". this flag is recommended. without it, the two scripts "x = 1" and "var x = 1", where no variable x is in scope, do two different things. the former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. ...
..." and "var x = 1", where no variable x is in scope, do two different things. the former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. mxr id search for jsoption_varobjfix jsoption_private_is_nsisupports mozilla extension. the context's private data points to an xpcom object (see nsisupports). this is only meaningful if spidermonkey is built with xpconnect. mxr id search for jsoption_private_is_nsisupports jsoption_compile_n_go caller of js_compilescript et al promises to execute the compiled script once only, in the same scope object used for compilation. the caller may not modify objects on the scope chain between compilation and execution. ...
...omises to execute the compiled script once only, in the same scope object used for compilation. the caller may not modify objects on the scope chain between compilation and execution. this enables compile-time scope chain resolution of consts (a performance optimization). mxr id search for jsoption_compile_n_go jsoption_atline //@line number ["filename"] option supported for the xul preprocessor and kindred beasts. mxr id search for jsoption_atline jsoption_xml obsolete since jsapi 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if ...
...r and kindred beasts. mxr id search for jsoption_atline jsoption_xml obsolete since jsapi 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if this is off, e4x syntax isn't supported no matter what version number is set. mxr id search for jsoption_allow_xml jsoption_moar_xml added in spidermonkey 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. only used if jsoption_allow_xml is set. mxr id search for jsoption_moar_xml jsoption_native_...
SpiderMonkey 31
ains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. the download url is outdated and spidermonkey not release alone! get it here mozilla-esr31 you will find it in "firefox extended support release 31" package on hg release platform support spidermonkey 31 is supported on all the platforms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-tim...
...platforms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initializ...
...posed js_init method. after this method is called, normal jsapi operations are permitted. when all jsapi operation has completed, the corresponding js_shutdown method (currently non-mandatory, but highly recommended as it may become mandatory in the future) uninitializes spidermonkey, cleaning up memory and allocations performed by js_init. a major change to spidermonkey in 31 is that its apis support a moving garbage collector. this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided value/string/object or its location. the js::handle<js::value> and js::mutablehandle<js::value> classes have been specialized to implement the same interface as js::value,...
...t exposed to the public api. known issues detail any known issues here... future direction ...insert details on future plans... spidermonkey embedders should be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 38
and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — sep 17, 2015 the download url is outdated and spidermonkey not release alone! get it here mozilla-esr38 you will find it in "firefox extended support release 38" package on hg release platform support spidermonkey 38 is supported on all the platforms where firefox 38 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles jav...
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... ...
...api can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... xxx will need updating for actual new gc stuff at time! a major change to spidermonkey in 38 is that its apis support a moving garbage collector. this entailed changing the vast majority of the ...
...ded/removed methods here... known issues detail any known issues here... future direction ...insert details on future plans... spidermonkey embedders should be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi, stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 45
onkey releases. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). — apr 14, 2016 platform support spidermonkey 45 is supported on all platforms able to run firefox 45. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it i...
... on remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. ...
... on remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. ...
...s that have retain their previous name, providing relatively unchanged functionality. applications will require significant changes, but most changes will be automatically detected by the c/c++ compiler, making them easy to detect and updating the code a relatively straightforward job. here is a list of the most significant changes: js::nullptr is obsolete. you should now use nullptr instead. (supporting decltype(nullptr)). new javascript language features javascript 45 includes significant updates to its language features, yo. new c++ apis jsapi is a c++ exclusive api. please note that spidermonkey reserves the js:: namespace for itself for public exports and the js:: namespace for internal use. js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 11595...
Gecko Roles
role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. ...
... role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. ...
...esents an alert or a condition that a user should be notified about. assistive technologies typically respond to the role by reading the entire onscreen contents of containers advertising this role. should be used for warning dialogs, etc. role_window represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by microsoft windows. role_internal_frame a sub-document. role_menupopup represents a menu, which presents a list of options from which the user can make a selection to perform an action. role_menuitem represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. role_tooltip represents a to...
... events. role_check_menu_item represents a menu item with a check box. role_color_chooser represents a specialized dialog that lets the user choose a color. role_date_editor represents control whose purpose is to allow a user to edit a date. role_desktop_icon an iconified internal frame in an role_desktop_pane. role_desktop_frame a desktop pane. a pane that supports internal frames and iconified versions of those internal frames. role_directory_pane a directory pane. a pane that allows the user to navigate through and select the contents of a directory. may be used by a file chooser. role_file_chooser a file chooser. a specialized dialog that displays the files in the directory and lets the user select a file, browse a different director...
Gecko states
state constants are defined in nsiaccessiblestates. states list state_unavailable the object is unavailable, i.e. disabled. applied to: all roles. state_selected the object is selected, i.e. indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. applied to: role_menuitem, role_cell, role_outlineitem, xxx: continue events: event_state_change Дoncomitant state: state_selectable state_focused the object is focused applied to: events: concomitant state: state_focusable state_pressed the object is pressed. ...
...plied to: events: concomitant state: state_focused state_selectable the object can be selected. applied to: events: concomitant state: state_selected state_linked indicates that the object is formatted as a hyperlink. the object role will usually be role_text_leaf. state_traversed the object is a hyperlink that has been visited (previously clicked) by a user. ...
...ed state_selectable the object can be selected. applied to: events: concomitant state: state_selected state_linked indicates that the object is formatted as a hyperlink. the object role will usually be role_text_leaf. state_traversed the object is a hyperlink that has been visited (previously clicked) by a user. ...
...e object role will usually be role_text_leaf. state_traversed the object is a hyperlink that has been visited (previously clicked) by a user. state_multiselectable supports multiple selection state_extselectable supports extended selection state_required indicates that user interaction is required. state_important isn;t used. state_invalid indicates a validation failure. ...
Setting up the Gecko SDK
ese include directories to this field as well. assuming you are using the example location for your project, these paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include under the c++ language category, disable exception handling. as described in the section exceptions in xpcom, exception handling isn't supported across interface boundaries, so setting this option may catch problems during development. the weblock component needs to link against the appropriate libraries to uses xpcom glue. to add these libraries, select the link tab, then choose the input category. in this panel, instead of linking to the include subdirectories of the nspr, embedstring, and xpcom directories, add the paths to the ...
...ed the component without sending any extra dlls set path=%path%;d:\projects\xulrunner-sdk\sdk\bin;d:\projects\xulrunner-sdk\bin this tells the command prompt where to find the gecko tools, importantly (xpidl, regxpcom, and gmake). building the sample built sample in d:\projects\sample the idl this step is fairly straight forward. first create the idl file. ispecialthing.idl #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; next is to build the .h file to compile against and the .xpt for gecko to understand your new interface. xpidl -m header ispecialthing.idl xpidl -m typelib ispecialthing.idl the code add the main code, the real work horse...
...__specialthing_impl_h__ #define __specialthing_impl_h__ #include "ispecialthing.h" #include "nsstringapi.h" #define specialthing_contractid "@starkravingfinkle.org/specialthing;1" #define specialthing_classname "specialthing" #define specialthing_cid { 0x245626, 0x5cc1, 0x11db, { 0x96, 0x73, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispecialthing cspecialthing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cspecialthing.cpp #include "cspecialthing.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspec...
...om.lib xpcomglue_s.lib nspr4.lib "cspecialthing.obj" "cspecialthingmodule.obj" clean: del *.lib *.dll *.obj *.exp please note, this makefile is only for compiling the sample, you will probably have more .lib files if you are linking against winapi functions like kernel32.lib, user32.lib, etc. also, if you notice, this turns on "xp_win" and "xp_win32" definitions, this allows xp and onward support. to build the component, just type "gmake", to clean up files run "gmake clean". installing component this if for manually installing the component for testing. i used a different firefox profile for testing purposes called extensions. copy the .dll file to your extensions directory. %applicationdata%\mozilla\firefox\profiles\x.extensions\extensions\bob@george.com. then copy the .xpt fi...
Inheriting from implementation classes
e generated ib c++ abstract class doesn't make things easier. so, in code: idl: interface ia { void funca(); } interface ib : ia { void funcb(); } interface ic : ib { void funcc(); } c++ implementation: class a : public ia { ??? } class b : public a, public ib { ??? } class c : public b, public ic { ??? } example solution a.h, as usual: class a : public ia { ... ns_decl_isupports ns_decl_ia } a.cpp, as usual: ns_impl_isupports1(a, ia) ns_imethodimp a::funca() { ... } b.h: class b : public a, public ib { ... ns_decl_isupports_inherited ns_forward_ia(a::) // need to disambiguate ns_decl_ib } b.cpp: ns_impl_isupports_inherited1(b, a, ib) // this, superclass,added ifaces ns_imethodimp b::funcb() { ... } c.h: class c : public b, publi...
...a here). the rest stays as-is. ...
...public ib { ... ns_decl_isupports_inherited ns_forward_ia(a::) // need to disambiguate ns_decl_ib } b.cpp: ns_impl_isupports_inherited1(b, a, ib) // this, superclass,added ifaces ns_imethodimp b::funcb() { ... } c.h: class c : public b, public ic { ... ns_decl_isupports_inherited ns_forward_ia(b::) ns_forward_ib(b::) ns_decl_ic } c.cpp: ns_impl_isupports_inherited1(c, b, ic) ns_imethodimp c::funcc() { ... } threadsafe if you want to make this threadsafe, you can replace ns_impl_isupports1(a, ia) with ns_impl_threadsafe_isupports1(a, ia) in the base implementation class only (e.g. a here). the rest stays as-is. the inheriting classes (b, c here) don't need to change their macros. ...
... ns_impl_isupports_inherited1(c, b, ic) ns_imethodimp c::funcc() { ... } threadsafe if you want to make this threadsafe, you can replace ns_impl_isupports1(a, ia) with ns_impl_threadsafe_isupports1(a, ia) in the base implementation class only (e.g. a here). the rest stays as-is. the inheriting classes (b, c here) don't need to change their macros. see also dbaron's coding practices nsisupportsimpl.h comments author ben bucksch. ...
Components.interfaces
e of the xpcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which xpconnect is capable of reflecting into javascript. properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid. this includes nsisupports.queryinterface(), the optional parameter accepted by nsijscid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.getinterfaces(). the properties of the components.interfaces object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are indexed by interface name. you can retrieve an...
...scid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.getinterfaces(). the properties of the components.interfaces object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are indexed by interface name. ...
...pt, and nsiclassinfo.getinterfaces(). the properties of the components.interfaces object can be enumerated using a for...in loop. usage accessing an interface object properties of the components.interfaces object are indexed by interface name. you can retrieve an interface object using: var iface = components.interfaces.nsisupportsarray; this will return you the interface object for the nsisupportsarray interface. ...
...retrieve an interface object using: var iface = components.interfaces.nsisupportsarray; this will return you the interface object for the nsisupportsarray interface. accessing constants defined in an interface interface descriptions (cf. xpidl) may not only contain method declarations, but also constants. ...
nsIAccessibleEditableText
accessible/public/nsiaccessibleeditabletext.idlscriptable an interface for editing text of an accessible object. the operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text. it also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the specified position. ...
...leeditabletext.idlscriptable an interface for editing text of an accessible object. the operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text. it also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the specified position. ...
...read only. native code only! methods copytext() copies the text range into the clipboard. void copytext( in long startpos, in long endpos ); paramete...
...presented by this object. exceptions thrown ns_error_failure indicates the text cannot be pasted from the clipboard. setattributes() sets the attributes for the text between the two given indices. the old attributes are replaced by the new list of attributes. for example, sets font styles, such as italic, bold, and so on. void setattributes( in long startpos, in long endpos, in nsisupports attributes ); parameters startpos the start index of the text whose attributes are modified. endpos the end index of the text whose attributes are modified. attributes the set of attributes that replaces the old list of attributes of the specified text portion. exceptions thrown ns_error_not_implemented always. the method is not implemented. settextcontents() replaces the ...
nsIAccessibleRole
accessible/public/nsiaccessiblerole.idlscriptable this interface defines cross platform (gecko) roles. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) constants constant value description role_nothing 0 used when accessible has no strong defined role. role_titlebar 1 represents a title or caption bar for a window. it is used by msaa only, supported automatically by ms windows. role_menubar 2 represents the menu bar (positioned beneath the title bar of a window) from which menus are selected by the user. the role is used by xul:menubar or role="menubar". role_scrollbar 3 represents a vertical or horizontal scroll bar, which is part of the client area or used in a co...
...special mouse pointer, which allows a user to manipulate user interface elements such as windows. for example, a user clicks and drags a sizing grip in the lower-right corner of a window to resize it. role_sound 5 represents a system sound, which is associated with various system events. role_cursor 6 represents the system mouse pointer. role_caret 7 represents the system caret. the role is supported for caret. role_alert 8 represents an alert or a condition that a user should be notified about. assistive technologies typically respond to the role by reading the entire on screen contents of containers advertising this role. should be used for warning dialogs, etc. the role is used by xul:browsermessage, role="alert", xforms:message. role_window 9 represents the window frame, which c...
.... assistive technologies typically respond to the role by reading the entire on screen contents of containers advertising this role. should be used for warning dialogs, etc. the role is used by xul:browsermessage, role="alert", xforms:message. role_window 9 represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by ms windows. role_internal_frame 10 a sub-document or iframe. role_menupopup 11 represents a menu, which presents a list of options from which the user can make a selection to perform an action. it is used for role="menu". role_menuitem 12 represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. it is used for...
...k_menu_item 67 represents a menu item with a check box. role_color_chooser 68 represents a specialized dialog that lets the user choose a color. role_date_editor 69 represents control whose purpose is to allow a user to edit a date. role_desktop_icon 70 an iconified internal frame in an role_desktop_pane. also refer to role_internal_frame. role_desktop_frame 71 a desktop pane. a pane that supports internal frames and iconified versions of those internal frames. role_directory_pane 72 a directory pane. a pane that allows the user to navigate through and select the contents of a directory. may be used by a file chooser. also refer to role_file_chooser. role_file_chooser 73 a file chooser. a specialized dialog that displays the files in the directory and lets the user select a file, ...
nsIAlertsService
toolkit/components/alerts/nsialertsservice.idlscriptable this interface can be used to notify the user of something that does not require an immediate reaction. for example, it can be used to notify the user that their downloads are complete or that they have new mail. ...
... note: since gecko 22, the notifications are provided by firefox and have become platform-independent. ...
... 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) by default a message is displayed in a small window that slides up from the bottom of the screen, holds there for a few seconds, then slides down. the specific appearance varies from platform to platform. note: prior firefox 22, the alerts service was only supported on windows in gecko 1.7, had no effect on mac os x in gecko 1.8, but was fully supported in mac os x in gecko 1.9. note: since gecko 22, the notifications are provided by firefox and have become platform-independent. 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(i...
...ame optional a name for the notification; this is not displayed in the alert. however, certain notification systems (such as growl on mac os x) allow the user to disable alerts by name. this name is used in that configuration panel. on android the name is hashed and used as a notification id. dir optional bidi override for the title. valid values are "auto", "ltr" or "rtl". only available on supported platforms. lang optional language of title and text of the alert. only available on supported platforms. data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for ipc security checks, and to determine whether the alert is actionable. inprivatebrowsing optional controls the image loa...
nsIBidiKeyboard
widget/public/nsibidikeyboard.idlscriptable this interface lets the application detect bidirectional writer users, and do some magic for them. ...
...lean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed. read only. note: this throws ns_error_not_implemented if the widget layer doesn't provide this information. currently, this is only implemented on windows. methods islangrtl() determines if the current keyboard language is right-to-left. (supported on: win32, mac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value. boolean islangrtl(); parameters none. return value true if the current keyboard is right-to-left, false if it is not. exceptions thrown ns_error_failure if no right-to-left keyboards are installed. setlangfrombidilevel() sets the keyboard language to left-to-right ...
...ac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value. boolean islangrtl(); parameters none. return value true if the current keyboard is right-to-left, false if it is not. exceptions thrown ns_error_failure if no right-to-left keyboards are installed. setlangfrombidilevel() sets the keyboard language to left-to-right or right-to-left. (supported on: win32) void setlangfrombidilevel( in pruint8 alevel ); parameters alevel if odd set the keyboard to right-to-left, if even set left-to-right. exceptions thrown ns_error_failure if no right-to-left keyboards are installed. remarks implementation windows this implementation uses win32 api to get the language of the keyboard layout, and the direction of those languag...
...the code is going to be on gtk+ later, and we will use gtk+ api instead. both gtk+ and gecko versions, check keysym's on keyboard layout to detect the direction of the layout. for gtk+ (>=2.10.1, >=2.12.0) and all gecko versions, we check only the first shift-level of the layout, to fix the problem with hebrew layouts. more info: bug 348724, bug 348724, and gnome bug: 116626 mac only islangrtl is supported on this platform. bug 266551 see also documentation for bidi mozilla ...
nsIClassInfo
read only. ...
...read only. ...
...lags. it has no meaning when returned from the flags attribute of a nsiclassinfo implementation. obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage. for example, if asked for the helper for nsiprogramminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsixpcscriptable interface to assist xpconnect in supplying javascript specific behavior to callers of the instance object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. nsiprogramminglanguage defines language identifiers that may be passed f...
... language this parameter selects the language mapping specific helper object to be returned. nsiprogramminglanguage defines language identifiers that may be passed for this parameter. return value should return null if no helper available for given language. getinterfaces() this method returns an ordered list of interfaces iids that instances of the class promise to implement. note that nsisupports is an implicit member of the implemented set of interfaces and need not be included. if this method is not supported by an implementation, then it should return 0 for count and null for array. void getinterfaces( out pruint32 count, [array, size_is(count), retval] out nsiidptr array ); parameters count the length of the resulting array. array the resulting array of nsiidptr val...
nsICryptoHash
netwerk/base/public/nsicryptohash.idlscriptable this interface can be used to compute a cryptographic hash function of some data. you can, for example, calculate the sha256 hash of a file to determine if it contains the data you think it does. the hash algorithms supported are md2, md5, sha-1, sha-256, sha-384, and sha-512. ...
... netwerk/base/public/nsicryptohash.idlscriptable this interface can be used to compute a cryptographic hash function of some data. you can, for example, calculate the sha256 hash of a file to determine if it contains the data you think it does. the hash algorithms supported are md2, md5, sha-1, sha-256, sha-384, and sha-512. ...
.... this method may be called multiple times with different algorithm types. note: this method or " .. manch("initwithstring") .. " must be called before any other method on this interface is called. void init( in unsigned long aalgorithm ); parameters aalgorithm the hash algorithm to use. must be one of the hash algorithms. exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed initwithstring() initialize the hashing object. this method may be called multiple times with different algorithm types. note: this method or " .. manch("init") .. " must be called before any other method on this interface is called. void initwithstring( in acstring aalgorithm ); parameters aalgorithm the hash algorithm type to be used as a string, suc...
...ct. this method may be called multiple times with different algorithm types. note: this method or " .. manch("init") .. " must be called before any other method on this interface is called. void initwithstring( in acstring aalgorithm ); parameters aalgorithm the hash algorithm type to be used as a string, such as "sha256". exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed update() adds an array of data to be hashed to the object. see computing the hash of a string for an example of using this method. void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata. exceptions thrown ns_error_not_initializ...
nsIDOMXPathEvaluator
dom/interfaces/xpath/nsidomxpathevaluator.idlscriptable this interface is used to evaluate xpath expressions against a dom node. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/xpath-evaluator;1. ...
... note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting ...
...tance(components.interfaces.nsidomxpathevaluator); method overview nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations. note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting with gecko 1.9, however, you must call it on the same document. nsidomxpathexpression createexpression( in domstring expression, ...
...n the xpath itself, so that they can be matched with the document. null is common for html documents or when no name space prefixes are used. nsidomxpathnsresolver creatensresolver( in nsidomnode noderesolver ); parameters noderesolver the node to be used as a context for name space resolution. return value a name space resolver. evaluate() evaluate the specified xpath expression. nsisupports evaluate( in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result ); parameters expression a string representing the xpath to be evaluated. contextnode a dom node to evaluate the xpath expression against. to evaluate against a whole document, use the document.documentelement. resolver...
nsIDictionary
gecko 1.9.1 inherits from: nsisummary last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface was removed in firefox 3.5; use dict.jsm instead. see bug 668424 for further information. method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dictionary. boolean haskey( in string key ); parameters key key to check for. return value true if present, false if absent. getkeys() retrieve all keys i...
...esent in the dictionary. boolean haskey( in string key ); parameters key key to check for. return value true if present, false if absent. getkeys() retrieve all keys in the dictionary. void getkeys( out pruint32 count, [retval, array, size_is(count)] out string keys ); return value array of all keys, unsorted. getvalue() find the value indicated by the key. ...
... return value the removed value. if the key doesn't exist, ns_error_failure will be returned. ...
... key doesn't exist, ns_error_failure is returned. setvalue() add the key-value pair to the dictionary. if the key is already present, the new value replaces the old one. void setvalue( in string key, in nsisupports value ); parameters key the key by which the value can be accessed. value the value to store. deletevalue() find the value indicated by the key. nsisupports deletevalue( in string key ); parameters key the key indicating the pair to be removed. return value the removed value. if the key doesn't exist, ns_error_failure will be returned. clear() delete all key-value pairs from the dictionary. void clear(); parameters none. ...
nsIDocumentLoader
uriloader/base/nsidocumentloader.idlscriptable this interface responsible for tracking groups of loads that belong together (images, external scripts, and so on.) and subdocuments (iframe, frame, and so on.). it is also responsible for sending nsiwebprogresslistener notifications. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/docloaderservice;1. to create an instance, use: var documentloader = components.classes["@mozilla.org/docloaderservice;1"] .createinstance(components.interfaces.nsidocumentloader); method overview void clearparentdocloader(); obsolete since gecko 1.8 void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8...
... documentchannel nsichannel read only. ...
... documentchannel nsichannel read only. loadgroup nsiloadgroup read only. methods clearparentdocloader() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void clearparentdocloader(); parameters none. ...
...eters awebprogress arequest astatus amessage native code only!getcontentviewercontainer obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. void getcontentviewercontainer( in nsisupports adocumentid, out nsicontentviewercontainer aresult ); parameters adocumentid aresult getloadgroup() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) nsiloadgroup getloadgroup(); parameters none. return value isbusy() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) b...
nsIDragSession
usually the target "frame" sets this so the native system can render the correct feedback. ...
...usually the target "frame" sets this so the native system can render the correct feedback. ...
...usually the target "frame" sets this so the native system can render the correct feedback. ...
...methods getdata() gets data from a drag and drop operation. can be called while the drag is in process or after the drop has completed. void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); parameters atransferable the transferable for the data to be put into. aitemindex which of multiple drag items, zero-based. must be less than numdropitems. isdataflavorsupported() checks to see if any of the native data on the clipboard matches a given data flavor. if numdropitems is greater than one, there is no indication as to which of the items matches the data flavor. boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the data to be matched, such as "text/unicode". return value tru...
nsIFactory
xpcom/components/nsifactory.idlscriptable this interface is a class factory that allows for the creation of nsisupports derived classes without specifying a concrete class type. inherits from: nsisupports last changed in gecko 0.9.5 method overview void createinstance(in nsisupports aouter, in nsiidref iid, [retval, iid_is(iid)] out nsqiresult result); void lockfactory(in prbool lock); methods createinstance() creates an instance of the class associated with this factory. unlike getservice, this returns a new instance each time it is called. ...
...this can be nsnull if no aggregation is requested. iid the iid of the interface being requested in the component which is being currently created. ...
...eters aouter pointer to a component that wishes to be aggregated in the resulting instance. this can be nsnull if no aggregation is requested. iid the iid of the interface being requested in the component which is being currently created. result pointer to the newly created instance, if successful. exceptions thrown ns_error_no_interface indicates that the requested interface is not supported. ns_error_no_aggregation indicates that aggregation is not supported. lockfactory() this method provides the client a way to keep the component in memory until it is finished with it. gecko 1.7 note as of gecko 1.7, this method is unused. most implementations do nothing interesting with this method. it exists primarily for binary compatibility with microsoft com's iclassfactory i...
...icrosoft com's iclassfactory interface. ...
nsIHttpServer
s.jsm"); function create() { var server = components.classes["@mozilla.org/server/jshttp;1"] .createinstance(components.interfaces.nsihttpserver); return { get objectname () { return "webserver"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options. ...
... * * @param port * the port upon which listening should happen, or -1 if no specific port is * desired * @throws ns_error_already_initialized * if this server is already started * @throws ns_error_not_available * if the server is not started and cannot be started on the desired port * (perh...
... the * empty string. */ astring getsharedstate(in astring key); /** * sets the string associated with the given key in this, in entire-server * saved state. ...
..., in astring value); /** * retrieves the object associated with the given key in this in * object-valued saved state. all keys are initially associated with null. ...
nsIMsgDBView
to create an instance, use: var dbview = components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createinstance(components.interfaces.nsimsgdbview); where type designates different types of view's available. ...
... selected. msgtoselectafterdelete nsmsgviewindex readonly: the index of the message to select after the current one is deleted. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. currentlydisplayedmessage nsmsgviewindex readonly: the index of the currently displayed message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. ...
...terdelete nsmsgviewindex readonly: the index of the message to select after the current one is deleted. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. currentlydisplayedmessage nsmsgviewindex readonly: the index of the currently displayed message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. suppressmsgdisplay boolean suppress displaying messages. ...
...r the current one is deleted. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. currentlydisplayedmessage nsmsgviewindex readonly: the index of the currently displayed message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. suppressmsgdisplay boolean suppress displaying messages. used when the message pane is collapsed. suppresscommandupdating boolean suppress command updating. used during folder loading. db nsimsgdatabase readonly: the current database of messages. supportsthreading boolean readonly: does the current database support threading? searchsession nsimsgsearchsession the current search session. removerowonmoveordelete boolean readonly: ...
nsIMsgIncomingServer
nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
.... canfilemessagesonserver boolean canhavefilters boolean read only. cansearchmessages boolean read only. canundodeleteonserver boolean read only. constructedprettyname astring helper function to construct the pretty name in a server type specific way - for example, mail for foo@test.com, news on news.mozilla.org. read only. defaultcopiesandfoldersprefstoserver boolean if the server supports fcc/sent/etc, default prefs can point to the server. otherwise, copies and folders prefs should point to local folders. by default this value is set to true via global pref 'allows_specialfolders_usage' (mailnews.js). for nntp, the value is overridden to be false. if isps want to modify this value, they should do that in their rdf file by using this attribute. please look at mozilla/mailnews...
... issecureserver boolean read only. key acstring internal pref key - guaranteed to be unique across all servers. limitofflinemessagesize boolean localpath nsilocalfile localstoretype acstring the schema for the local mail store, such as "mailbox", "imap", or "news" used to construct uris. read only. loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either via authentication in the current session or from password manager stored entries, return false. otherwise, return true. if password is obtained from password manager, set the password member variable. read only. performingbiff boolean port long prettyname astring pr...
...ean retentionsettings nsimsgretentionsettings rootfolder nsimsgfolder rootmsgfolder nsimsgfolder read only. searchscope nsmsgsearchscopevalue read only. serverbusy boolean serverrequirespasswordforbiff boolean read only. serveruri acstring read only. sockettype long spamfilterplugin nsimsgfilterplugin read only. spamsettings nsispamsettings spam settings. read only. supportsdiskspace boolean read only. type acstring protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct urls. username acstring userid to log into the server. usesecauth boolean valid boolean constants constant value description defaultsocket 0 trytls 1 alwaysusetls 2 usessl 3 keepdups 0 deletedups 1 movedupstotrash 2 markdupsrea...
nsINavHistoryService
toolkit/components/places/nsinavhistoryservice.idlscriptable this interface provides complex query functions, more fine-grained getters and setters. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implemented by: "@mozilla.org/browser/nav-history-service;1". to use this service, use: var historyservice = components.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsinavhistoryservice); method overview astring getpagetitle(in nsiuri auri); void markpageasfollowedbookmark(in nsiuri auri); void markpageasfollowedlink(in nsiuri auri); void markpageastyped(in nsiuri auri...
...this can be used in ui to determine whether the "clear history" button should be e...
...ptions options ); parameters aqueries the queries object. aquerycount the count queries. options the options object. return value returns the converted query into an equivalent string query. addobserver() this method adds a history observer. if ownsweak is false, the history service will keep an owning reference to the observer. if ownsweak is true, then aobserver must implement nsisupportsweakreference, and the history service will keep a weak reference to the observer. void addobserver( in nsinavhistoryobserver observer, in boolean ownsweak ); parameters observer the history observer to be added. ownsweak the owning reference state (boolean). removeobserver() this method removes a history observer. void removeobserver( in nsinavhistoryobserver observer ); ...
... void removeobserver( in nsinavhistoryobserver observer ); parameters observer the history observer to be removed. runinbatchmode() this method runs the passed callback in batch mode. use this when a lot of things are about to change. calls can be nested, observers will only be notified when all batches begin/end. void runinbatchmode( in nsinavhistorybatchcallback acallback, in nsisupports aclosure ); parameters acallback nsinavhistorybatchcallback interface to call. aclosure opaque parameter passed to nsinavbookmarksbatchcallback. importhistory() this method imports the given mork history file. void importhistory( in nsifile file ); parameters file the mork history file to import. getcharsetforuri() gets the stored character-set for an uri. void getcha...
nsIObserverService
xpcom/ds/nsiobserverservice.idlscriptable this interface provides methods to add, remove, notify, and enumerate observers of various notifications. inherits from: nsisupports last changed in gecko 0.9.6 the xpcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems. ...
...see nsiobserver for a javascript example. void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobse...
...ied topic. see nsiobserver for a javascript example. void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications. atopic the notification topic or subject. ownsweak if set to false, the nsiobserverservice will hold a strong reference to anobserver. if set to true and anobserver supports the nsisupportsweakreference interface, a weak reference will be held. otherwise an error will be returned. (in most cases, you should use false.) enumerateobservers() called to enumerate all observers registered for a particular topic. nsisimpleenumerator enumerateobservers( in string atopic ); parameters atopic the notification topic or subject. return value returns an enume...
...e all observers registered for a particular topic. nsisimpleenumerator enumerateobservers( in string atopic ); parameters atopic the notification topic or subject. return value returns an enumeration of all registered listeners. see nsisimpleenumerator. notifyobservers() this method is called to notify all observers for a particular topic. see example. void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); parameters asubject a notification specific interface pointer. this usually corresponds to the source of the notification, but could be defined differently depending on the notification topic and may even be null. atopic the notification topic. this string-valued key uniquely identifies the notification. this parameter must not b...
nsIPrintingPrompt
see nsiprintingpromptservice for all documentation. this service enables embedders to implement their own print and progress dialogs. ...
... to implement their own print and progress dialogs. each platform has a "base" or "backstop" implementation of the service. the service is automatically registered at start up. historically, platform toolkits with native dialogs have implemented them in the gfx layer usually they were displayed when a new devicecontextspec specific to that platform was created. windows: the gfx layer no longer supports default toolkit behavior for displaying the native print dialog. if an embedder implemented service returns any error code (other than ns_error_abort) printing will terminate. returning ns_ok assumes that the printsettings object was correctly filled in and if it does not have valid fields for printer name, and so on. it may also terminate. defaults for platform service: showprintdialog...
...mes that the printsettings object was correctly filled in and if it does not have valid fields for printer name, and so on. it may also terminate. defaults for platform service: showprintdialog - displays a native dialog showpagesetup() - displays a xul dialog showprogress() - displays a xul dialog summary for windows embedders: stated once again: there is no "fallback" native platform support in gfx for the displaying of the native print dialog. the current default implementation for windows display a native print dialog but a xul-based progress dialog. if you wish to have a native progress dialog on windows you will have to create and register your own service. note: the windows version mozilla implements this service which is automatically built and registered for you. you can ...
... you may stub out this service by having all the methods return ns_error_not_implemented. you can then fly you own dialog and then properly fill in the printsettings object before calling nsiwebbrowserprint's print method. if you stub out this service you must set "printsilent" to true, if you do not, printing will terminate and an error dialog will be displayed. mac: the gfx layer still supports default toolkit behavior for displaying the print dialog. if an embedder implemented service returns ns_error_not_implemented for "showprintdialog" the toolkit will display the native print dialog. defaults for platform service: mac os x: showprintdialog - displays a native dialog showpagesetup() - displays a native dialog showprogress() - not implemented (provided by os) gtk: ther...
nsIProtocolHandler
netwerk/base/nsiprotocolhandler.idlscriptable this interface is used to implement protocol handlers. if you wish to create a new protocol handler, you need to implement this interface. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default. if the protocol doesn't need a port (for example, the "about" protocol), this attribute is -1. read only. protocolflags un...
...ing with the mozilla 2 platform. scheme acstring the scheme for this protocol ("file", "http", and so forth). read only. constants constant value description uri_std 0 a standard full uri with authority component and understanding relative uris; this includes http and ftp, for example. uri_norelative 1<<0 the protocol doesn't support relative uris (for example, about and javascript). uri_noauth 1<<1 the protocol doesn't have an authority component (for example, file). uri_inherits_security_context 1<<4 uris for this protocol have no inherent security context, so documents loaded using this protocol should inherit the security context of the document that loads them. uri_forbids_auto...
...urces. this could be a local file (uri_is_local_file), a ui resource (uri_is_ui_resource), or something else that would not hit the network. uri_opening_executes_script 1<<13 uris for this protocol execute script when they are opened. allows_proxy 1<<2 this protocol handler can be proxied via socks or http (such as irc, smtp, and http, for example). if the protocol supports transparent proxying, the handler should implement the nsiproxiedprotocolhandler interface. if the protocol only supports http proxying, it doesn't need to support nsiproxiedprotocolhandler, but should instead set the allows_proxy_http flag. allows_proxy_http 1<<3 the protocol handler can be proxied using an http proxy (for example, http and ftp). nsiioservice.newchannelfromur...
...wly constructed channel. newuri() makes a uri object that is suitable for loading by this protocol, where the uri string is given as an utf-8 string. the caller may provide the charset from which the uri string originated, so that the uri string can be translated back to that charset (if necessary) before communicating with, for example, the origin server of the uri string. (many servers do not support utf-8 iris at the present time, so we must be careful about tracking the native charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding. depending on the protocol's implementation, unicode character sequences may or may not be %xx escaped. aorigincharset the character s...
nsISHistory
a handle to the session history object can be obtained from nsiwebnavigation. in a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
...is method can be traversed using nsisimpleenumerator. to access individual history entries of the enumerator, perform the following steps: call getshistoryenumerator() to obtain handle the nsisimpleenumerator object. use nsisimpleenumerator.getnext() on the object returned by step #1 to obtain handle to the next object in the list. the object returned by this step is of type nsisupports. perform a queryinterface on the object returned by step #2 to nsishentry. use nsishentry to access properties of each history entry. read only. methods addshistorylistener() called to register a listener for the session history component. listeners are notified when pages are loaded or purged from history. note: a listener object must implement nsishistorylistener a...
.... perform a queryinterface on the object returned by step #2 to nsishentry. use nsishentry to access properties of each history entry. read only. methods addshistorylistener() called to register a listener for the session history component. listeners are notified when pages are loaded or purged from history. note: a listener object must implement nsishistorylistener and nssupportsweakreference. void addshistorylistener( in nsishistorylistener alistener ); parameters alistener listener object to be notified for all page loads that initiate in session history. getentryatindex() called to obtain handle to the history entry at a given index. nsishentry getentryatindex( in long index, in boolean modifyindex ); parameters index the index value who...
...es is invalid or out of bounds with the size of history. ns_success_loss_of_insignificant_data purge was vetoed. reloadcurrententry() void reloadcurrententry(); parameters none. removeshistorylistener() called to remove a listener for the session history component. listeners are notified when pages are loaded from history. note: a listener object must implement nsishistorylistener and nssupportsweakreference. void removeshistorylistener( in nsishistorylistener alistener ); parameters alistener listener object to be removed from session history. ...
nsIWeakReference
xpcom/base/nsiweakreference.idlscriptable this interface represents a proxy for an xpcom object. it allows a consumer to hold an indirect, non-owning reference to an xpcom object. inherits from: nsisupports last changed in gecko 0.9.9 an instance of nsiweakreference is a proxy object that cooperates with its referent to give clients a non-owning, non-dangling reference. clients own the nsiweakreference instance. ...
...cko 0.9.9 an instance of nsiweakreference is a proxy object that cooperates with its referent to give clients a non-owning, non-dangling reference. clients own the nsiweakreference instance. method overview void queryreferent( in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); methods queryreferent() this method queries an interface on the referent if it exists, and like nsisupports.queryinterface(), produces an owning reference to the desired interface.")}} it is designed to look and act exactly like (a proxied) nsisupports.queryinterface(). do not hold on to the produced interface permanently; that would defeat the purpose of using a non-owning nsiweakreference in the first place. void queryreferent( in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result )...
...l] out nsqiresult result ); parameters uuid the uuid of the requested interface. ...
...parameters uuid the uuid of the requested interface. ...
nsIWebPageDescriptor
read only. ...
...read only. ...
...read only. ...
...ionally syntax-highlighted (for xml/html documents) source of the original page. display_normal 0x0002 just refetches the existing page. note that if the descriptor is that of the source of another page, this keeps the source view, but uses the current syntax highlighting preference. methods loadpage() tells the object to load the page specified by the page descriptor. void loadpage( in nsisupports apagedescriptor, in unsigned long adisplaytype ); parameters apagedescriptor the page descriptor for the page to load. adisplaytype the display type to use when displaying the loaded page; see display type constants for possible values. ...
nsIXULTemplateResult
the result may optionally be identified by an rdf resource. generally, the result and its id will be able to uniquely identify a node in the source data, such as an rdf or xml node. ...
...ntexts, such as a database query, a result would represent a particular record. a result is expected to only be created by a query processor. each result also contains a set of variable bindings. the value for a particular variable may be retrieved using the getbindingfor() and getbindingobjectfor() methods. method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result. the dom element created for this result, if any, will have its id attribute set to this value. the id mu...
...meters avar the variable to look up. return value the value for the variable or a null string if it has no value. getbindingobjectfor() get an object value for a variable such as ?name for this result. this method may return null for a variable, even if getbindingfor() returns a non-null value for the same variable. this method is provided as a convenience when sorting results. nsisupports getbindingobjectfor( in nsiatom avar ); parameters avar the variable to look up. return value the value for the variable or null if it has no value. hasbeenremoved() indicate that the output for a result has been removed and that the result is no longer being used by the builder. void hasbeenremoved(); parameters none. rulematched() indicate that a particular rule of a qu...
...ndicate that the output for a result has been removed and that the result is no longer being used by the builder. void hasbeenremoved(); parameters none. rulematched() indicate that a particular rule of a query has matched and that output will be generated for it. both the query as compiled by the query processor's nsixultemplatequeryprocessor.compilequery() method and the xul <rule> element are supplied. the query must always be one that was compiled by the query processor that created this result. the <rule> element must always be a child of the <query> element that was used to compile the query. void rulematched( in nsisupports aquery, in nsidomnode arulenode ); parameters aquery the query that matched. arulenode the rule node that matched. see also n...
XPCOM Interface Reference
lselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidownloadmanagernsidownloadmanageruinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsidroppedlinkhandlernsidroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsi...
...iinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilemacnsilocalensilocaleservicensilogininfonsiloginmanagernsiloginmanagercryptonsiloginmanageriemigrationhelpernsiloginmanagerprompternsiloginmanagerstoragensiloginmetainfonsimimeinputstreamnsimacdocksupportnsimarkupdocumentviewernsimemorynsimemorymultireporternsimemorymultireportercallbacknsimemoryreporternsimemoryreportermanagernsimenuboxobjectnsimessagebroadcasternsimessagelistenernsimessagelistenermanagernsimessagesendernsimessagewakeupservicensimessengernsimicrosummarynsimicrosummarygeneratornsimicrosummaryobservernsimicrosummaryservicensimicrosummarysetnsimimeconverternsimimeheadersnsimodul...
...nstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisupportspruint32nsisupportspruint64nsisupportsprimitivensisupportsprioritynsisupportsstringnsisupportsvoidnsisupportsweakrefer...
...nfonsivariantnsiversioncomparatornsiweakreferencensiwebbrowsernsiwebbrowserchromensiwebbrowserchrome2nsiwebbrowserchrome3nsiwebbrowserchromefocusnsiwebbrowserfindnsiwebbrowserfindinframesnsiwebbrowserpersistnsiwebcontenthandlerregistrarnsiwebnavigationnsiwebnavigationinfonsiwebpagedescriptornsiwebprogressnsiwebprogresslistenernsiwebprogresslistener2nsiwebsocketchannelnsiwebsocketlistenernsiwebappssupportnsiwifiaccesspointnsiwifilistenernsiwifimonitornsiwinaccessnodensiwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsi...
Setting HTTP request headers
o note that the code itself usually is wrapped inside a exports.main = function() { ... } block. note that the number of parameter that the observe method takes is important. it takes 3 parameters (as we've shown in the example code above). for the "http-on-modify-request" topic, the first parameter (named subject in the code above) will be the nsihttpchannel. however, it is passed to us as an nsisupports. so we need to change the nsisupports into a nsihttpchannel which is what the queryinterface call does. and yes, converting objects from one kind to another is very ugly, and lacks (what is usually called) syntactic sugar. the second line of code in the if block should already be familiar to you. it is the same code we used before, earlier in this article, to add the http request header. the...
... to call: httprequestobserver.register(); you should also remember to unregister the observer at shutdown: httprequestobserver.unregister(); and that's it. xpcom components you need to register a single http-on-modify-request observer per application (and not one per window). this means that you should put the observer's implementation in an xpcom component instead of an overlay. if you want to support gecko2 (firefox4) you need to register your javascript component as described here: https://developer.mozilla.org/en/xpcom/xpcom_changes_in_gecko_2.0#javascript_components. var headername = "x-hello"; var headervalue = "world"; function log(text) { // var consoleservice = components.classes["@mozilla.org/consoleservice;1"].getservice(components.interfaces.nsiconsoleservice); // ...
... var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(this, "http-on-modify-request", false); return; } }, queryinterface: function (iid) { if (iid.equals(components.interfaces.nsiobserver) || iid.equals(components.interfaces.nsisupports)) return this; components.returncode = components.results.ns_error_no_interface; return null; }, }; var mymodule = { registerself: function (compmgr, filespec, location, type) { var compmgr = compmgr.queryinterface(components.interfaces.nsicomponentregistrar); compmgr.registerfactorylocation(this.mycid, ...
...: function (compmgr, cid, iid) { log("----------------------------> getclassobject"); return this.myfactory; }, mycid: components.id("{9cf5f3df-2505-42dd-9094-c1631bd1be1c}"), myprogid: "@dougt/myhttplistener;1", myname: "simple http listener", myfactory: { queryinterface: function (aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_error_no_interface; return this; }, createinstance: function (outer, iid) { log("----------------------------> createinstance"); return new myhttplistener(); } }, canunload: function(compmgr) { return true;...
Storage
ramsarray.addparams(). once all the parameters are set up, a single call to mozistoragestatement.bindparameters() will ensure that the parameters are bound before execution. you can then execute the statement asynchronously, and the statement will get each set of bindings bound to it before execution asynchronously. ...
...multiple statements can be executed in a transaction by calling mozistorageconnection.executeasync() on the connection and passing in an array of statements. ...
...ifficult when you are using the same connection on different threads, or are using a combination of asynchronous and synchronous statement execution. the best way to deal with this is to only execute your statements asynchronously using mozistorageconnection.executeasync(). this method will manage the transactions for you, so you don't have to worry about them. note: the database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception. transactions can be started with mozistorageconnection.begintransaction() or mozistorageconnection.begintransactionas(). the latter takes one of three constants to describe the type of transaction: mozistorageconnection.transaction_deferred mozistorageconnection.transaction_immed...
...ass::myfunction() { // mdbconn is a member variable of our mozistorageconnection. mozstoragetransaction transaction(mdbconn); // execute some statements. if we encounter an error, the transaction will // be rolled back. return transaction.commit(); } collation (sorting) sqlite provides several collation methods (binary, nocase, and rtrim), but these are all very simple and have no support for various text encodings or the user's locale. gecko 1.9.2 added support for several new collation methods: locale case- and accent-insensitive collation. locale_case_sensitive case-sensitive, accent-insensitive collation. locale_accent_sensitive case-insensitive, accent-sensitive collation. locale_case_accent_sensitive case- and accent-sensitive collation. you can use them q...
Getting Started Guide
scomptr automatically addrefs a pointer as it is being assigned in, the natural assumption is that it does the same thing when assigning out. here is a snippet of code that demonstrates this misconception. // incorrect assumptions about |nscomptr|... nsresult nscacherecord::getfilespec( nsifilespec** afilespec ) /* ...fills in the callers |nsfilespec*| (which the caller supplied the address of) with a copy of my member variable |mfilespec|, an |nscomptr|. i.e., this function is a `getter'. remember: good xpcom getters always |addref| their result. */ { // ... *afilespec = mfilespec; // the |nscomptr| should take care of the refcount here, right? return ns_ok; } plainly, the author believed (though perhaps wit...
...ct. never cast an nscomptr, it's almost guaranteed to leak. nscomptrs for non-interface classes appropriately formatted answer to come, in the meanwhile, the full details are available in this news posting (via google groups). nscomptrs in function signatures in general, you won't want to use nscomptr in the signature of xpcom (i.e., `scriptable') functions. nscomptr is not currently directly supported by idl. however, you may sometime be tempted to use an nscomptr in a non-scriptable function. nscomptr<t> f() don't return an nscomptr this practice is dangerous. returning an addrefed pointer in almost any form as a function result leads to several potential errors, some of which are leaks, some of which are dangling pointers. returning an nscomptr may seem like a good idea (since it tel...
...re should be an nscomptr, not the function parameter. additionally, this signature may confuse callers into thinking they need an nscomptr just to call the function. void f( const nscomptr<t>& ) don't pass an nscomptr by const reference exactly as the signature above, this practice is wasteful, but not otherwise harmful, and has the same impact as passing an nscomptr by value if the caller only supplied a raw pointer. void f( nscomptr<t>* ) avoid passing an nscomptr by address, if possible this practice requires callers to have an nscomptr, and requires them to do a little extra work, as operator& for nscomptrs is private (to help prevent leaks caused by casting; also see bug 59414). this is an acceptable way to declare `in/out' parameters, but prefer passing nscomptrs by reference, as be...
...uld a raw xpcom interface pointer in almost all cases. you won't have to explictly call addref or release through it, nor will the compiler allow it. the only place you can't use an nscomptr without change is where a raw xpcom interface pointer is an `out' parameter. in this case, you wrap the nscomptr with getter_addrefs (see comparison 4). when assigning into an nscomptr, you will usually just supply another pointer (either a raw xpcom interface pointer or an nscomptr), with no additional directives (see, e.g., the nscomptr side of comparison 1). as stated above, with no directives, the nscomptr will release its old referent, if any, and addref the new. this is appropriate when the thing you're assigning in hasn't yet been addrefed to account for the new reference. this is typically the ca...
nsCOMPtr versus RefPtr
ovides some explanation and advice on how to choose between them. general rule of thumb for nscomptr versus refptr the general rule of thumb is to use nscomptr<t> when t is an interface type, and refptr<t> when t is a concrete type. this basic rule derives from the fact that some of the nscomptr<t> code is factored into the nscomptr_base base class, which stores the underlying mrawptr as an nsisupports*. (although, confusingly, debug builds don't work this way). this design saves some space in the binary (or at least it used to). since nscomptr stores the pointer as an nsisupports*, it must be possible to unambiguously cast from t* to nsisupports*. many concrete classes inherit from nsisupports in more than one way, so they cannot be unambiguously cast to nsisupports*. thus, these concrete...
...o). since nscomptr stores the pointer as an nsisupports*, it must be possible to unambiguously cast from t* to nsisupports*. many concrete classes inherit from nsisupports in more than one way, so they cannot be unambiguously cast to nsisupports*. thus, these concrete classes cannot be used with nscomptr. while is possible to use nscomptr<t> on concrete classes t that only singly inherit from nsisupports, it is best to avoid doing so. in the future, more base classes might be added to t that would then cause unrelated code to break, which would be very confusing. hence, the interface versus concrete class rule of thumb: interfaces will never multiply inherit from nsisupports, so they can always use be used with nscomptr without fear of breaking in the future. concrete classes should only be ...
...uld only be used with refptr. nscomptr<t> also requires that you can queryinterface to type t. it does this so that it can assert that mrawptr is a canonical t pointer (i.e., that mrawptr->queryinterface(t_iid) == mrawptr). do_queryinterface versus do_queryobject the do_queryinterface helper is only available when assigning to nscomptr. it also requires that the argument singly inherit from nsisupports (since the type of the argument is nsisupports*). for other cases, there is do_queryobject, which is essentially a more powerful form of do_queryinterface. it differs from do_queryinterface as follows: do_queryobject inherits from nscomptr_helper, so it can be assigned into both nscomptr and refptr. the downside of this inheritance is that do_queryobject requires an extra virtual call to ...
...yinterface. it differs from do_queryinterface as follows: do_queryobject inherits from nscomptr_helper, so it can be assigned into both nscomptr and refptr. the downside of this inheritance is that do_queryobject requires an extra virtual call to operator() in the helper method. do_queryobject is templated on the argument type, so it's possible to pass in objects that multiply inherit from nsisupports. however, when the destination type is an xpcom interface, it's probably better to static_cast to a class that unambiguously inherits from nsisupports and use do_queryinterface in such cases. ...
xptcall FAQ
what is xptcall? xptcall is a small low level xpcom method call library. it is implemented using platform specific c/c++ and assembly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chose...
...for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal footprint and is extendable to work with any valid xpcom interface without requiring additional per platform compiled code to be distributed. what does xptcall really do? the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types). given the correct set of parameters, this function can call any method on any xpcom interface...
...stuff goes part way, but is just not enough. if anyone has credible ideas about how to get the required functionality in a cross platform way and/or without resorting to assembly code i'd love to hear about it. is xptcall a platform requirement for mozilla? yes. mozilla will not run properly without a functioning port of xptcall. ...
... xptcall a platform requirement for mozilla? yes. mozilla will not run properly without a functioning port of xptcall. non-functional stub code exists to allow building xptcall on non-supported platforms. but any browser feature that relies on xpconnect will fail. any platform that does not do xptcall is in trouble. we need to get moving on getting xptcall working everywhere! what platforms are supported? the growing list: porting status where can i find other resources? the code is at: xpcom/reflect/xptcall a new porting guide is at: https://developer.mozilla.org/en/xptcall_porting_guide pre-implementation proposals are here and here. original document information author(s): john bandhauer <jband@netscape.com> originally published: 02 september 1999 ...
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface. it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their plat...
...ate subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs. these are discriminated unions describing the type and value of each parameter of the target function. the platform specific code then builds a call frame and invokes the method indicated by the index methodindex on the xpcom inte...
...ate assembly language source files. porters can decide how best to do this for their platforms. the stubs functionality is more complex. the goal here is a class whose vtbl can look like the vtbl of any arbitrary xpcom interface. objects of this class can then be built to impersonate any xpcom object. the base interface for this is (from xptcall/public/xptcall.h): class nsxptcstubbase : public nsisupports { public: // include generated vtbl stub declarations. // these are virtual and *also* implemented by this class.. #include "xptcstubsdecl.inc" // the following methods must be provided by inheritor of this class. // return a refcounted pointer to the interfaceinfo for this object // note: on some platforms this must not fail or we crash! ns_imethod getinterfaceinfo...
...f the platform specific calling frame. porters of this functionality implement the platform specific code for the stub methods that fill the vtbl for this class. the idea here is that the class has a vtbl full of a large number of generic stubs. all instances of this class share that vtbl and the same stubs. the stubs forward calls to a platform specific method that uses the interface information supplied by the overridden getinterfaceinfo to extract the parameters and build an array of platform independent nsxptcminivariant structs which are in turn passed on to the overridden callmethod. the platform dependent code is responsible for doing any cleanup and returning. the stub methods are declared in xptcall/public/xptcstubsdecl.inc. these are '#included' into the declaration of nsxptcstubbas...
XPIDL
permitted wstring const char16_t* char16_t** string full unicode set permitted most of the time you don't want to use this type but astring. array<t> const nstarray<t>& nstarray<t>& array the c++-exposed type t will be an owned variant. (e.g. ns[c]string, refptr<t>, or uint32_t) string, wstring, [ptr] native and [ref] native are unsupported as element types. in addition to this list, nearly every idl file includes nsrootidl.idl in some fashion, which also defines the following types: table 2: types provided by nsrootidl.idl idl typedef c++ in parameter c++ out parameter js type notes prtime (xpidl unsigned long long typedef, 64 bits) number prtime is in microseconds, whil...
...valid xpidl types. to declare a webidl interface in xpidl, write webidl interfacename;. webidl types will be passed as mozilla::dom::interfacename* when used as in-parameters, as mozilla::dom::interfacename** when used as out or inout-parameters, and as refptr<mozilla::dom::interfacename> when used as an array element. other webidl types (e.g. dictionaries, enums, and unions), are not currently supported. constants constants are technically legal at the top level, but xpidl i forbids them from being placed there; instead, they must be in an interface. the only constants supported are those which become integer types when compiled to source code; string constants and floating point constants, though parseable, cannot be made into a header or xpt file. constants are emitted in header file...
...e anonymous enums to quiet enum mismatch warnings. interfaces specifying interfaces is the primary purpose of using xpidl. interfaces are basically a collection of constants, methods, and attributes; in mozilla, these are the primary ways in which javascript code can interact with native c++ code. furthermore, interfaces can also inherit from another interface. every interface should inherit nsisupports in some fashion. however, it is generally not recommended to have a chain of interfaces inheriting from each other if you intend to have a chain of implementations for each interface, as it can cause problems in c++ code. table 4: basic interface attributes attribute interpretation uuid(12345678-fedc-ba98-7654-0123456789ab) this is the internal way this interfac...
...eadonly, in which case setting causes an error to be thrown in script contexts and native contexts lack the set method, by using the "readonly" keyword. to native code, on attribute declared 'attribute type foo;' is syntactic sugar for the declaration of two methods 'type getfoo();' and 'void setfoo(in type foo);'. if foo were declared readonly, the latter method would not be present. attributes support all of the properties of methods with the exception of optional_argc, as this does not make sense for attributes. there are some special rules for attribute naming. as a result of vtable munging by the msvc++ compiler, an attribute with the name `iid' is forbidden. in addition, any attribute whose name matches the regex /^[a-z]{2,3}i[a-z][a-z]/ is emitted with a warning, as its name looks li...
Standard OS Libraries
js-ctypes to work. the alternative to standard libraries is creating your own dll (for windows) or so (for linux) file with c functions that can be called from your add-on with js-ctypes. the dll/so/etc file you make must be shipped with your add-on. standard libraries offer the advantage of not having to ship anything. they are already available on the operating system for you. you just need to supply the path to appropriate files and set up the proper types of values/arguments in the js-ctypes code. this article allows you to find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". windows also has the "winapilists" and ".net f...
...rating systems are linux, *bsd, solaris, etc. there is a star/asterik ("*") before "bsd" because this means the bsd family such as freebsd, openbsd (who by the way made ssh), netbsd, etc. gtk+ and qt are graphic frameworks, the graphic stack under unix is xorg (x11/x). gtk+ builds over x11. xorg is being re-written at the moment, it is known as wayland. wayland is not considered stable, but it's supposed to replace xorg in the long term. gtk+ and qt have begun porting their code to wayland. as wayland is not out yet in the wild this article does not focus on wayland, it will focus on gtk+ and xorg(x11/x). gdk is a stack under gtk+. gtk+ is the toolkit to build apps, gdk is more low-level. to be precise, x is "just" like a display machine. on top of which everybody uses "window managers" (k...
...evisit this topic later in this article (did you know they have a *special* firefox build for ubuntu?). so des are a stack over wms. there is also a layer known as shell, gnomeshell is the shell used in gnome 3, it is the outter shell. gtk+ is the framework used under firefox (and other mozilla applications like thunderbird). the other framework used in unix systems is qt. firefox is officially supported only for gtk+ at the moment, therefore gtk+ is required for firefox to run. attempting to install firefox on a a non-gtk+ based linux build such as kaosx, which is qt based (details on kaosx at the time of this writing: kdelibs version 4.1.4.3, qt version 4.8.6, 64bit) would install gtk+ libraries along with it in order to enable firefox to work on the qt system. there are rumors of a firef...
...mask:', mask, mask.tostring()); gdk.close(); gdk3.close(); gtk+ the gtk+ toolkit can also be used. the list of the exposed symbols/functions can be found here: gnome developer :: gtk+ reference manual. example: ... // placeholder - example soon to come x11 x11 runs primarily on unix® and unix-like operating systems like linux, all of the bsd variants, sun solaris both native 32 and 64 bit support, solaris x86, mac os x (via darwin) as well as other platforms like os/2 and cygwin. there are updates that happen to x11; at the time of this writing, the latest version is 4.4.0. information on all releases can be found on its official page x11 resources. syntax and variable types are found on the documentation pages linked from this page. for example the documentation for v4.4.0 is seen he...
Drawing and Event Handling - Plugins
ther the browser window or an off-screen bitmap. a drawable can be defined in several ways, depending on the platform. windowless plug-ins can be opaque or transparent. a windowless plug-in draws itself only in response to a paint message from the browser. for information about the way html determines plug-in display mode, see using html to display plug-ins. note: windowless plug-ins were not supported on the x window system platform prior to gecko 1.9 alpha 7 (bug 137189). the npwindow structure when a plug-in is loaded, it is drawn into a target area. this target is either the windowed plug-in's native window, or the drawable of a windowless plug-in. the npwindow structure represents either the native window or a drawable. this structure contains information about coordinate position...
...eate a menu or dialog box for a windowless plug-in. windowed plug-ins the browser gives each windowed plug-in its own native window, often a child window of the the browser window itself, to draw into. the plug-in has complete control over drawing and event handling within that window. on mac os, the browser does not give a windowed plug-in a native window, because the mac os platform does not support child windows. instead, the windowed plug-in draws into the graphics port associated with the browser window, at the offset that the browser specifies. on ms windows and unix, the browser creates a child window for each plug-in instance and passes it a window through npp_setwindow. on mac os, the application uses npp_setwindow to dedicate a rectangular part of its graphics port to each insta...
...m. the plug-in api provides a native window handle within which an instance does its drawing through the api call npp_setwindow. npp_setwindow passes the instance an npwindow object containing the native window handle. on windows and unix, each instance receives its own child window within the browser window hierarchy, and imaging and event processing are relative to this window. mac os does not support child windows. the native window is shared between the instance and the browser. the instance must restrict its drawing to a specified area of the shared window, and it must always save the current settings, set up the drawing environment, and restore the shared drawing environment to the previous settings. on mac os, events are explicitly provided to the instance by npp_handleevent. windowl...
...s plug-in within a section; other sections can exist both above and below it. you can create transparent plug-ins. in this case, the browser draws the part of the page that exists behind the plug-in. the windowless plug-in draws only the parts of itself that are opaque. this way, the plug-in can draw an irregularly shaped area, such as a figure, or text over the existing background. the browser supports off-screen drawing of plug-ins. this makes it possible to manipulate plug-in contents. for example, a 3d application could use the contents of a plug-in as a texture map. because windowless plug-ins can be layered or drawn to arbitrary drawables, the browser (as opposed to the native windowing system) is responsible for controlling both their drawing and their event handling. see the foll...
Plugin Roadmap for Firefox - Plugins
plugins are a security and performance problem for firefox users. npapi plugins are an obsolete technology, and mozilla has been moving toward a web which doesn't need plugins. the last remaining npapi plugin, adobe flash, has announced an end-of-life plan. to support the transition away from flash, firefox is working with other browsers to progressively and carefully make flash usage less common. below is the roadmap of past and future support for plugins in firefox. schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate. users choose which sites are allowed to activate each plugin. in addition, the 64-bit firefox for windows only supports the flash plugin. march 2017 starting with firefox 52 in march 2017, plugins o...
... august 2017 starting with firefox 55 in august 2017, users must choose which sites are allowed to activate the flash plugin. users will have the choice to remember the flash setting per-site. this change will be rolled out progressively during august and september 2017. ...
...ox. schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate. users choose which sites are allowed to activate each plugin. in addition, the 64-bit firefox for windows only supports the flash plugin. march 2017 starting with firefox 52 in march 2017, plugins other than adobe flash are no longer supported in firefox. firefox extended support release 52 will continue to support non-flash plugins until early 2018. august 2017 starting with firefox 55 in august 2017, users must choose which sites are allowed to activate the flash plugin. users will have the choice to remember the flash setting per-site. this change will be rolled out progressively during august and september 2017. in order to improve security and performance, m...
...e allowed to activate the flash plugin. users will have the choice to remember the flash setting per-site. this change will be rolled out progressively during august and september 2017. in order to improve security and performance, mozilla will maintain a list of sites which cannot use any plugins. september 2017 starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916). 2019 in september 2019, firefox 69 will remove the "always activate" flash option so we always ask for user permission before activating flash on a website. 2020 in december 2020, flash support will be completely removed from consumer versions of firefox. adobe will stop shipping security updates for flash at the end of 2020. see also mozilla firefox octob...
Edit fonts - Firefox Developer Tools
ts will not have any fonts used and will display the message "no fonts were found for the current element." fonts will be included in this section for one of the following reasons: they are listed in the element's font-family css declaration value. they are applied to the element as part of the browser's default styling (times new roman for most browsers), and no author-defined font has been supplied. they are used by a descendant of the inspected element, for example, when it is a container for other elements which have text content with fonts applied. they are system fallback fonts used when nothing from the font-family css declaration has been applied. fonts editor firefox 63 adds the font editor — a new area below "fonts used" with additional controls for editing the fonts’ ...
...— when opened it shows its full syntax as defined in the stylesheet. a text sample, to give you an idea of what the font looks like when rendered. the default text for the sample is "abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value. once entered, all of the sample text will be set to the same custom value. variable font support in firefox developer tools firefox 62 added support for variable fonts and firefox 63 features support for editing the properties of variable fonts in the font editor. what are variable fonts? variable fonts, or opentype font variations, define a new font file format that allows the font designer to include multiple variations of a typeface inside a single font file. that means you no long...
...fferent characteristics you want to vary. variable fonts make it easy to vary font characteristics in a much more granular fashion because their allowable ranges are defined by axes of variation (see introducing the 'variation axis' for more information). for example, font-weight can be set to any value between 1 and 1000 in variable fonts (although it is not guaranteed that a variable font will support this entire range). there are several registered axes. although it isn't required that these axes be defined for every font, if the font designer does implement a registered axis, its behavior must follow the defined behavior. all variable font axes have a four-character axis tag. the css font-variation-settings property uses the tag as part of the key-value pair. for example, to set font-w...
...om axes should be given upper-case tags. note that font designers aren't forced follow this practice in any way, and some won't. the important takeaway here is that axis tags are case-sensitive. warning: in order to use variable fonts, you need to make sure that your operating system is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. if your operating system is not up to date, you will not be able to use variable fonts in web pages or the firefox developer tools. working with variable fonts in the font editor if the inspected element uses a variable font, the fonts tab shows the axes that have been implemented for that particular font, providing control to alter the value of each one. this is very usefu...
The JavaScript input interpreter - Firefox Developer Tools
cd(): you can pass the iframe dom element: var frame = document.getelementbyid("frame1"); cd(frame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, suppose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe id="frame1" src="static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta charset="utf-8"> <script> function whoareyou() { return "i'm frame1"; } </script> ...
...alue in a readable way; this is useful for dumping the contents of objects and arrays. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it will bring you to this page. cd() switch javascript evaluation context to a different iframe in the page. this helper accepts multiple different ways of identifying the frame to switch to. you can supply any of the following: a selector string that will be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. copy() new in firefox 38. copy the argument to the clipboard. if the argument is a string, it's copied as-is. if the argument is a dom node, its outerhtml is copied. otherwise...
...s outerhtml is copied. otherwise, json.stringify will be called on the argument, and the result will be copied to the clipboard. clearhistory() new in firefox 39. just like a normal command line, the console command line remembers the commands you've typed. use this function to clear the console's command history. :screenshot new in firefox 62. create a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. --delay number the number of sec...
...a ".png" extension. --fullpage boolean if included, the full webpage will be saved. with this parameter, even the parts of the webpage which are outside the current bounds of the window will be included in the screenshot. when used, "-fullpage" will be appended to the file name. --selector string the css query selector for a single element on the page. when supplied, only this element will be included in the screenshot. please refer to the console api for more information about logging from content. ...
DOMMatrixReadOnly.scale() - Web APIs
y interface creates a new matrix being the result of the original matrix with a scale transform applied. syntax the scale() method is specified with either one or six values. dommatrix.scale(scalex[, scaley][, scalez][, originx][, originy][, originz]) parameters scalex a multiplier for the scale value on the x-axis. scaley optional a multiplier for the scale value on the y-axis. ...
...a multiplier for the scale value on the x-axis. scaley optional a multiplier for the scale value on the y-axis. if not supplied, this defaults to the value of scalex. scalez optional a multiplier for the scale value on the z-axis. if this value is anything other than 1, the resulting matrix will be 3d. originx optional an x-coordinate for the origin of the transformation. if no origin is supplied, this defaults to 0. originy optional a y-coordinate for the origin of the transformation. if no origin is supplied, this defaults to 0. originz optional a z-coordinate for the origin of the transformation. if no origin is supplied, this defaults to 0. if this value is anything other than 0, the resulting matrix will be 3d. return value returns a dommatrix containing a new matrix be...
... is anything other than 0, the resulting matrix will be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. the original matrix is not modified. if a scale is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. note: at time of writing, firefox still supports an older version of the specification that accepts either one or three values. dommatrix.scale(scale[, originx][, originy]) we'll show an example of how you can deal with the cross-browser support implications of this in the examples section, below. examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" heigh...
...t origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> <rect id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter. we test if the browser supports a six parameter scale() method by creating a new matrix using three parameters and observing it's is2d property — if this is false then the third parameter has been accepted by the browser as a scalez parameter, making this a 3d matrix. we then create a new matrix scaled about a given origin, using either three or six parameters depending on the browser support. these new matrices are th...
Element.matches() - Web APIs
Web › API › Element › matches
r birds = document.getelementsbytagname('li'); for (var i = 0; i < birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> this will log "the philippine eagle is endangered!" to the console, since the element has indeed a class attribute with value endangered. ...
...< birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> this will log "the philippine eagle is endangered!" to the console, since the element has indeed a class attribute with value endangered. ...
... if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } specification specification status comment domthe definition of 'element.prototy...
....prototype.webkitmatchesselector || function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i = matches.length; while (--i >= 0 && matches.item(i) !== this) {} return i > -1; }; } however, given the practicality of supporting older browsers, the following should suffice for most (if not all) practical cases (i.e. ie9+ support). if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } specification specification status comment domthe definition of 'element.prototype.matches' in that specification. living standard initial definition ...
FederatedCredential.protocol - Web APIs
patibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprotocol experimentalchrome full support 51edge full support ≤79firefox ? ie ? opera full support yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android ...
... yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android full support 5.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
FederatedCredential.provider - Web APIs
patibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...hromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprovider experimentalchrome full support 51edge full support ≤79firefox ? ie ? opera full support yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android ...
... yessafari ? webview android full support 51chrome android full support 51firefox android ? opera android ? safari ios ? samsung internet android full support 5.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
HTMLIFrameElement.csp - Web APIs
e compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ata. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcsp experimentalchrome full support 61edge full support ≤79firefox ? ie ? opera full support 48safari ? webview android full support 61chrome android full support 61firefox android ? opera android full support 45safari ios ? samsung i...
...afari ? webview android full support 61chrome android full support 61firefox android ? opera android full support 45safari ios ? samsung internet android full support 8.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
HTMLMediaElement.srcObject - Web APIs
the srcobject property of the htmlmediaelement interface sets or returns the object which serves as the source of the media associated with the htmlmediaelement. the object can be a mediastream, a mediasource, a blob, or a file (which inherits from blob). note: as of march 2020, only safari supports setting objects other than mediastream. until other browsers catch up, for mediasource, blob and file, consider falling back to creating a url with url.createobjecturl() and assign it to htmlmediaelement.src. see below for an example. syntax var sourceobject = htmlmediaelement.srcobject; htmlmediaelement.srcobject = sourceobject; value a mediastream, mediasource, blob, or file object (though see the compatibility table for what is actually supported). usage notes older versions of the ...
...ned to a newly-created <video> element. const mediastream = await navigator.mediadevices.getusermedia({video: true}); const video = document.createelement('video'); video.srcobject = mediastream; in this example, a new mediasource is assigned to a newly-created <video> element. const mediasource = new mediasource(); const video = document.createelement('video'); video.srcobject = mediasource; supporting fallback to the src property the examples below support older browser versions that require you to create an object url and assign it to src if srcobject isn't supported. first, a mediastream from a camera is assigned to a newly-created <video> element, with fallback for older browsers. const mediastream = await navigator.mediadevices.getusermedia({video: true}); const video = document.
...evices.getusermedia({video: true}); const video = document.createelement('video'); if ('srcobject' in video) { video.srcobject = mediastream; } else { // avoid using this in new browsers, as it is going away. ...
...older browsers and browsers that don't yet support assignment of mediasource directly. const mediasource = new mediasource(); const video = document.createelement('video'); // older browsers may not have srcobject if ('srcobject' in video) { try { video.srcobject = mediasource; } catch (err) { if (err.name != "typeerror") { throw err; } // even if they do, they may only support mediastream video.src = url.createobjecturl(mediasource); } } else { video.src = url.createobjecturl(mediasource); } specifications specification status comment html living standardthe definition of 'srcobject' in that specification. living standard initial definition. ...
Dragging and Dropping Multiple Items - Web APIs
these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove. the drag processing described in this document use the datatransfer interface. ...
...ng multiple files or bookmarks. in this case, add the appropriate formats for each item. although not required, you should always add the same formats for each item. the ensures that receiving drop targets can expect consistent data. to check if multiple files are being dragged, check the mozitemcount property. it will be set to the number of items being dragged. if a particular drop target only supports dropping a single item, it could either reject the dragged items or it could just use just the first item. to reject the items, either don't cancel the dragover event, or set the effectallowed property to none. you may wish to do both in case another listener has already cancelled the event. to just take the first item being dropped, use the getdata() method as with a single item. this is c...
... reject the dragged items or it could just use just the first item. to reject the items, either don't cancel the dragover event, or set the effectallowed property to none. you may wish to do both in case another listener has already cancelled the event. to just take the first item being dropped, use the getdata() method as with a single item. this is convenient as drop targets which only need to support a single item do not need to do anything extra. however, use the mozgetdataat() method to retrieve a specific item from the data transfer. the following example retrieves a set of files being dragged and adds them to an array. function ondrop(event) { var files = []; var dt = event.datatransfer; for (var i = 0; i < dt.mozitemcount; i++) files.push(dt.mozgetdataat("application/x-mo...
...types property is equivalent to retrieving the list of types for the item at index 0. var types = event.datatransfer.moztypesat(1); dragging non-string data the additional methods described above are also not restricted to string data; you can specify any type of data. for example, files are dragged using the application/x-moz-file type stored as nsifile objects. as the setdata() method only supports strings, it cannot be used to specify files for dragging in this manner. instead the mozsetdataat() method must be used. dt.mozsetdataat("application/x-moz-file", file, 0); by using this method, you can file objects, although you do not necessarily need to support multiple items. thus, you should pass 0 as the index. similarly, you will need to retrieve the file object or objects using t...
MediaCapabilities.decodingInfo() - Web APIs
the mediacapabilities.decodinginfo() method, part of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe whether decoding the media described would be supported, smooth, and powerefficient. ...
...ies.decodinginfo(mediadecodingconfiguration) parameters mediadecodingconfiguration a valid mediadecodingconfiguration dictionary containing a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a videoconfiguration. ...
...eate media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. ...
...lid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. }, }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') + 'smooth, and ' + (result.powerefficient ? '' : 'not ') + 'power efficient.') }); specifications specification status comment media capabilitiesthe definition of 'decodinginfo()' in that specification. draft initial definition ...
MediaCapabilities.encodingInfo() - Web APIs
the mediacapabilities.encodinginfo() method, part of the mediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the device is with the type of media. ...
...ginfo(mediaencodingconfiguration) parameters mediaencodingconfiguration a valid mediaencodingconfiguration dictionary containing a valid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or videoconfiguration dictionary. return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements. example //crea...
...onst mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. ...
... width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') + 'smooth, and ' + (result.powerefficient ? '' : 'not ') + 'power efficient.') }); specifications specification status comment media capabilitiesthe definition of 'encodinginfo()' in that specification. draft initial definition ...
MediaDevices.getUserMedia() - Web APIs
vices cannot be used at this time. this will happen if the browsing context is insecure (that is, the page was loaded using http rather than https). it also happens if the user has specified that the current browsing instance is not permitted access to the device, the user has denied access for the current session, or the user has denied all access to user media devices globally. on browsers that support managing media permissions with feature policy, this error is returned if feature policy is not configured to allow access to the input source(s). older versions of the specification used securityerror for this instead; securityerror has taken on a new meaning. notfounderror no media tracks of the type specified were found that satisfy the given constraints. notreadableerror although t...
...nstrainederror, and has a constraint property whose string value is the name of a constraint which was impossible to meet, and a message property containing a human-readable string explaining the problem. because this error can occur even when the user has not yet granted permission to use the underlying device, it can potentially be used as a fingerprinting surface. securityerror user media support is disabled on the document on which getusermedia() was called. the mechanism by which user media support is enabled and disabled is left up to the individual user agent. typeerror the list of constraints specified is empty, or has all constraints set to false. this can also happen if you try to call getusermedia() in an insecure context, since navigator.mediadevices is undefined in an inse...
...era once muting is over. security there are a number of ways security management and controls in a user agent can cause getusermedia() to return a security-related error. note: the security model for getusermedia() is still somewhat in flux. the originally-designed security mechanism is in the process of being replaced with feature policy, so various browsers have different levels of security support, using different mechanisms. you should test your code carefully on a variety of devices and browsers to be sure it is as broadly compatible as possible feature policy the feature policy security management feature of http is in the process of being introduced into browsers, with support available to some extent in many browsers (though not always enabled by default, as in firefox). getuse...
... the two permissions that apply to getusermedia() are camera and microphone. ...
MediaKeyStatusMap.entries() - Web APIs
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetentries experimentalchrome full support 42edge full support 16firefox ? ie ? opera full support 29safari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung i...
...afari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung internet android full support 4.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
MediaKeyStatusMap.forEach() - Web APIs
mpatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetforeach experimentalchrome full support 42edge full support 13firefox ? ie ? opera full support 29safari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung i...
...afari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung internet android full support 4.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
MediaKeyStatusMap.keys() - Web APIs
compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...ta. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...mobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkeys experimentalchrome full support 42edge full support 16firefox ? ie ? opera full support 29safari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung i...
...afari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung internet android full support 4.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
MediaKeyStatusMap.values() - Web APIs
ompatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...bilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvalues experimentalchrome full support 42edge full support 16firefox ? ie ? opera full support 29safari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung i...
...afari ? webview android full support 43chrome android full support 42firefox android ? opera android full support 29safari ios ? samsung internet android full support 4.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
MediaTrackSettings - Web APIs
ints object and set using applyconstraints(), and will adhere to the default constraints for any properties whose constraints haven't been changed, or whose customized constraints couldn't be matched. to learn more about how constraints and settings work, see capabilities, constraints, and settings. properties some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a domstring indicating the current value of the deviceid property. the dev...
... a double-precision floating point value indicating the current value of the latency property, specifying the audio latency, in seconds. latency is the amount of time which elapses between the start of processing the audio and the data being available to the next stop in the audio utilization process. this value is a target value; actual latency may vary to some extent for various reasons. noisesuppression a boolean which indicates the current value of the noisesupression property, which is true if noise suppression is enabled and is false otherwise. samplerate a long integer value indicating the current value of the samplerate property, specifying the sample rate in samples per second of the audio data. standard cd-quality audio, for example, has a sample rate of 41,000 samples per s...
...e indicating the current value of the samplesize property, specifying the linear size, in bits, of each audio sample. cd-quality audio, for example, is 16-bit, so this value would be 16 in that case. volume a double-precision floating point value indicating the current value of the volume property, specifying the volume level of the track. this value will be between 0.0 (silent) to 1.0 (maximum supported volume). properties of video tracks aspectratio a double-precision floating point value indicating the current value of the aspectratio property, specified precisely to 10 decimal places. this is the width of the image in pixels divided by its height in pixels. common values include 1.3333333333 (for the classic television 4:3 "standard" aspect ratio, also used on tablets such as appl...
...'s resolution might be the result of the user agent using cropping or downscaling from a higher camera resolution. properties of shared screen tracks tracks containing video shared from a user's screen (regardless of whether the screen data comes from the entire screen or a portion of a screen, like a window or tab) are generally treated like video tracks, with the exception that they also support the following added settings: cursor a domstring which indicates whether or not the mouse cursor is being included in the generated stream and under what conditions. possible values are: always the mouse is always visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content. motion the mouse cursor is always included ...
Navigator.requestMediaKeySystemAccess() - Web APIs
the navigator.requestmediakeysystemaccess() method returns a promise which delivers a mediakeysystemaccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream. this method is part of the encrypted media extensions api, which brings support for encrypted media and drm-protected video to the web. this method may have user-visible effects such as asking for permission to access one or more system resources. consider that when deciding when to call requestmediakeysystemaccess(); you don't want those requests to happen at inconvenient times. as a general rule, this function should be called only when it's about time to create and use a mediakeys object by calling the returned mediakeysystemaccess object's createm...
... consider that when deciding when to call requestmediakeysystemaccess(); you don't want those requests to happen at inconvenient times. as a general rule, this function should be called only when it's about time to create and use a mediakeys object by calling the returned mediakeysystemaccess object's createmediakeys() method. syntax ​promise = navigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system. for example com.example.somesystem or org.w3.clearkey. supportedconfigurations a non-empty array of mediakeysystemconfiguration objects. the first element with a satisfiable configuration will be used. return value a promise that, when resolved, delivers a mediakeysystemaccess object to your fulfillment h...
...iguration objects. the first element with a satisfiable configuration will be used. return value a promise that, when resolved, delivers a mediakeysystemaccess object to your fulfillment handler function. ...
...t to your fulfillment handler function. the fulfillment handler receives as input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an error, the returned promise is rejected with a domexception whose name indicates what kind of error occurred. notsupportederror either the specified keysystem isn't supported by the platform or the browser, or none of the configurations specified by supportedconfigurations can be satisfied (if, for example, none of the codecs specified in contenttype are available). typeerror either keysystem is an empty string or the supportedconfigurations array is empty. specifications specification status ...
Node - Web APIs
Web › API › Node
nodes are the same (that is, they reference the same object). node.lookupprefix() returns a domstring containing the prefix for a given namespace uri, if present, and null if not. when multiple prefixes are possible, the result is implementation-dependent. node.lookupnamespaceuri() accepts a prefix and returns the namespace uri associated with it on the given node if found (and null if not). supplying null for the prefix will return the default namespace. node.normalize() clean up all the text nodes under this element (merge adjacent, remove empty). node.removechild() removes a child node from the current element, which must be a child of the current node. node.replacechild() replaces one child node of the current one with the second one given in parameter. obsolete methods no...
...) removes a child node from the current element, which must be a child of the current node. node.replacechild() replaces one child node of the current one with the second one given in parameter. obsolete methods node.getuserdata() allows a user to get some domuserdata from the node. node.hasattributes() returns a boolean indicating if the element has any attributes, or not. node.issupported() returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node. node.setuserdata() allows a user to attach, or remove, domuserdata to the node. examples remove all children nested within a node function removeallchildren(element) { while (element.firstchild) { element.r...
...og(mistakes) specifications specification status comment domthe definition of 'node' in that specification. living standard added the following methods: getrootnode() dom4the definition of 'node' in that specification. obsolete removed the following properties: attributes, namespaceuri, prefix, and localname. removed the following methods: issupported(), hasattributes(), getfeature(), setuserdata(), and getuserdata(). document object model (dom) level 3 core specificationthe definition of 'node' in that specification. obsolete the methods insertbefore(), replacechild(), removechild(), and appendchild() returns one more kind of error (not_supported_err) if called on a document. the normalize() method has been modified s...
... added the following properties: baseuri and textcontent. document object model (dom) level 2 core specificationthe definition of 'node' in that specification. obsolete the ownerdocument property was slightly modified so that documentfragment also returns null. added the following properties: namespaceuri, prefix, and localname. added the following methods: normalize(), issupported() and hasattributes(). document object model (dom) level 1 specificationthe definition of 'node' in that specification. obsolete initial definition. ...
PaymentAddress - Web APIs
examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. ...
...e containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
...nt methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccardrequest dictionary. ...
... // call show() to trigger the browser's payment flow. const response = await request.show(); // process payment. const json = response.tojson(); const httpresponse = await fetch("/pay/", { method: "post", body: json }); const result = httpresponse.ok ? "success" : "failure"; await response.complete(result); } dopay...
Payment processing concepts - Web APIs
pecification and how to use it. url-based payment method identifiers these may vary substantially depending on the specifics of the service, and a given processing service may have multiple urls used, depending on the version of their api, their communication technology, and so forth. https://apple.com/apple-pay payments are handled using the apple pay service. currently, apple pay is only supported by safari. https://google.com/pay payments are processed by google pay. this is currently supported only by chrome and chromium-based browsers. functions of a payment handler a user agent may provide built-in support for certain types of payments. in addition, the payment handler api can be used to establish support for additional payment method providers, in browsers that support it. ...
...see merchant validation for details. verify that the information provided by the user results in a valid transaction. this results in the creation and returning of a payment method-specific object that contains the information needed to handle the transaction. ...
...information from the address given by validationurl. note this function must go through the merchant server, because a client typically does not access the validation url itself. ...
...o the payment handler by passing it into complete(), the payment handler can use the retrieved data and whatever algorithm and other data to support in order to verify that the merchant can use the payment handler. thus, it's important to note that the user agent never sends a merchantvalidation event, unless the user agent itself implements a payment handler. for instance, safari has integrated support for apple pay, so the apple pay payment handler uses this to ensure that apple pay can be used to pay the merchant by sending merchantvalidation to the client, instructing it to fetch the server's validation data and deliver it to the payment handler by calling complete(). specifications specification status comment payment request api candidate recommendation ...
performance.clearResourceTimings() - Web APIs
e is available in web workers. syntax performance.clearresourcetimings(); arguments void return value none this method has no return value. ...
...s no return value. ...
...performance data buffer cleared"); else console.log("..
...performance data buffer cleared"); else console.log("... ...
PerformanceEntry.duration - Web APIs
e to return a duration of 0. note: if the performance entry has an entrytype of "resource" (i.e. the entry is a performanceresourcetiming object), this property returns the difference between the performanceentry.responseend and performanceentry.starttime timestamps. example the following example shows the use of the duration property. ...
..." (i.e. the entry is a performanceresourcetiming object), this property returns the difference between the performanceentry.responseend and performanceentry.starttime timestamps. example the following example shows the use of the duration property. function run_performanceentry() { log("performanceentry support ..."); if (performance.mark === undefined) { log("... ...
...tries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = "...
...es[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'duration' in that specification. candidate recommendation performance timelinethe definition of 'duration' in that specification. recommendation initial definition. ...
PerformanceEntry.name - Web APIs
by calling performance.mark(). domstring performancemeasure measure name used when the measure was created by calling performance.measure(). domstring performancepainttiming paint either 'first-paint' or 'first-contentful-paint'. example the following example shows the use of the name property. ...
...e used when the measure was created by calling performance.measure(). domstring performancepainttiming paint either 'first-paint' or 'first-contentful-paint'. example the following example shows the use of the name property. function run_performanceentry() { log("performanceentry support ..."); if (performance.mark === undefined) { log("... ...
...tries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = "...
...es[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'name' in that specification. candidate recommendation performance timelinethe definition of 'name' in that specification. recommendation initial definition. ...
PerformanceEntry.startTime - Web APIs
stimestamp representing the first timestamp when the performance entry was created. note: if the performance entry has an entrytype of "resource" (i.e. the entry is a performanceresourcetiming object), this property returns the performanceentry.fetchstart timestamp. example the following example shows the use of the starttime property. ...
... if the performance entry has an entrytype of "resource" (i.e. the entry is a performanceresourcetiming object), this property returns the performanceentry.fetchstart timestamp. example the following example shows the use of the starttime property. function run_performanceentry() { log("performanceentry support ..."); if (performance.mark === undefined) { log("... ...
...tries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = "...
...es[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = " + json.stringify(js)); } else { log("..." + methods[i] + " = not supported"); } } } specifications specification status comment performance timeline level 2the definition of 'starttime' in that specification. candidate recommendation performance timelinethe definition of 'starttime' in that specification. recommendation initial definition. ...
PerformanceEntry.toJSON() - Web APIs
it returns a json representation of the performance entry object. note: this feature is available in web workers. syntax json = perfentry.tojson(); arguments none return value json a json object that is the serialization of the performanceentry object. example the following example shows the use of the tojson() method. ...
...vailable in web workers. syntax json = perfentry.tojson(); arguments none return value json a json object that is the serialization of the performanceentry object. example the following example shows the use of the tojson() method. function run_performanceentry() { log("performanceentry support ..."); if (performance.mark === undefined) { log("... ...
...tries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported = typeof obj[methods[i]] == "function"; if (supported) { var js = obj[methods[i]](); log("..." + methods[i] + "() = "...
... candidate recommendation initial definition of tojson() method. ...
Performance API - Web APIs
a clock that is always increasing. ...
...a clock that is always increasing. ...
...a clock that is always increasing. as such, the performance api defines a domhighrestimestamp type rather than using the date.now() interface. ...
... adds mark(), clearmarks(), measure() and clearmeasures() methods to the performance interface. adds the performancemark and peformancemeasure interfaces. user timing level 2 working draft implementation status as shown in the performance interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers. to test your browser's support for the performance interface, run the perf-api-support application. see also a primer for web performance timing apis ...
PhotoCapabilities.fillLightMode - Web APIs
ility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...u'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...edgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilllightmode experimentalchrome full support 59edge full support ≤79firefox ? ie ? opera full support 46safari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung i...
...afari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
PhotoCapabilities.redEyeReduction - Web APIs
ity table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...gefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetredeyereduction experimentalchrome full support 59edge full support ≤79firefox ? ie ? opera full support 46safari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung i...
...afari ? webview android full support 59chrome android full support 59firefox android ? opera android full support 43safari ios ? samsung internet android full support 7.0legend full support full support compatibility unknown compatibility unknownexperimental. expect behavior to change in the future.experimental. expect behavior to change in the future. ...
Pinch zoom gestures - Web APIs
ound color to lightblue. the pinch out (zoom in) gesture, which moves the two pointers away from each other, changes the target element's background color to pink. define touch target the application uses <div> to define the pointers' target areas. <style> div { margin: 0em; padding: 2em; } #target { background: white; border: 1px solid black; } </style> global state supporting a two-pointer gesture requires preserving a pointer's event state during various event phases. this application uses two global variables to cache the event state. // global vars to cache event state var evcache = new array(); var prevdiff = -1; register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup. the handler fo...
... down the pointerdown event is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface. in this application, the event's state must be cached in case this down event is part of a two-pointer pinch/zoom gesture. function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction. // this event is cached to support 2-finger gestures evcache.push(ev); log("pointerdown", ev); } pointer move the pointermove event handler detects if a user is invoking a two-pointer pinch/zoom gesture. if two pointers are down, and the distance between the pointers is increasing (signifying a pinch out or zoom in), the element's background color is changed to pink, and if the distance between the pointers is decreasing ...
... cache management this function helps manage the global event caches evcache. function remove_event(ev) { // remove this event from the target's cache for (var i = 0; i < evcache.length; i++) { if (evcache[i].pointerid == ev.pointerid) { evcache.splice(i, 1); break; } } } event logging these functions are ...
...nt flow. cache management this function helps manage the global event caches evcache. function remove_event(ev) { // remove this event from the target's cache for (var i = 0; i < evcache.length; i++) { if (evcache[i].pointerid == ev.pointerid) { evcache.splice(i, 1); break; } } } event logging these functions are used to send event activity to the application's window (to support debugging and learning about the event flow). // log events flag var logevents = false; // logging/debugging functions function enablelog(ev) { logevents = logevents ? false : true; } function log(prefix, ev) { if (!logevents) return; var o = document.getelementsbytagname('output')[0]; var s = prefix + ": pointerid = " + ev.pointerid + " ; pointertype = " + ev.point...
SVGDocument - Web APIs
opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...ri ios ? samsung internet android ? ...
... samsung internet android ? ...
SVGMarkerElement - Web APIs
opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...ri ios ? samsung internet android ? ...
... samsung internet android ? ...
SVGPathSeg - Web APIs
opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...ri ios ? samsung internet android ? ...
... samsung internet android ? ...
SVGPathSegList - Web APIs
opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...ri ios ? samsung internet android ? ...
... samsung internet android ? ...
SVGPointList - Web APIs
opera android ? safari ios ? samsung internet android ? ...
... ? safari ios ? samsung internet android ? ...
...ri ios ? samsung internet android ? ...
... samsung internet android ? ...
Screen Capture API - Web APIs
visible. the value is one of always, motion, or never. mediatracksettings.displaysurface a string indicating what type of display surface is currently being captured. the value is one of application, browser, monitor, or window. mediatracksettings.logicalsurface a boolean value which is true if the video being captured doesn't directly correspond to a single onscreen display area. ...
...s, motion, or never. mediatracksettings.displaysurface a string indicating what type of display surface is currently being captured. the value is one of application, browser, monitor, or window. mediatracksettings.logicalsurface a boolean value which is true if the video being captured doesn't directly correspond to a single onscreen display area. ...
...type of display surface is currently being captured. the value is one of application, browser, monitor, or window. mediatracksettings.logicalsurface a boolean value which is true if the video being captured doesn't directly correspond to a single onscreen display area. mediatracksupportedconstraints mediatracksupportedconstraints.cursor a boolean which is true if the user agent and device support the mediatrackconstraints.cursor constraint. mediatracksupportedconstraints.displaysurface a boolean which is true if the current environment supports the mediatrackconstraints.displaysurface constraint. mediatracksupportedconstraints.logicalsurface a boolean which is true if the current environment supports the constraint mediatrackconstraints.logicalsurface. dictionaries the followin...
...ngs and constraints. the possible values are always, motion, and never. displaycapturesurfacetype an enumerated string type which is used to identify the kind of display surface to capture. this type is used for the displaysurface property in the constraints and settings objects, and has the possible values application, browser, monitor, and window. feature policy validation user agents that support feature policy (either using http's feature-policy header or the <iframe> attribute allow) can specify a desire to use the screen capture api using the policy control directive display-capture: <iframe allow="display-capture" src="/some-other-document.html"> the default allow list is self, which lets the any content within the document use screen capture. see using feature policy for a mor...
TextRange - Web APIs
Web › API › TextRange
ie only this property is ie specific. although it is well supported by ie, most other browsers no longer support this property. this property should only be used as one of the solutions when you need to be compatible with lower versions of ie, rather than relying on it completely in cross browser scripts. a textrange object represents a fragment of text in a document, similar to the standard defined range interface. this object is used to represent a specific piece of text in the document. for example, when you hold down the mouse to select the content on the page, you create a typical textrange. ...
...t, similar to the standard defined range interface. this object is used to represent a specific piece of text in the document. for example, when you hold down the mouse to select the content on the page, you create a typical textrange. it is implemented in ie, then a textrange object can be created by element.createtextrange() or document.selection.createrange(). note that this interface is not supported in non ie browsers. alternative selection and range interfaces can be used. properties textrange.boundingheightread only returns the height of the rectangle bound to the textrange object. textrange.boundingleftread only returns the distance between the left edge of the rectangle that binds the textrange object and the left edge that completely contains the textrange object. te...
...rollintoview in the lower version of ie. textrange.select() select the current range (i.e. the blue selection seen by the user). textrange.setendpoint() sets the end point of the current range based on the bounds of other textrange. example the following example is valid under ie9. the example gets the textrange through document.selection, and sets the specified element to be selected. ie9 supports the standard alternative range. var range = document.selection.createrange(); var element = document.getelementbyid("test"); range.movetoelementtext(element); range.select(); // selected "sometexttobeselected" <!doctype html> <html> <head> <title>textrange example</title> </head> <body> <p id="test">sometexttobeselected</p> </body> </html> notes use textrange to operate the selection...
...st its function in most cases). it's easy to get confused. generally, if the script only needs to be compatible with the latest browser, the standard interface is the best choice; however, the current website still wants to be compatible with ie8 or below browsers. therefore, the best way is to deal with both at the same time, that is, try to use textrange mode when the standard interface is not supported, but do not regard it as the only choice. ...
Touch events - Web APIs
to provide quality support for touch-based user interfaces, touch events offer the ability to interpret finger (or stylus) activity on touch screens or trackpads. the touch events interfaces are relatively low-level apis that can be used to support application-specific multi-touch interactions such as a two-finger gesture. a multi-touch interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are removed from the surface. during this interaction, an application receives touch events during the start, move, and end phases. ...
... interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are removed from the surface. during this interaction, an application receives touch events during the start, move, and end phases. touch events are similar to mouse events except they support simultaneous touches and at different locations on the touch surface. the touchevent interface encapsulates all of the touchpoints that are currently active. the touch interface, which represents a single touchpoint, includes information such as the position of the touch point relative to the browser viewport. definitions surface the touch-sensitive surface. this may be a screen or track...
... touch represents a single point of contact between the user and the touch surface. touchlist represents a group of touches; this is used when the user has, for example, multiple fingers on the surface at the same time. example this example tracks multiple touchpoints at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method. create a canvas <canvas id="canvas" width="600" height="600" style="border:solid black 1px;"> your browser does not support canvas element. </canvas> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> set...
...ch's index into the array. function ongoingtouchindexbyid(idtofind) { for (var i = 0; i < ongoingtouches.length; i++) { var id = ongoingtouches[i].identifier; if (id == idtofind) { return i; } } return -1; // not found } showing what's going on function log(msg) { var p = document.getelementbyid('log'); p.innerhtml = msg + "\n" + p.innerhtml; } if your browser supports it, you can see it live. jsfiddle example additional tips this section provides additional tips on how to handle touch events in your web application. handling clicks since calling preventdefault() on a touchstart or the first touchmove event of a series prevents the corresponding mouse events from firing, it's common to call preventdefault() on touchmove rather than touchstart. that wa...
TransformStream - Web APIs
const tes = { start(){this.encoder = new textencoder()}, transform(chunk, controller) { controller.enqueue(this.encoder.encode(chunk)) } } let _jstes_wm = ...
...queue(this.textencoder.encode(string(chunk))) break }, flush() { /* do any destructor work here */ } } class anytou8stream extends transformstream { constructor() { super({...transformcontent, textencoder: new textencoder()}) } } polyfilling textencoderstream and textdecoderstream note that this is deprecated by the native constructors. this is intended as a polyfill for unsupported platforms. ...
...this is deprecated by the native constructors. this is intended as a polyfill for unsupported platforms. ...
...examples include building a pwa with progressive loading and progre...
Using WebGL extensions - Web APIs
in that case, their name can be prefixed by the vendor prefix (moz_, webkit_, etc.) or the extension is only available once a browser preference has been toggled. ...
...in that case, their name can be prefixed by the vendor prefix (moz_, webkit_, etc.) or the extension is only available once a browser preference has been toggled. ...
...hat optimize for virtual reality. ext_: extensions that mirror other opengl es or opengl api extensions. webgl_: extensions that are webgl-specific and intended to be compatible with multiple web browsers. it should also be used for extensions which originated with the opengl es or opengl apis, but whose behavior has been significantly altered. querying available extensions the webgl context supports querying what extensions are available. var available_extensions = gl.getsupportedextensions(); the webglrenderingcontext.getsupportedextensions() method returns an array of strings, one for each supported extension. extension list the current extensions are: angle_instanced_arrays ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_f...
... extension objects if an extension defines specific symbols or functions that are not available in the core specification of webgl, they will be available on the extension object returned by the call to gl.getextension(). ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
aracter in the game, but is instead either fixed above or next to the game play area, or follows the action as the action moves around a scrolling game world. for example, a classic arcade game such as pac-man takes place on a fixed game map, so the camera remains fixed a set distance above the map, always pointed straight down at the game world. in a side-scrolling or top-scrolling game such as super mario bros., the camera moves along left and right (or up and down, or both) to ensure that the action remains visible even though the game level is much larger than the viewport. positioning the camera since there are no standard camera objects in webgl or webxr, we need to simulate the camera ourselves. before we can do so, and before we can then simulate the movement of the camera, let's ...
...same side of that plane as the camera are not drawn. conversely, the far clipping plane is the distance in meters to a plane beyond which no vertices are drawn. to zoom using a scaling factor or percentage, you can map 1x (100% of normal size) to the largest value of fov you allow (which leads to the most content being visible), then map your maximum magnification to the maximum value of fov you support and map corresponding values in between. if you start each frame's rendering pass by computing the perspective matrix, you can then multply into that matrix all the other transforms you need to apply in order to result in the frame's desired geometry. for example: const transform = createperspectivematrix(viewport, 130, 1, 100); const translatevec = vec3.fromvalues(-trackdistance, -cranedis...
...ction in which it's facing vertically without altering the horizontal portion of its facing at all. it simply adjusts the direction it's pointing up and down. tilting is good for capturing the scope of a tall object or scene, such as a forest or a mountain, but is also a popular way to introduce a character or locale of importance or which inspires awe. it's also of course useful for implementing support for a player looking up and down. thus, tilting the camera can be achieved by rotating the camera around the x axis, so that it pivots to look up and down. this can be done using the appropriate method in your matrix math library, such as the rotatex() method in glmatrix's mat4 class: mat4.rotatex(viewmatrix, viewmatrix, angle); positive values for angle will tilt the camera downward, wh...
...ns, there will never be more than two entries in this list: one describing the position and viewing angle of the left eye and another doing the same for the right. you can tell which eye a given xrview represents by checking the value of its eye property, which is a string whose value is left or right (a third possible value, none, theoretically may be used to represent another point of view, but support for this is not entirely available in the current api). example frame callback a fairly basic (but typical) callback for rendering frames might look like this: function myanimationframecallback(time, frame) { let adjustedrefspace = applypositionoffsets(xrreferencespace); let pose = frame.getviewerpose(adjustedrefspace); animationframerequestid = frame.session.requestanimationframe(m...
Background audio processing using AudioWorklet - Web APIs
ach of them with individual calls to registerprocessor(). as long as each has its own unique name, this will work just fine. it's also more efficient than loading multiple modules from over the network or even the user's local disk. ...
... returns a new audioworkletnode. once you have that in hand, you connect it to other nodes and otherwise use it just like any other node. you can then create a new audio processor node by simply doing this: let newprocessornode = createmyaudioprocessor(); if the returned value, newprocessornode, is non-null, we have a valid audio context with its hiss processor node in place and ready to use. supporting audio parameters just like any other web audio node, audioworkletnode supports parameters, which are shared with the audioworkletprocessor that does the actual work. adding parameter support to the processor to add parameters to an audioworkletnode, you need to define them within your audioworkletprocessor-based processor class in your module. this is done by adding the static getter pa...
... in the following implementation of parameterdescriptors(), the returned array has two audioparam objects. the first defines gain as a value between 0 and 1, with a default value of 0.5. the second parameter is named frequency and defaults to 440.0, with a range from 275 to 4186.009, inclusively. ...
...d. these values are to be applied to the corresponding frames. k-rate parameters k-rate parameters, on the other hand, can only change once per block, so the parameter's array has only a single entry. use that value for every frame in the block. in the code below, we see a process() function that handles a gain parameter which can be used as either an a-rate or k-rate parameter. our node only supports one input, so it just takes the first input in the list, applies the gain to it, and writes the resulting data to the first output's buffer. process(inputlist, outputlist, parameters) { const input = inputlist[0]; const output = outputlist[0]; const gain = parameters.gain; for (let channelnum = 0; channelnum < input.length; channel++) { const inputchannel = input[channel]; ...
Using the Web Audio API - Web APIs
an 1,000 simultaneous sounds without stuttering. example code our boombox looks like this: note the retro cassette deck with a play button, and vol and pan sliders to allow you to alter the volume and stereo panning. we could make this a lot more complex, but this is ideal for simple learning at this stage. check out the final demo here on codepen, or see the source code on github. browser support modern browsers have good support for most features of the web audio api. there are a lot of features of the api, so for more exact information, you'll have to check the browser compatibility tables at the bottom of each reference page. audio graphs everything within the web audio api is based around the concept of an audio graph, which is made up of nodes. the web audio api handles audio...
...dular routing. basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. you have input nodes, which are the source of the sounds you are manipulating, modification nodes that change those sounds as desired, and output nodes (destinations), which allow you to save or hear those sounds. several audio sources with different channel layouts are supported, even within a single context. because of this modular design, you can create complex audio functions with dynamic effects. audio context to be able to do anything with the web audio api, we need to create an instance of the audio context. this then gives us access to all the features and functionality of the api. // for legacy browsers const audiocontext = window.audiocontext || window.
...d to be available to the web audio api. controlling sound when playing sound on the web, it's important to allow the user to control it. depending on the use case, there's a myriad of options, but we'll provide functionality to play/pause the sound, alter the track's volume, and pan it from left to right. controlling sound programmatically from javascript code is covered by browsers' autoplay support policies, as such is likely to be blocked without permission being granted by the user (or a whitelist). autoplay policies typically require either explicit permission or a user engagement with the page before scripts can trigger audio to play. these special requirements are in place essentially because unexpected sounds can be annoying and intrusive, and can cause accessibility problems. yo...
... to visualise it, we will be making our audio graph look like this: let's use the constructor method of creating a node this time. when we do it this way, we have to pass in the context and any options that that particular node may take: const panneroptions = { pan: 0 }; const panner = new stereopannernode(audiocontext, panneroptions); note: the constructor method of creating nodes is not supported by all browsers at this time. the older factory methods are supported more widely. here our values range from -1 (far left) and 1 (far right). again let's use a range type input to vary this parameter: <input type="range" id="panner" min="-1" max="1" value="0" step="0.01"> we use the values from that input to adjust our panner values in the same way as we did before: const pannercontr...
Window.scrollY - Web APIs
Web › API › Window › scrollY
e document hasn't already been scrolled when using relative scroll functions such as scrollby(), scrollbylines(), or scrollbypages(). the pageyoffset property is an alias for the scrolly property: window.pageyoffset === window.scrolly; // always true for cross-browser compatibility, use window.pageyoffset instead of window.scrolly. ...
...ages(). the pageyoffset property is an alias for the scrolly property: window.pageyoffset === window.scrolly; // always true for cross-browser compatibility, use window.pageyoffset instead of window.scrolly. additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties. ...
...r cross-browser compatibility, use window.pageyoffset instead of window.scrolly. additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties. ...
...er (< 9) do not support either property and must be worked around by checking other non-standard properties. a fully compatible example: var supportpageoffset = window.pagexoffset !== undefined; var iscss1compat = ((document.compatmode || "") === "css1compat"); var x = supportpageoffset ? window.pagexoffset : iscss1compat ? document.documentelement.scrollleft : document.body.scrollleft; var y = supportpageoffset ? window.pageyoffset : iscss1compat ? document.documentelement.scrolltop : document.body.scrolltop; specification specification status comment css object model (cssom) view modulethe definition of 'window.scrolly' in that specification. working draft ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
it amet, consectetur adipiscing elit. sed nec libero nunc. nullam tortor nunc, elementum a consectetur et, ultrices eu orci. lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque a nisl eu sem vehicula egestas.</p> </div> </body> </html> view this demo in action. see also: clearinterval(). callback arguments as previously discussed, internet explorer versions 9 and below do not support the passing of arguments to the callback function in either settimeout() or setinterval(). the following ie-specific code demonstrates a method for overcoming this limitation. to use, simply add the following code to the top of your script. /*\ |*| |*| ie-specific polyfill that enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard sy...
...nds another, more complex, solution for the this problem is the following framework. javascript 1.8.5 introduces the function.prototype.bind() method, which lets you specify the value that should be used as this for all calls to a given function. this lets you easily bypass problems where it's unclear what this will be, depending on the context from which your function was called. also, es2015 supports arrow functions, with lexical this allowing us to write setinterval( () => this.mymethod) if we're inside myarray method. minidaemon - a framework for managing timers in pages requiring many timers, it can often be difficult to keep track of all of the running timer events. one approach to solving this problem is to store information about the state of a timer in an object. following is a ...
...callback function (see the "this" problem for details). the following code is also available on github. for a more complex but still modular version of it (daemon) see javascript daemons management. this more complex version is nothing but a big and scalable collection of methods for the daemon constructor. however, the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. so the minidaemon framework remains the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. minidaemon.js /*\ |*| |*| :: minidaemon :: |*| |*| revision #2 - september 26, 2014 |*| |*| /docs/web/api/window.setinterval |*| https://developer.mo...
...interval(this.session); this.paused = true; }; minidaemon.prototype.start = function (breverse) { var bbackw = boolean(breverse); if (this.backw === bbackw && (this.isatend() || !this.paused)) { return; } this.backw = bbackw; this.paused = false; this.synchronize(); }; minidaemon passes arguments to the callback function. if you want to work on it with browsers that natively do not support this feature, use one of the methods proposed above. syntax var mydaemon = new minidaemon(thisobject, callback[, rate[, length]]); description returns a javascript object containing all information needed by an animation (like the this object, the callback function, the length, the frame-rate). arguments thisobject the this object on which the callback function is called. it can be a...
XMLHttpRequest.sendAsBinary() - Web APIs
syntax xmlhttprequest.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent. you can create the binary string using the filereader method readasbinarystring(). ...
... syntax xmlhttprequest.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent. you can create the binary string using the filereader method readasbinarystring(). ...
...; parameters binarystring a domstring which encodes the binary content to be sent. you can create the binary string using the filereader method readasbinarystring(). the string is converted to binary for transfer by removing the high-order byte of each character. return value undefined. polyfill since sendasbinary() is an experimental feature, here is a polyfill for browsers that don't support the sendasbinary() method but support typed arrays. /*\ |*| |*| :: xmlhttprequest.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var ni...
... ...
XRSession.cancelAnimationFrame() - Web APIs
nframe. syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that previously scheduled the animation callback. return value none. usage notes this function has no effect if the specified handle cannot be found. example in the example below we see code which starts up a webxr session if immersive vr mode is supported. once started, the session schedules its first frame to be rendered by calling requestanimationframe(). the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. const xr = navigator.xr; ...
... by calling requestanimationframe(). the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. ...
... the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. ...
...own at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each frame callback schedules the next one, removing the callback terminates updating of the webxr scene. ...
XRSystem - Web APIs
Web › API › XRSystem
n. with that xrsession in hand, you can use it to interact with the augmented reality (ar) or virtual reality (vr) device. properties while xrsystem directly offers no properties, it does inherit properties from its parent interface, eventtarget. methods in addition to inheriting methods from its parent interface, eventtarget, the xrsystem interface includes the following methods: issessionsupported() returns a promise which resolves to true if the browser supports the given xrsessionmode. resolves to false if the specified mode isn't supported. requestsession() returns a promise that resolves to a new xrsession with the specified xrsessionmode. events devicechange sent when the set of available xr devices has changed. also available using the ondevicechange event handl...
.... events devicechange sent when the set of available xr devices has changed. also available using the ondevicechange event handler. usage notes thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to xr in code or documentation, simply replace that with xrsystem. ...
... usage notes thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to xr in code or documentation, simply replace that with xrsystem. examples the following example shows how to use both issessionsupported() and requestsession(). if (navigator.xr) { immersivebutton.addeventlistener("click", onbuttonclicked); navigator.xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { immersivebutton.disabled = false; } else { immersivebutton.disabled = true; }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then(() => { // onsessionstarted() not shown for reasons of brevity and clarity. onsessionstarted(xrsession); ...
...) => xrsession = null); } } this code starts by checking to see if webxr is available by looking for the navigator.xr property. if it's found, we know webxr is present, so we proceed by establishing a handler for the button which the user can click to toggle immersive vr mode on and off. however, we don't yet know if the desired immersive mode is available. to determine this, we call issessionsupported(), passing it the desired session option before enabling the button, immersivebutton, which the user can then use to switch to immersive mode only if immersive vr mode is available. if immersive vr isn't available, the button is disabled to prevent its use. the onbuttonclicked() function checks to see if there's already a session running. if there isn't, we use requestsession() to start on...
ARIA: switch role - Accessibility
ass="switch">speaker power</label> description the aria switch role is identical to the checkbox role, except instead of being "checked" or "unchecked", it is either "on" and "off." like the checkbox role, the aria-checked attribute is required. the two possible values are true and false. unlike a <checkbox> or role="checkbox", there is no indeterminate or mixed state. the switch role does not support the value mixed for the aria-checked attribute; assigning a value of mixed to a switch instead sets the value to false. assistive technologies may choose to represent switch widgets with a specialized presentation to reflect the notion of an on/off switch. since a switch is an interactive control, it must be focusable and keyboard accessible. if the role is applied to a non-focusable elemen...
...ue of the aria-checked attribute dynamically when the switch is toggled. associated aria roles, states, and properties aria-checked attribute the aria-checked attribute is required when using the switch role, as it represents the current state of the widget that the switch role is applied to. a value of true represents the "on" state; false represents the "off" state; a value of mixed is not supported by the switch role, and is treated as false. the default value is false. aria-readonly attribute the aria-readonly attribute is supported by the switch role. it indicates whether the widget's state is editable by the user. a value of false means that the user can change the widget's state; a value of true means that the user cannot change the widget's state. the default value is false. ...
..., or vice versa. possible effects on user agents and assistive technology when the switch role is added to an element, the user agent handles it like this: the element is exposed to the system's accessibility infrastructure as having the switch role. when the aria-checked attribute's value changes, an accessible event is fired using the system's accessibility api if one is available and it supports the switch role. all elements that are descendants of an element with the switch role applied to it are automatically assigned role presentation. this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies. text in these elements remains visible to the user agent and may be read or otherwise delivered to the user, unless it...
...ied to it are automatically assigned role presentation. this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies. text in these elements remains visible to the user agent and may be read or otherwise delivered to the user, unless it's expressly hidden using display: none or aria-hidden="true". the assistive technology, if it supports the switch role, responds by doing the following: screen readers should announce the element as a switch, optionally providing instructions as to how to activate the switch. there are varying opinions on how assistive technologies should handle this role; the above is a suggested practice and may differ from other sources. examples the following examples should help you understand h...
ARIA: button role - Accessibility
gle button. the value of aria-pressed describes the state of the button. the values include aria-pressed="false" when a button is not currently pressed, aria-pressed="true" to indicate a button is currently pressed, and aria-pressed="mixed" if the button is considered to be partially pressed. if the attribute is omitted or set to its default value of aria-pressed="undefined", the element does not support being pressed. aria-expanded if the button controls a grouping of other elements, the aria-expanded state indicates whether the controlled grouping is currently expanded or collapsed. if the button has aria-expanded="false" set, the grouping is not currently expanded; if the button has aria-expanded="true" set, it is currently expanded; if the button has aria-expanded="undefined" set or th...
... from true to false and back again. html <button type="button" onclick="handlebtnclick()" onkeydown="handlebtnkeydown()"> mute audio </button> <span role="button" tabindex="0" aria-pressed="false" onclick="handlebtnclick(event)" onkeydown="handlebtnkeydown(event)"> mute audio </span> <audio id="audio" src="https://udn.realityripple.com/samples/41/191d072707.mp3"> your browser does not support the <code>audio</code> element. </audio> css button, [role="button"] { padding: 3px; border: 2px solid transparent; } button:active, button:focus, [role="button"][aria-pressed="true"] { border: 2px solid #000; } javascript function handlebtnclick(event) { togglebutton(event.target); } function handlebtnkeydown(event) { // check to see if space or enter were pressed ...
... border: 2px solid transparent; } button:active, button:focus, [role="button"][aria-pressed="true"] { border: 2px solid #000; } javascript function handlebtnclick(event) { togglebutton(event.target); } function handlebtnkeydown(event) { // check to see if space or enter were pressed if (event.key === " " || event.key === "enter" || event.key === "spacebar") { // "spacebar" for ie11 support // prevent the default action to stop scrolling when space is pressed event.preventdefault(); togglebutton(event.target); } } function togglebutton(element) { var audio = document.getelementbyid('audio'); // check to see if the button is pressed var pressed = (element.getattribute("aria-pressed") === "true"); // change aria-pressed to the opposite state element.setatt...
...on" helps assistive technology users understand the function of the element. however, a better solution is to adjust the visual design so it matches the function and aria role. where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">, <input type="reset"> and <input type="image">) rather than the button role, as native html buttons are supported by all user agents and assistive technology and provide keyboard and focus requirements by default, without need for additional customization. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'button' in that specification. recommendation wai-aria authoring practicesthe definition of 'button' in that...
ARIA: listbox role - Accessibility
e used to select all items, and ctrl+a could be used as a shortcut key for this. when the listbox role is added to an element, or such an element becomes visible, screen readers announce the label and role of the listbox when it gets focus. if an option or item is focused within the list, it gets announced next, followed by an indication of the item's position with the list if the screen reader supports this. as focus moves within the list, the screen reader announces the relevant items. associated aria roles, states, and properties associated roles option one or more nested options are required. all selected options have aria-selected set to true. all options that are not selected have aria-selected set to false. if an option is not selectable, omit the aria-selected. list a secti...
...n the list that is selected. down arrow: moves focus to the next option. optionally, in a single-select listbox, selection may also move with focus. up arrow: moves focus to the previous option. optionally, in a single-select listbox, selection may also move with focus. home (optional): moves focus to first option. optionally, in a single-select listbox, selection may also move with focus. supporting this key is strongly recommended for lists with more than five options. end (optional): moves focus to last option. optionally, in a single-select listbox, selection may also move with focus. supporting this key is strongly recommended for lists with more than five options. type-ahead is recommended for all listboxes, especially those with more than seven options: type a character: f...
...recommended for all listboxes, especially those with more than seven options: type a character: focus moves to the next item with a name that starts with the typed character. type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed. multiple selection: authors may implement either of two interaction models to support multiple selection: a recommended model that does not require the user to hold a modifier key, such as shift or control, while navigating the list or an alternative model that does require modifier keys to be held while navigating in order to avoid losing selection states. recommended selection model -- holding modifier keys is not necessary: space: changes the selection state of th...
...alid reason to expand the listbox, the combobox role may be more appropriate. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria listbox role' in that specification. recommendation wai-aria authoring practicesthe definition of 'listbox role' in that specification. working draft screen reader support tbd ...
system - CSS: Cascading Style Sheets
wser will treat all the participating counter styles as extending from the decimal style. ...
...le-name> ]where <counter-style-name> = <custom-ident> examples cyclic counter if your browser supports it, this example will render a list like this: ā—‰ one ā—‰ two ā—‰ three css <ul> <li>one</li> <li>two</li> <li>three</li> </ul> @counter-style fisheye { system: cyclic; symbols: ā—‰; suffix: " "; } ul { list-style: fisheye; } result fixed counter if your browser supports it, this example will render a list like this: āž€ one āž two āž‚ three 4 four 5 five css <ul> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> @counter-style circled-digits { system: fixed; symbols: āž€ āž āž‚; suffix: ' '; } ul { list-style: circled-digits; } result symbolic counter if your browser supports it, this example wil...
...ke this: a. one b. two c. three aa. four bb. five cc. six aaa. seven bbb. eight css <ul> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> </ul> @counter-style abc { system: symbolic; symbols: a b c; suffix: ". "; } ul { list-style: abc; } result alphabetic counter if your browser supports it, this example will render a list like this: a. one b. two c. three aa. four ab. five ac. six ba. seven bb. seven css <ul> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> </ul> @counter-style abc { system: alphabetic; symbols: a b c; suffix: ". "; } ul { list-style: abc; } result ...
... list like this: a. one b. two c. three aa. four ab. five ac. six ba. seven bb. seven css <ul> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> </ul> @counter-style abc { system: alphabetic; symbols: a b c; suffix: ". "; } ul { list-style: abc; } result numeric counter if your browser supports it, this example will render a list like this: b. one c. two ba. three bb. four bc. five ca. six cb. seven cc. eight the first symbol provided in the symbols descriptor is interpreted as 0 here. css <ul> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> </ul> @counter-style abc { system: nu...
Using URL values for the cursor property - CSS: Cascading Style Sheets
gecko 1.8 supports url values for the css cursor property on windows and linux. mac support was added in gecko 2 (firefox 4). this allows specifying arbitrary images as mouse cursors — any image format supported by gecko can be used. syntax the basic (css 2.1) syntax for this property is: cursor: [ <url> , ]* <keyword> this means that zero or more urls may be specified (comma-separated), which must be followed by one of the keywords defined in the css specification, such as auto or pointer. for example, the following value would be allowed: cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto; this will first try loading foo.cur. ...
...which must be followed by one of the keywords defined in the css specification, such as auto or pointer. for example, the following value would be allowed: cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto; this will first try loading foo.cur. if that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used. support for the css 3 syntax for cursor values got added in gecko 1.8 (firefox 1.5): cursor: [ <uri> [ <x> <y> ]? , ]* <keyword> it allows specifying the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. if none are specified, the coordinates of the hotspot are read from the file itself (for cur and xbm files) or are set to the top left corner of the...
...sor: auto; cursor: url(cursor1.png) 4 12, auto; } .bar { cursor: pointer; cursor: url(cursor2.png) 2 2, pointer; } /* falls back onto 'auto' and 'pointer' in ie, but must be set separately */ the first number is the x-coordinate, and the second number is the y-coordinate. the example will set the hotspot to be the pixel at (4,12) from the top left (0,0). limitations all image formats supported by gecko can be used. this means that you can use png, gif, jpg, bmp, cur, etc. images. ani is not supported. an animated png or gif will not create an animated cursor. note: starting with gecko 2.0, gecko also supports the svg image format for cursors. however, the svg image must contain a length-valued (not percentage-valued) height and width on its root svg node. javascript, css animat...
...n animated cursor, for example. in gecko (firefox) the limit of the cursor size is 128×128px. larger cursor images are ignored. however, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and platforms. (due to a bug in gecko 1.9.2-1.9.2.6, firefox 3.6-3.6.6 on windows limits to 32×32px. this is fixed in later versions.) translucent cursors are not supported on windows releases earlier than xp. this is a limitation of the operating system. transparency works on all platforms. url values as cursors are supported in windows, os/2, and linux (when using gtk+ 2.4 or better) releases of mozilla. mac os x support was added with gecko 2 (firefox 4). ...
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
ight applied using an absolute length unit? there is a concept in css of min-content and max-content — these keywords are defined in the css intrinsic and extrinsic sizing specification, and can be used in place of a length unit. in the live example below for instance i have two paragraph elements that contain a string of text. the first paragraph has a width of min-content. in a browser that supports this keyword you should be able to see that the text has taken all of the soft wrapping opportunities available to it, becoming as small as it can be without overflowing. this then, is the min-content size of that string. essentially, the longest word in the string is dictating the size. the second paragraph has a value of max-content and so it does the opposite. it gets as big as it possib...
...n be without overflowing. this then, is the min-content size of that string. essentially, the longest word in the string is dictating the size. the second paragraph has a value of max-content and so it does the opposite. it gets as big as it possibly can be, taking no soft-wrapping opportunities. it would overflow the box it is in if that container was too narrow. if your browser does not yet support these keywords both paragraphs will be rendered as normal paragraphs in block flow; the below screenshots show the expected rendering. remember this behaviour and what effects min-content and max-content have as we explore flex-grow and flex-shrink later in this article. positive and negative free space to talk about these properties we need to understand the concept of positive and nega...
...50 pixels set as the main size — takes a flex-basis of 150px, whereas the other two items have no width and so are sized according to their content width. in addition to the auto keyword, you can use the content keyword as the flex-basis. this will result in the flex-basis being taken from the content size even if there is a width set on the item. this is a newer keyword and has less browser support, however you can always get the same effect by using auto as the flex-basis and ensuring that your item does not have a width set, in order that it will be auto-sized. if you want flexbox to completely ignore the size of the item when doing space distribution then set flex-basis to 0. this essentially tells flexbox that all the space is up for grabs, and to share it out in proportion. we wil...
...ems the key to really understanding how flex item sizing works is in understanding the number of things that come into play. consider the following aspects, which we have already discussed in these guides: what sets the base size of the item? is flex-basis set to auto, and does the item have a width set? if so, the size will be based on that width. is flex-basis set to auto or content (in a supporting browser)? if so, the size is based on the item size. is flex-basis a length unit, but not zero? if so this is the size of the item. is flex-basis set to 0? if so then the item size is not taken into consideration for the space-sharing calculation. do we have available space? items can’t grow with no positive free space, and they won’t shrink unless there is negative free space. ...
font-stretch - CSS: Cascading Style Sheets
font-stretch specification, the property accepts only the nine keyword values. css fonts level 4 extends the syntax to accept a <percentage> value as well. this enables variable fonts to offer something more like a continuum of character widths. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying widths. however, note that the <percentage> syntax is not yet supported by all browsers: check the browser compatibility table for details. keyword to numeric mapping the 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...
...n which the characters are narrower than the normal face (condensed faces) or wider than the normal face (expanded faces). you can use font-stretch to select a condensed or expanded face from such fonts. if the font you are using does not offer condensed or expanded faces, this property has no effect. ...
...d faces, this property has no effect. font face selection the face selected for a given value of font-stretch depends on the faces supported by the font in question. if the font does not provide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face. ...
... 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: ...
Setting up adaptive streaming media sources - Developer guides
you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element. how would you do that? this article explains how, looking at two of the most common formats: mpeg-dash and hls (http live streaming.) choosing formats in terms of adaptive 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 adaptively stream media we need to split the media up into chunks. we are required to provide several different quality files split up over several time points. the more qualities and time points there are, the more 'adaptive' your stream will be, but we will usually want to find a pragmatic balance between size, time...
...ll be generated for you. there are a few profiles we can use. we're going to take a look at ondemand profile for video on demand (vod) and the live profile. for live services streaming, the live profile is a requirement. the stream switching capabilities are identical between the profiles. ...
...tion id="5" bandwidth="500000" width="480" height="360"> <baseurl>elephantsdream_h264bpl30_0500.264.dash</baseurl> </representation> </adaptationset> </period> </mpd> once you have generated your mpd file you can reference it from within the video tag. <video src="my.mpd" type="application/dash+xml"></video> it might be wise to provide a fallback for browsers that don't yet support mpeg-dash: <video> <source src="my.mpd" type="application/dash+xml"> <!-- fallback --> <source src="my.mp4" type="video/mp4"> <source src="my.webm" type="video/webm"> </video> live profile a useful piece of software when dealing with mpeg-dash is dash encoder. this uses mp4box to encode media into mpeg-dash format. note: you will need to be comfortable with make files and install...
... hls encoding http live streaming (hls) is an http-based media streaming protocol implemented by apple. it's incorporated into ios and osx platforms and works well on mobile and desktop safari and most android devices with some caveats. media is usually encoded as mpeg-4 (h.264 video and aac audio) and packaged into an m...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
vary depending on the writing-mode, direction, and text-orientation properties, which are typically (but not always) used to adjust text directionality based on the language being displayed. for example, if the box's text is being rendered right-to-left, then the border-inline-start-color is applied to the right side of the border. other ways to use color css isn't the only web technology that supports color. there are graphics technologies that are available on the web which also support color. the html canvas api lets you draw 2d bitmapped graphics in a <canvas> element. see our canvas tutorial to learn more. svg (scalable vector graphics) lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. svg commands are formatted as xml, and c...
...ossible to the brightest possible (from black to white). image courtesy of user sharkd on wikipedia, distributed under the cc by-sa 3.0 license. the value of the hue (h) component of an hsl color is an angle from red around through yellow, green, cyan, blue, and magenta (ending up back at red again at 360°) that identifies what the base color is. the value can be specified in any <angle> unit supported by css, including degrees (deg), radians (rad), gradians (grad), or turns (turn). but this doesn't control how vivid or dull, or how bright or dark the color is. the saturation (s) component of the color specifies what percentage of the final color is comprised of the specified hue. the rest is defined by the grey level provided by the luminance (l) component. think of it like creating th...
...tuations in which your website may need to let the user select a color. perhaps you have a customizable user interface, or you're implementing a drawing app. maybe you have editable text and need to let the user choose the text color. or perhaps your app lets the user assign colors to folders or items. although historically it's been necessary to implement your own color picker, html now provides support for browsers to provide one for your use through the <input> element, by using "color" as the value of its type attribute. the <input> element represents a color only in the hexadecimal string notation covered above. example: picking a color let's look at a simple example, in which the user can choose a color. as the user adjusts the color, the border around the example changes to reflect ...
...ust one of these pixels can result in getting a color that on its own looks very out of place. fleshing out the palette once you have decided on your base color, there are plenty of online tools that can help you build out a palette of appropriate colors to use along with your base color by applying color theory to your base color to determine appropriate added colors. many of these tools also support viewing the colors filtered so you can see what they would look like to people with various forms of color blindness. see color and accessibility for a brief explanation of why this matters. a few examples (all free to use as of the time this list was last revised): mdn's color picker tool paletton adobe color cc online color wheel when designing your palette, be sure to keep in mind ...
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
dynamic adaptive streaming over http (dash) is an adaptive streaming protocol. this means that it allows for a video stream to switch between bit rates on the basis of network performance, in order to keep a video playing. browser support firefox 21 includes an implementation of dash for html5 webm video which is turned off by default. it can be enabled via "about:config" and the "media.dash.enabled" preference. firefox 23 removed support for dash for html5 webm video. it will be replaced by an implementation of the media source extensions api which will allow support for dash via javascript libraries such as dash.js. see bug 778617 for details. using dash - server side first you'll need to convert your webm video to a dash manifest with the accompanying video files in various b...
... 1. use your existing webm file to create one audio file and multiple video files. ...
...y are given; you should have one for each file. the -adaptation_sets argument assigns them into adaptation sets; for example, this creates one set (0) that contains the streams 0, 1, 2 and 3 (the videos), and another set (1) that contains only stream 4, the audio stream. put the manifest and the associated video files on your web server or cdn. dash works via http, so as long as your http server supports byte range requests, and it's set up to serve .mpd files with mimetype="application/dash+xml", then you're all set. using dash - client side you'll want to modify your web page to point to the dash manifest first, instead of directly to a particular video file: <video> <source src="movie.mpd"> <source src="movie.webm"> your browser does not support the video tag. </video> that's it...
...nge requests, and it's set up to serve .mpd files with mimetype="application/dash+xml", then you're all set. using dash - client side you'll want to modify your web page to point to the dash manifest first, instead of directly to a particular video file: <video> <source src="movie.mpd"> <source src="movie.webm"> your browser does not support the video tag. </video> that's it! if dash is supported by the browser, your video will now stream adaptively. links webm dash specification at the webm project dash industry forum webm project description of how to create dash files with ffmpeg ...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
the <applet> element was removed in gecko 56 and chrome 47. removal is being considered in webkit and edge. the obsolete html applet element (<applet>) embeds a java applet into the document; this element has been deprecated in favor of <object>. use of java applets on the web is deprecated; most browsers no longer support use of plug-ins, including the java plug-in. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. dom interface htmlappletelement attributes align t...
...ding tag are mandatory. permitted parents any element that accepts embedded content. dom interface htmlappletelement attributes align this attribute is used to position the applet on the page relative to content that might flow around it. the html 4.01 specification defines values of bottom, left, middle, right, and top, whereas microsoft and netscape also might support absbottom, absmiddle, baseline, center, and texttop. alt this attribute causes a descriptive text alternate to be displayed on browsers that do not support java. page designers should also remember that content enclosed within the <applet> element may also be rendered as alternative text. archive this attribute refers to an archived or compressed version of the applet and its associated c...
... this attribute specifies the url of the applet's class file to be loaded and executed. applet filenames are identified by a .class filename extension. the url specified by code might be relative to the codebase attribute. codebase this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. ...
... are identified by a .class filename extension. the url specified by code might be relative to the codebase attribute. codebase this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. datafld this attribute, supported by internet explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. this attribute might be used to specify the various <param> elements passed to the java applet. datasrc like datafld, this attribute is used for data binding under internet explorer 4. it indicates the id of the data source object that supplies the data that is bound to the <param> elements associated with the applet. height this attribute specifies the height, in pixels,...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
permitted aria roles no role permitted dom interface htmldetailselement attributes this element includes the global attributes. open this boolean attribute indicates whether or not the details — that is, the contents of the <details> element — are currently visible. the default, false, means the details are not visible. events in addition to the usual events supported by html elements, the <details> element supports the toggle event, which is dispatched to the <details> element whenever its state changes between open and closed. it is sent after the state is changed, although if the state changes multiple times before the browser can dispatch the event, the events are coalesced so that only one is sent. you can use an event listener for the toggle event...
...tails> <summary>system requirements</summary> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. ...
... <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some form of output device is recommended.</p> </details> result customizing the disclosure widget the disclosure triangle itself can be customized, although this is not as broadly supported. there are variations in how browsers support this customization due to experimental implementations as the element was standardized, so we'll have to use multiple approaches for a while. the <summary> element supports the list-style shorthand property and its longhand properties, such as list-style-type, to change the disclosure triangle to whatever you choose (usually with list-style-image). for example, we can remove the disclosure w...
...ons as the element was standardized, so we'll have to use multiple approaches for a while. the <summary> element supports the list-style shorthand property and its longhand properties, such as list-style-type, to change the disclosure triangle to whatever you choose (usually with list-style-image). for example, we can remove the disclosure widget icon by setting list-style: none. chrome doesn't support this yet, however, so we also need to use its non-standard ::-webkit-details-marker pseudo-element to customize the appearance in that browser. css details { font: 16px "open sans", calibri, sans-serif; width: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; list-style: none; ...
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › element
ntribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
.../browser-compat-data and send us a pull request. ...
... ? edge ? firefox no support noie no support noopera ? safari ? webview android ? chrome android ? firefox android no support noopera android ? safari ios ? samsung internet android ? ...
... safari ? webview android ? chrome android ? firefox android no support noopera android ? safari ios ? samsung internet android ? legend no support no support compatibility unknown compatibility unknownnon-standard. expect poor cross-browser support.non-standard. expect poor cross-browser support.deprecated. not for use in new websites.deprecated. not for use in new websites. see also web components: <content>, <shadow>, <slot>, an...
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
nd send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or list of addresses) before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. ...
...:valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email input falls back to being a standard text input. value a domstring representing an e-mail address, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, required, size, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value...
...ied, the value can be a list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. see validation for details on how e-mail addresses are validated to ensure that they're formatted properly. ...
...validation, or to remove it completely. it's also possible for someone to simply bypass your html entirely and submit the data directly to your server. if your server-side code fails to validate the data it receives, disaster could strike when improperly-formatted data (or data which is too large, is of the wrong type, and so forth) is entered into your database. basic validation browsers that support the email input type automatically provide validation to ensure that only text that matches the standard format for internet e-mail addresses is entered into the input box. browsers that implement the specification should be using an algorithm equivalent to the following regular expression: /^[a-za-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-za-z0-9](?:[a-za-z0-9-]{0,61} [a-za-z0-9])?(?:\.[a-za-z0-9](?
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
manipulated using javascript code and the file api. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the path to the selected file. ...
... represents the first selected file. javascript can access the other files through the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fakepath\, to prevent malicious software from guessing the user's file structure. ...
...ribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface. see htmlinputelement.webkitdirectory for additional details and examples. note: though originally implemented only for webkit-based browsers, webkitdirectory is also usable in microsoft edge as well as firefox 50 and later. however, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative. unique file type specifiers a unique file type specifier is a string that describes a type of file that may be selected by the user in an <input> element of type file. each unique file type specifier may take one of the following forms: a valid case-insensitive filename extension, starting with a period ("...
... effect: const input = document.queryselector("input[type=file]"); input.value = "foo"; when a file is chosen using an <input type="file">, the real path to the source file is not shown in the input's value attribute for obvious security reasons. instead, the filename is shown, with c:\fakepath\ appended to the beginning of it. there are some historical reasons for this quirk, but it is supported across all modern browsers, and in fact is defined in the spec. examples in this example, we'll present a slightly more advanced file chooser that takes advantage of the file information available in the htmlinputelement.files property, as well as showing off a few clever tricks. note: you can see the complete source code for this example on github — file-example.html (see it live ...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
nction: radio buttons are designed for selecting one value out of a set, whereas checkboxes let you turn individual values on and off. where multiple controls exist, radio buttons allow one to be selected out of them all, whereas checkboxes allow multiple values to be selected. value a domstring representing the value of the radio button. events change and input supported common attributes checked and value idl attributes checked and value methods select() value the value attribute is a domstring containing the radio button's value. the value is never shown to the user by their user agent. instead, it's used to identify which radio button in a group is selected. defining a radio group a radio group is defined by giving ea...
...data = new formdata(form); var output = ""; for (const entry of data) { output = output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext = output; event.preventdefault(); }, false); try this example out and see how there's never more than one result for the contact group. ...
...by default, radio buttons (and checkboxes) are styled with the operating system's native styles for those controls. by specifying appearance: none, you can remove the native styling altogether, and create your own styles for them. here we've used a border along with border-radius and a transition to create a nice animating radio selection. notice also how the :checked pseudo-c...
...ng altogether, and create your own styles for them. here we've used a border along with border-radius and a transition to create a nice animating radio selection. notice also how the :checked pseudo-class is used to specify the styles for the radio button's appearance when selected. compatibility note: if you wish to use the appearance property, you should test it very carefully. although it is supported in most modern browsers, its implementation varies widely. in older browsers, even the keyword none does not have the same effect across different browsers, and some do not support it at all. the differences are smaller in the newest browsers. notice that when clicking on a radio button, there's a nice, smooth fade out/in effect as the two buttons change state. in addition, the style an...
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
ally 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 opt to present a custom keypad optimized for entering phone numbers. using a specific input type for telephone numbers also makes adding custom validation and handling of phone numbers more convenient. ...
...resent a custom keypad optimized for entering phone numbers. using a specific input type for telephone numbers also makes adding custom validation and handling of phone numbers more convenient. note: browsers that don't support type tel fall back to being a standard text input. ...
...tart, selectionend, selectiondirection, and value methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string (""). ...
...ect a safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. permitted values are: on enable automatic correction of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the ch...
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
Web › HTML › Element › noframes
the obsolete html no frames or frame fallback element, <noframes>, provides content to be presented in browsers that don't support (or have disabled support for) the <frame> element. although most commonly-used browsers support frames, there are exceptions, including certain special-use browsers including some mobile browsers, as well as text-mode browsers. a <noframes> element can contain any html elements that are allowed within the body of an html document, with the exception of the <frameset> and <frame> elements, since using frames when they aren't supported doesn't make sense. ...
...cial-use browsers including some mobile browsers, as well as text-mode browsers. a <noframes> element can contain any html elements that are allowed within the body of an html document, with the exception of the <frameset> and <frame> elements, since using frames when they aren't supported doesn't make sense. <noframes> can be used to present a message explaining that the user's browser doesn't support frames, but ideally should be used to present an alternate form of the site that doesn't use frames but still offers the same or similar functionality. in html 5 and later, <noframes> is obsolete and shouldn't be used, since the <frame> and <frameset> elements are also obsolete. when frames are needed at all, they should be presented using the <iframe> element. attributes like all other ...
...uld be used to present an alternate form of the site that doesn't use frames but still offers the same or similar functionality. in html 5 and later, <noframes> is obsolete and shouldn't be used, since the <frame> and <frameset> elements are also obsolete. when frames are needed at all, they should be presented using the <iframe> element. attributes like all other html elements, this element supports the global attributes. it has no other attributes available. example in this example, we see a frameset with two frames. in addition, <noframes> is used to present an explanatory message if the user agent doesn't support frames. <frameset cols="50%,50%"> <frame src="https://developer.mozilla.org/en/html/element/frameset" /> <frame src="https://developer.mozilla.org/en/html/element/fra...
...es available. example in this example, we see a frameset with two frames. in addition, <noframes> is used to present an explanatory message if the user agent doesn't support frames. <frameset cols="50%,50%"> <frame src="https://developer.mozilla.org/en/html/element/frameset" /> <frame src="https://developer.mozilla.org/en/html/element/frame" /> <noframes><p>it seems your browser does not support frames or is configured to not allow them.</p></noframes> </frameset> specifications specification status comment html5the definition of 'noframes' in that specification. recommendation html 4.01 specificationthe definition of '<noframes>' in that specification. recommendation ...
<picture>: The Picture element - HTML: Hypertext Markup Language
Web › HTML › Element › picture
the selected image is then presented in the space occupied by the <img> element. ...
...n. it provides a fallback in case none of the offered <source> elements are able to provide a usable image. common use cases for <picture>: art direction. cropping or modifying images for different media conditions (for example, loading a simpler version of an image which has too many details, on smaller displays). offering alternative image formats, for cases where certain formats are not supported. saving bandwidth and speeding page load times by loading the most appropriate image for the viewer's display. if providing higher-density versions of an image for high-dpi (retina) display, use srcset on the <img> element instead. this lets browsers opt for lower-density versions in data-saving modes, and you don't have to write explicit media conditions. content categories ...
...h-dpi (retina) display, use srcset on the <img> element instead. this lets browsers opt for lower-density versions in data-saving modes, and you don't have to write explicit media conditions. content categories flow content, phrasing content, embedded content permitted content zero or more <source> elements, followed by one <img> element, optionally intermixed with script-supporting elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that allows embedded content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlpictureelement attributes this element includes only global attributes. usage notes you...
... an x (such as 2x) to serve a high-res image for high-dpi screens. <picture> <source srcset="logo-768.png 768w, logo-768-1.5x.png 1.5x"> <source srcset="logo-480.png, logo-480-2x.png 2x"> <img src="logo-320.png" alt="logo"> </picture> the type attribute the type attribute specifies a mime type for the resource url(s) in the <source> element's srcset attribute. if the user agent does not support the given type, the <source> element is skipped. <picture> <source srcset="logo.webp" type="image/webp"> <img src="logo.png" alt="logo"> </picture> specifications specification status comment html living standardthe definition of '<picture>' in that specification. living standard initial definition ...
<script>: The Script element - HTML: Hypertext Markup Language
Web › HTML › Element › script
e allows the elimination of parser-blocking javascript where the browser would have to load and evaluate scripts before continuing to parse. defer has a similar effect in this case. this is a boolean attribute: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. see browser compatibility for notes on browser support. see also async scripts for asm.js. crossorigin normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard cors checks. to allow error logging for sites which use a separate domain for static media, use this attribute. see cors settings attributes for a more descriptive explanation of its valid arguments. defer this boolean attribu...
...to load and evaluate scripts before continuing to parse. async has a similar effect in this case. integrity this attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation. see subresource integrity. nomodule this boolean attribute is set to indicate that the script should not be executed in browsers that support es2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular javascript code. nonce a cryptographic nonce (number used once) to whitelist scripts in a script-src content-security-policy. the server must generate a unique nonce value each time it transmits a policy. it is critical to provide a nonce that cannot be guessed as bypassing...
... and send no header to a less secure destination (e.g. https→http). unsafe-url: the referrer will include the origin and the path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and paths from tls-protected resources to insecure origins. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade. src this attribute specifies the uri of an external script; this can be used as an alternative to e...
...he script is blocked, an error is sent to the element, if not a load event is sent. examples basic usage these examples show how to import (an external) script using the <script> element. <script src="javascript.js"></script> and the following examples show how to put (an inline) script inside the <script> element. <script> alert("hello world!"); </script> module fallback browsers that support the module value for the type attribute ignore any script with a nomodule attribute. that enables you to use module scripts while also providing nomodule-marked fallback scripts for non-supporting browsers. <script type="module" src="main.js"></script> <script nomodule src="fallback.js"></script> embedding data in html you can also use the <script> element to embed data in html with server...
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
Web › HTML › Element › tfoot
nt to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes unimplemented (see bug 2212). if this attribute is not set, the left value is assumed. note: do not use this attribute as it is obsolete (not supported) in the latest standard. to achieve the same effect as the left, center, right or justify values, use the css text-align property on it. to achieve the same effect as the char value, in css3, you can use the value of the char as the value of the text-align property unimplemented. bgcolor this attribute defines the background color of each cell of the column. it is one of...
...round-color, on the relevant <td> or <th> elements. char deprecated since html4obsolete since html5 this attribute is used to set the character to align the cells in a column on. typical values for this include a period (.) when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. to achieve the same effect as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff deprecated since html4obsolete since html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. n...
... as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff deprecated since html4obsolete since html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. valign deprecated since html4obsolete since html5 this attribute specifies the vertical alignment of the text within each row of cells of the table header. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of t...
...characters instead of the bottom of them. if characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; and top, which will put the text as close to the top of the cell as it is possible. note: do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the css vertical-align property on it. examples please see the <table> page for examples on <tfoot>. specifications specification status comment html living standardthe definition of 'tfoot element' in that specification. living standard html5the definition of 'tfoot element' in that specification. re...
<thead>: The Table Head element - HTML: Hypertext Markup Language
Web › HTML › Element › thead
nt to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes unimplemented (see bug 2212). if this attribute is not set, the left value is assumed. note: do not use this attribute as it is obsolete (not supported) in the latest standard. to achieve the same effect as the left, center, right or justify values, use the css text-align property on it. to achieve the same effect as the char value, in css3, you can use the value of the char as the value of the text-align property unimplemented. bgcolor this attribute defines the background color of each cell of the column. it is one of...
... css property background-color, on the relevant <td> or <th> elements. char in html 4, in html5 this attribute is used to set the character to align the cells in a column on. typical values for this include a period (.) when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. to achieve the same effect as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff in html 4, in html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. note: do not use thi...
...eve the same effect as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff in html 4, in html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. valign in html 4, in html5 this attribute specifies the vertical alignment of the text within each row of cells of the table header. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. if characters ...
...the characters instead of the bottom of them. if characters are all of the size, this has the same effect as bottom. bottom, which will put the text as close to the bottom of the cell as it is possible; middle, which will center the text in the cell; top, which will put the text as close to the top of the cell as it is possible. note: do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the css vertical-align property on it. examples see <table> for examples on <thead>. specifications specification status comment html living standardthe definition of 'thead element' in that specification. living standard html5the definition of 'thead element' in that specification. recommendation ...
Global attributes - HTML: Hypertext Markup Language
global attributes. xml:lang which was initially part of xhtml, is now also part of html. hidden, data-*, contenteditable, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. several attributes that will become global attributes in subsequent specifications are defined on a subset of elements. ...
...ble, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. several attributes that will become global attributes in subsequent specifications are defined on a subset of elements. class and style are supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
... attributes that will become global attributes in subsequent specifications are defined on a subset of elements. class and style are supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
...le>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. tabindex is only supported on <a>, <area>, <button>, <object>, <select>, and <textarea>. accesskey is only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>. title is supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
Compression in HTTP - HTTP
in practice, web developers don't need to implement compression mechanisms, both browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. ...
... format. end-to-end compression for compression, end-to-end compression is where the largest performance improvements of web sites reside. end-to-end compression refers to a compression of the body of a message that is done by the server and will last unchanged until it reaches the client. whatever the intermediate nodes are, they leave the body untouched. all modern browsers and servers do support it and the only thing to negotiate is the compression algorithm to use. these algorithm are optimized for text. in the 1990s, compression technology was advancing at a rapid pace and numerous successive algorithms have been added to the set of possible choices. nowadays, only two are relevant: gzip, the most common one, and br the new challenger. to select the algorithm to use, browsers and ...
...r text. in the 1990s, compression technology was advancing at a rapid pace and numerous successive algorithms have been added to the set of possible choices. nowadays, only two are relevant: gzip, the most common one, and br the new challenger. to select the algorithm to use, browsers and servers use proactive content negotiation. the browser sends an accept-encoding header with the algorithm it supports and its order of precedence, the server picks one, uses it to compress the body of the response and uses the content-encoding header to tell the browser the algorithm it has chosen. as content negotiation has been used to choose a representation based on its encoding, the server must send a vary header containing at least accept-encoding alongside this header in the response; that way, cache...
...ed on its encoding, the server must send a vary header containing at least accept-encoding alongside this header in the response; that way, caches will be able to cache the different representations of the resource. as compression brings significant performance improvements, it is recommended to activate it for all files, but already compressed ones like images, audio files and videos. apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <httpcompression> element. hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the resource in the server, creating a specific representation that is then transmitted, but on the body of the messag...
Configuring servers for Ogg media - HTTP
video/ogg .ogv addtype application/ogg .ogg you can find specific information about possible media file types and the codecs used within them in our comprehensive guide to media types and formats on the web. in particular, the article on media container formats will be especially helpful when configuring serers to host media properly. handle http 1.1 byte range requests correctly in order to support seeking and playing back regions of the media that aren't yet downloaded, gecko uses http 1.1 byte-range requests to retrieve the media from the seek target position. in addition, gecko uses byte-range requests to seek to the end of the media (assuming you serve the content-length header) in order to determine the duration of the media. your server should accept the accept-ranges: bytes http...
...rget position. in addition, gecko uses byte-range requests to seek to the end of the media (assuming you serve the content-length header) in order to determine the duration of the media. your server should accept the accept-ranges: bytes http header if it can accept byte-range requests. it must return 206: partial content to all byte range requests; otherwise, browsers can't be sure you actually support byte range requests. your server must also return 206: partial content for the request range: bytes=0- as well. include regular key frames when the browser seeks through ogg media to a specified time, it has to seek to the nearest key frame before the seek target, then download and decode the video from there until the requested target time. the farther apart your key frames are, the longe...
...ata" will preload the media file's metadata and possibly the first few frames of video. setting payload to auto tells the browser to automatically begin downloading the media as soon as the page is loaded, under the assumption that the user will play it. configuration for older firefox versions serve x-content-duration headers note: as of firefox 41, the x-content-duration header is no longer supported. see bug 1160695 for more details. the ogg format doesn't encapsulate the duration of media, so for the progress bar on the video controls to display the duration of the video, gecko needs to determine the length of the media using other means. there are two ways gecko can do this. the best way is to offer an x-content-duration header when serving ogg media files. this header provides th...
...ests to seek to the end of the file to calculate its duration. this makes the entire process much more efficient as well as more accurate. as an inferior alternative, gecko can estimate the video length based on the content-length. see next point. don't use http compression for media files one common way to reduce the load on a web server is to use gzip or deflate compression when serving to a supporting web browser. although it's unlikely, it's possible the browser may advertise that it supports http compression (gzip/deflate) using the accept-encoding: gzip,deflate header when requesting media files. your server should be configured to not do so. the data in media files is already compressed, so you won't get any real benefit from compression, and the use of compression makes it impossi...
Connection management in HTTP/1.x - HTTP
se of this efficiency feature of tcp, and performance degrades from optimum by persisting to transmit over a new, cold connection. this model is the default model used in http/1.0 (if there is no connection header, or if its value is set to close). in http/1.1, this model is only used when the connection header is sent with a value of close. unless dealing with a very old system, which doesn't support a persistent connection, there is no compelling reason to use this model. persistent connections short-lived connections have two major hitches: the time taken to establish a new connection is significant, and performance of the underlying tcp connection gets better only when this connection has been in use for some time (warm connection). to ease these problems, the concept of a persisten...
...ell as the effective bandwidth, have a direct incidence on the improvement provided by the pipeline. without knowing these, important messages may be delayed behind unimportant ones. the notion of important even evolves during page layout! http pipelining therefore brings a marginal improvement in most cases only. pipelining is subject to the hol problem. for these reasons, pipelining has been superseded by a better algorithm, multiplexing, that is used by http/2. by default, http requests are issued sequentially. the next request is only issued once the response to the current request has been received. as they are affected by network latencies and bandwidth limitations, this can result in significant delay before the next request is seen by the server. pipelining is the process to sen...
... (maximum segment size), is big enough to contain several simple requests, although the demand in size of http requests continues to grow. not all types of http requests can be pipelined: only idempotent methods, that is get, head, put and delete, can be replayed safely: should a failure happen, the pipeline content can simply be repeated. today, every http/1.1-compliant proxy and server should support pipelining, though many have limitations in practice: a significant reason no modern browser activates this feature by default. domain sharding unless you have a very specific immediate need, don't use this deprecated technique; switch to http/2 instead. in http/2, domain sharding is no longer useful: the http/2 connection is able to handle parallel unprioritized requests very well. domain...
...en 6 connections to each (in our example, boosting the connections to 18). this technique is called domain sharding. conclusion improved connection management allows considerable boosting of performance in http. with http/1.1 or http/1.0, using a persistent connection – at least until it becomes idle – leads to the best performance. however, the failure of pipelining has lead to designing superior connection management models, which have been incorporated into http/2. ...
Content negotiation - HTTP
or a script: it is different when fetching a document entered in the address bar or an element linked via an <img>, <video> or <audio> element. browsers are free to use the value of the header that they think is the most adequate; an exhaustive list of default values for common browsers is available. the accept-ch header this is part of an experimental technology called client hints. initial support is in chrome 46 or later. the device-memory value is in chrome 61 or later. the experimental accept-ch lists configuration data that can be used by the server to select an appropriate response. valid values are: value meaning device-memory indicates the approximate amount of device ram. this value is an approximation given by rounding to the nearest power of 2 a...
...width in physical pixels (in other words the intrinsic size of an image). the accept-charset header the accept-charset header indicates to the server what kinds of character encodings are understood by the user-agent. traditionally, it was set to a different value for each locale for the browser, like iso-8859-1,utf-8;q=0.7,*;q=0.7 for a western european locale. with utf-8 now being well-supported, being the preferred way of encoding characters, and to guarantee better privacy through less configuration-based entropy, browsers omit the accept-charset header: internet explorer 8, safari 5, opera 11, firefox 10 and chrome 27 have abandoned this header. the accept-ch-lifetime header this is part of an experimental technology called client hints and is only available in chrome 61 or l...
...ly available in chrome 61 or later. the accept-ch-lifetime header is used with the device-memory value of the accept-ch header and indicates the amount of time the device should opt-in to sharing the amount of device memory with the server. the value is given in miliseconds and it's use is optional. the accept-encoding header the accept-encoding header defines the acceptable content-encoding (supported compressions). the value is a q-factor list (e.g.: br, gzip;q=0.8) that indicates the priority of the encoding values. the default value identity is at the lowest priority (unless otherwise declared). compressing http messages is one of the most important ways to improve the performance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwid...
...idden the server-chosen language, a site should no longer use language detection and should stick with the explicitly-chosen language. in other words, only entry pages of a site should select the proper language using this header. the user-agent header though there are legitimate uses of this header for selecting content, it is considered bad practice to rely on it to define what features are supported by the user agent. the user-agent header identifies the browser sending the request. this string may contain a space-separated list of product tokens and comments. a product token is a name followed by a '/' and a version number, like firefox/4.0.1. there may be as many of them as the user-agent wants. a comment is a free string delimited by parentheses. obviously parentheses cannot be u...
Access-Control-Allow-Headers - HTTP
est-headers to indicate which http headers can be used during the actual request. this header is required if the request has an access-control-request-headers header. header type response header forbidden header name no syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported request header. the header may list any number of headers, separated by commas. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication information). in requests with credentials, it is treated as the literal header name "*" without special semantics. note that the authorization header can't ...
...entials, it is treated as the literal header name "*" without special semantics. note that the authorization header can't be wildcarded and always needs to be listed explicitly. examples a custom header here's an example of what an access-control-allow-headers header might look like. it indicates that in addition to the cors-safelisted request headers, a custom header named x-custom-header is supported by cors requests to the server. access-control-allow-headers: x-custom-header multiple headers this example shows access-control-allow-headers when it specifies support for multiple headers. access-control-allow-headers: x-custom-header, upgrade-insecure-requests bypassing additional restrictions although cors-safelisted request headers are always allowed and don't usually need to be ...
... specifications specification status comment fetchthe definition of 'access-control-allow...
... allows cors requests to use the delete method, it responds with an access-control-allow-methods response header, which lists delete along with the other methods it supports: http/1.1 200 ok content-length: 0 connection: keep-alive access-control-allow-origin: https://foo.bar.org access-control-allow-methods: post, get, options, delete access-control-max-age: 86400 if the requested method isn't supported, the server will respond with an error. specifications specification status comment fetchthe definition of 'access-control-allow-headers' in that specification. living standard initial definition. ...
Index - HTTP
Web › HTTP › Headers › Index
e response header. browsers set adequate values for this header according to their user interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting). 6 accept-ranges http, http header, range requests, reference, response header the accept-ranges response http header is a marker used by the server to advertise its support of partial requests. the value of this field indicates the unit that can be used to define a range. 7 access-control-allow-credentials cors, http, reference, header the access-control-allow-credentials response header tells browsers whether to expose the response to frontend javascript code when the request's credentials mode (request.credentials) is "include". 8 ...
...s made. this header is necessary as the preflight request is always an options and doesn't use the same method as the actual request. 15 age caching, http, response, header the age header contains the time in seconds the object has been in a proxy cache. 16 allow entity header, http, http header, reference, header the allow header lists the set of methods support by a resource. 17 alt-svc draft, http, http header, needscompattable, needscontent, needsexample, reference the alt-svc header is used to list alternate ways to reach this website. 18 authorization http, http header, reference, request header, header the http authorization request header contains the credentials to authenticate a user agent with a ser...
... reported as zero due to cross-origin restrictions. 106 tk dnt, http, reference, response, header, tracking the tk response header indicates the tracking status that applied to the corresponding request. 107 trailer http, reference, header the trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status. 108 transfer-encoding http, reference, header the transfer-encoding header specifies the form of encoding used to safely transfer the entity to the user. 109 upgrade-insecure-requests http, https, secur...
... ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
ouchdb, embedded computers, complete desktop environments like gnome (one of the most popular guis for gnu/linux operating systems), and others. overview javascript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods. its syntax is based on the java and c languages — many structures from those languages apply to javascript as well. javascript supports object-oriented programming with object prototypes, instead of classes (see more about prototypical inheritance and es2015 classes). javascript also supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object. let's start off by looking at the building blocks of any language: the types. javascript programs manipu...
...integer is in fact implicitly a float. also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer values are treated as 32-bit ints, and some implementations even store it that way until they are asked to perform an instruction that's valid on a number but not on a 32-bit integer. this can be important for bit-wise operations. the standard arithmetic operators are supported, including addition, subtraction, modulus (or remainder) arithmetic, and so forth. there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5); var circumference = 2 * math.pi * r; you can convert a string to an integer using the built-in parseint() function. this takes the base for the conversion a...
...ion when it expects a boolean, such as in an if statement (see below). for this reason, we sometimes speak simply of "true values" and "false values," meaning values that become true and false, respectively, when converted to booleans. alternatively, such values can be called "truthy" and "falsy", respectively. boolean operations such as && (logical and), || (logical or), and ! (logical not) are supported; see below. variables new variables in javascript are declared using one of three keywords: let, const, or var. let allows you to declare block-level variables. the declared variable is available from the block it is enclosed in. let a; let name = 'simon'; the following is an example of scope with a variable declared with let: // myletvariable is *not* visible out here for (let my...
... == '123'; // true 1 == true; // true to avoid type coercion, use the triple-equals operator: 123 === '123'; // false 1 === true; // false there are also != and !== operators. javascript also has bitwise operations. if you want to use them, they're there. control structures javascript has a similar set of control structures to other languages in the c family. conditional statements are supported by if and else; you can chain them together if you like: var name = 'kittens'; if (name == 'puppies') { name += ' woof'; } else if (name == 'kittens') { name += ' meow'; } else { name += '!'; } name == 'kittens meow'; javascript has while loops and do-while loops. the first is good for basic looping; the second for loops where you wish to ensure that the body of the loop is execute...
Grammar and types - JavaScript
together, these also bring object literals and class declarations closer together, and allow object-based design to benefit from some of the same conveniences. var obj = { // __proto__ __proto__: theprotoobj, // shorthand...
...); // syntaxerror: unexpected string console.log(unusualpropertynames['']); // an empty string console.log(unusualpropertynames.!); // syntaxerror: unexpected token ! console.log(unusualpropertynames['!']); // bang! enhanced object literals in es2015, object literals are extended to support setting the prototype at construction, shorthand for foo: foo assignments, defining methods, making super calls, and computing property names with expressions. ...
...the following is an example of a regex literal. ...
...alls, and computing property names with expressions. together, these also bring object literals and class declarations closer together, and allow object-based design to benefit from some of the same conveniences. var obj = { // __proto__ __proto__: theprotoobj, // shorthand for ‘handler: handler’ handler, // methods tostring() { // super calls return 'd ' + super.tostring(); }, // computed (dynamic) property names [ 'prop_' + (() => 42)() ]: 42 }; regexp literals a regex literal (which is defined in detail later) is a pattern enclosed between slashes. the following is an example of a regex literal. var re = /ab+c/; string literals a string literal is zero or more characters enclosed in double (") or single (') quotation marks. a string...
Working with objects - JavaScript
constructor function alternatively, you can create an object with these two steps: define the object type by writing a constructor function. there is a strong convention, with good reason, to use a capital initial letter. create an instance of the object with new. to define an object type, create a function for the object type that specifies its name, properties, and methods. for example, suppose you want to create an object type for cars. you want this type of object to be called car, and you want it to have properties for make, model, and year. to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } notice the use of this to assign values to the object's properties based on the values pa...
...ycar and assigns it the specified values for its properties. then the value of mycar.make is the string "eagle", mycar.year is the integer 1993, and so on. you can create any number of car objects by calls to new. for example, var kenscar = new car('nissan', '300zx', 1992); var vpgscar = new car('mazda', 'miata', 1990); an object can have a property that is itself another object. ...
..., owner) { this.make = make; this.model = model; this.year = year; this.owner = owner; this.displaycar = displaycar; } then you can call the displaycar method for each of the objects as follows: car1.displaycar(); car2.displaycar(); using this for object references javascript has a special keyword, this, that you can use within a method to refer to the current object. for example, suppose you have 2 objects, managerand intern. each object have their own name, age and job. in the function sayhi(), notice there is this.name. when added to the 2 objects they can be called and returns the 'hello, my name is' then adds the name value from that specific object. as shown below. const manager = { name: "john", age: 27, job: "software engineer" } const intern= { name: "ben",...
...ction howoldami (){ console.log('i am ' + this.age + ' years old.') } manager.howoldami = howoldami; manager.howoldami() // i am 27 years old. defining getters and setters a getter is a method that gets the value of a specific property. a setter is a method that sets the value of a specific property. you can define getters and setters on any predefined core object or user-defined object that supports the addition of new properties. getters and setters can be either defined using object initializers, or added later to any object at any time using a getter or setter adding method. when defining getters and setters using object initializers all you need to do is to prefix a getter method with get and a setter method with set. of course, the getter method must not expect a parameter,...
Date.prototype.toLocaleDateString() - JavaScript
a locale, a formatted string in the default locale and with default options is returned. ...
...ed. var date = new date(date.utc(2012, 11, 12, 3, 0, 0)); // tolocaledatestring() without arguments depends on the implementation, // the default locale, and the default time zone console.log(date.tolocaledatestring()); // → "12/11/2012" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. ...
...ocaledatestring() without arguments depends on the implementation, // the default locale, and the default time zone console.log(date.tolocaledatestring()); // → "12/11/2012" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocaledatestringsupportslocales() { try { new date().tolocaledatestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } using locales this example shows some of the variations in localized date formats. in order to get the format ...
...Ū³Ū°" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocaledatestring('ar-eg')); // → "٢٠‏/ٔ٢‏/٢٠ٔ٢" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(date.tolocaledatestring('ja-jp-u-ca-japanese')); // → "24/12/20" // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(date.tolocaledatestring(['ban', 'id'])); // → "20/12/2012" using options the results provided by tolocaledatestring() can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // request a weekday along with a long date var options = { weekday: 'long', year...
Date.prototype.toLocaleString() - JavaScript
cale, a formatted string in the default locale and with default options is returned. ...
... let date = new date(date.utc(2012, 11, 12, 3, 0, 0)); // tolocalestring() without arguments depends on the // implementation, the default locale, and the default time zone console.log(date.tolocalestring()); // → "12/11/2012, 7:00:00 pm" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. ...
...estring() without arguments depends on the // implementation, the default locale, and the default time zone console.log(date.tolocalestring()); // → "12/11/2012, 7:00:00 pm" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocalestringsupportslocales() { try { new date().tolocalestring('i'); } catch (e) { return e instanceof rangeerror; } return false; } using locales this example shows some of the variations in localized date and time formats. in order to get the format...
...in most arabic speaking countries uses real arabic digits console.log(date.tolocalestring('ar-eg')); // → "٢٠‏/ٔ٢‏/٢٠ٔ٢ Ł„:Ł Ł :Ł Ł  Ųµ" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(date.tolocalestring('ja-jp-u-ca-japanese')); // → "24/12/20 12:00:00" // when requesting a language that may not be supported, such as // balinese, include a fallback language (in this case, indonesian) console.log(date.tolocalestring(['ban', 'id'])); // → "20/12/2012 11.00.00" using options the results provided by tolocalestring() can be customized using the options argument: let date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // request a weekday along with a long date let options = { weekday: 'long', y...
Date.prototype.toLocaleTimeString() - JavaScript
a locale, a formatted string in the default locale and with default options is returned. ...
...ed. var date = new date(date.utc(2012, 11, 12, 3, 0, 0)); // tolocaletimestring() without arguments depends on the implementation, // the default locale, and the default time zone console.log(date.tolocaletimestring()); // → "7:00:00 pm" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. ...
...ocaletimestring() without arguments depends on the implementation, // the default locale, and the default time zone console.log(date.tolocaletimestring()); // → "7:00:00 pm" if run in en-us locale with time zone america/los_angeles checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them already, you can use the requirement that illegal language tags are rejected with a rangeerror exception: function tolocaletimestringsupportslocales() { try { new date().tolocaletimestring('i'); } catch (e) { return e​.name === 'rangeerror'; } return false; } using locales this example shows some of the variations in localized time formats. in order to get the form...
...sh uses 24-hour time without am/pm console.log(date.tolocaletimestring('en-gb')); // → "03:00:00" // korean uses 12-hour time with am/pm console.log(date.tolocaletimestring('ko-kr')); // → "ģ˜¤ķ›„ 12:00:00" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocaletimestring('ar-eg')); // → "٧:Ł Ł :Ł Ł  Ł…" // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(date.tolocaletimestring(['ban', 'id'])); // → "11.00.00" using options the results provided by tolocaletimestring() can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // an application may want to use utc and make that visible var options = { timezon...
Object.entries() - JavaScript
ct's own enumerable string-keyed property [key, value] pairs. description object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object. the ordering of the properties is the same as that given by looping over the property values of the object manually. ...
...ue] pairs. description object.entries() returns an array whose elements are arrays corresponding to the enumerable string-keyed property [key, value] pairs found directly upon object. the ordering of the properties is the same as that given by looping over the property values of the object manually. ...
...directly upon object. the ordering of the properties is the same as that given by looping over the property values of the object manually. ...
... examples const obj = { foo: 'bar', baz: 42 }; console.log(object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ] // array like object const obj = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.entries(obj)); // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ] // array like object with ran...
String.prototype.replace() - JavaScript
bstr or the value returned by the specified function. substr a string that is to be replaced by newsubstr. it is treated as a literal string and is not interpreted as a regular expression. only the first occurrence will be replaced. newsubstr (replacement) the string that replaces the substring specified by the specified regexp or substr parameter. a number of special replacement patterns are supported; see the "specifying a string as a parameter" section below. function (replacement) a function to be invoked to create the new substring to be used to replace the matches to the given regexp or substr. the arguments supplied to this function are described in the "specifying a function as a parameter" section below. return value a new string, with some or all matches of a pattern replac...
...esized submatch string, provided the first argument was a regexp object. note that this is 1-indexed. if a group n is not present (e.g., if group is 3), it will be replaced as a literal (e.g., $3). $<name> where name is a capturing group name. if the group is not in the regular expressions (or not in the match), this will resolve to the empty string. only available in browser versions supporting named capturing groups. specifying a function as a parameter you can specify a function as the second parameter. in this case, the function will be invoked after the match has been performed. the function's result (return value) will be used as the replacement string. (note: the above-mentioned special replacement patterns do not apply in this case.) note that the function will be...
...een performed. the function's result (return value) will be used as the replacement string. (note: the above-mentioned special replacement patterns do not apply in this case.) note that the function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. the arguments to the function are as follows: possible name supplied value match the matched substring. (corresponds to $& above.) p1, p2, ... the nth string found by a parenthesized capture group (including named capturing groups), provided the first argument to replace() was a regexp object. (corresponds to $1, $2, etc. above.) for example, if /(\a+)(\b+)/, was given, p1 is the match for \a+, and p2 for \b+. offset th...
..., $2, etc. above.) for example, if /(\a+)(\b+)/, was given, p1 is the match for \a+, and p2 for \b+. offset the offset of the matched substring within the whole string being examined. (for example, if the whole string was 'abcd', and the matched substring was 'bc', then this argument will be 1.) string the whole string being examined. groups in browser versions supporting named capturing groups, will be an object whose keys are the used group names, and whose values are the matched portions (undefined if not matched). (the exact number of arguments depends on whether the first argument is a regexp object—and, if so, how many parenthesized submatches it specifies.) the following example will set newstring to 'abc - 12345 - #$*%': function replacer...
Performance fundamentals - Web Performance
nterfaces offered by the <canvas> element (which includes webgl). somewhere "in between" html/css and canvas is svg, which offers some benefits of both. html and css greatly increase productivity, sometimes at the expense of framerate or pixel-level control over rendering. text and images reflow automatically, ui elements automatically receive the system theme, and the system provides "built-in" support for some use cases developers may not think of initially, like different-resolution displays or right-to-left languages. the canvas element offers a pixel buffer directly for developers to draw on. this gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, ...
...this gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, and so forth. developers draw to canvases using either a familiar 2d drawing api, or webgl, a "close to the metal" binding that mostly follows opengl es 2.0. gecko rendering the gecko javascript engine supports just-in-time (jit) compilation. this enables application logic to perform comparably to other virtual machines — such as java virtual machines — and in some cases even close to "native code". the graphics pipeline in gecko that underpins html, css, and canvas is optimized in several ways. the html/css layout and graphics code in gecko reduces invalidation and repainting for common cases...
... this enables application logic to perform comparably to other virtual machines — such as java virtual machines — and in some cases even close to "native code". the graphics pipeline in gecko that underpins html, css, and canvas is optimized in several ways. the html/css layout and graphics code in gecko reduces invalidation and repainting for common cases like scrolling; developers get this support "for free". pixel buffers painted by both gecko "automatically" and applications to canvas "manually" minimize copies when being drawn to the display framebuffer. this is done by avoiding intermediate surfaces where they would create overhead (such as per-application "back buffers" in many other operating systems), and by using special memory for graphics buffers that can be directly accessed...
...ng to actually draw anything. another benefit to this api is that animations won't run while your app isn't visible on the screen (such as if it's in the background and some other task is operating). this will save battery life and prevent users from cursing your name into the night sky. make events immediate as old-school, accessibility-aware web developers we love click events since they also support keyboard input. on mobile devices, these are too slow. you should use touchstart and touchend instead. the reason is that these don’t have a delay that makes the interaction with the app appear sluggish. if you test for touch support first, you don’t sacrifice accessibility, either. for example, the financial times uses a library called fastclick for that purpose, which is available for y...
Populating the page: how browsers work - Web Performance
to load and smooth to interact with. two major issues in web performance are understanding issues having to do with latency and issues having to do with the fact that for the most part, browsers are single threaded. latency is our main threat to overcome to ensure a fast load. to be fast to load, the developers’ goals include sending requested information as fast as possible, or at least seem super fast. network latency is the time it takes to transmit bytes over-the-air to computers. web performance is what we have to do to make the page load happen as quickly as possible. for the most part, browsers are considered single threaded. for smooth interactions, the developer's goal is to ensure performant site interactions, from smooth scrolling to being responsive to touch. render time is k...
... starts with the body, laying out the dimensions of all the body’s descendants, with each element's box model properties, providing placeholder space for replaced elements it doesn’t know the dimensions of, such as our image. the first time the size and position of nodes are determined is called layout. subsequent recalculations of node size and locations are called reflows. in our example, suppose the initial layout occurs before the image is returned. since we didn't declare the size of our image, there will be a reflow once the image size is known. paint the last step in the critical rendering path is painting the individual nodes to the screen, the first occurence of which is called the first meaningful paint. in the painting or rasterization phase, the browser converts each box c...
... screen, the first occurence of which is called the first meaningful paint. in the painting or rasterization phase, the browser converts each box calculated in the layout phase to actual pixels on the screen. painting involves drawing every visual part of an element to the screen, including text, colors, borders, shadows, and replaced elements like buttons and images. the browser needs to do this super quickly. to ensure smooth scrolling and animation, everything occupying the main thread, including calculating styles, along with reflow and paint, must take the browser less than 16.67ms to accomplish. at 2048 x 1536, the ipad has over 3,145,000 pixels to be painted to the screen. that is a lot of pixels that have to be painted very quickly. to ensure repainting can be done even faster than t...
...r interactions within 50ms. if the main thread is occupied parsing, compiling, and executing javascript, it is not available and therefore not able to responsd to user interactions in a timely (less than 50ms) fashion. in our example, maybe the image loaded quickly, but perhaps the anotherscript.js file was 2mb and our user's network connection was slow. in this case the user would see the page super quickly, but wouldn't be able to scroll without jank until the script was downloaded, parsed and executed. that is not a good user experience. avoid occupying the main thread, as demonstrated in this webpagetest example: in this example, the dom content load process took over 1.5 seconds, and the main thread was fully occupied that entire time, unresponsive to click events or screen taps. s...
Introduction to progressive web apps - Progressive web apps (PWAs)
e there is no connectivity. this is achieved using a combination of technologies: service workers to control page requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and indexeddb to store application data offline. progressive enhancement suppport modern web apps can be developed to provide an excellent experience to fully capable browsers, and an acceptable (although not quite as shiny) experience to less capable browsers. we've been doing this for years with best practices such as progressive enhancement. by using progressive enhancement, pwas are cross-browser. this means developers should take into account the differences in im...
...t's also easy for users to ensure that they're installing the right app, because its url will match your site's domain. this is very different from apps in app stores, which may have a number of similarly-named apps, some of which may even be based on your own site, which only adds to the confusion. web apps eliminate that confusion and ensure that users get the best possible experience. browser support as mentioned before, pwas don't depend on a single api, but rather using various technologies to achieve the goal of delivering the best web experience possible. the key ingredient required for pwas is service worker support. thankfully service workers are now supported on all major browsers on desktop and mobile. other features such as web app manifest, push notifications, and add to ho...
...n't depend on a single api, but rather using various technologies to achieve the goal of delivering the best web experience possible. the key ingredient required for pwas is service worker support. thankfully service workers are now supported on all major browsers on desktop and mobile. other features such as web app manifest, push notifications, and add to home screen functionality have wide support too. currently, safari has limited support for web app manifest and add to home screen and no support for web push notifications. however, other major browsers support all these features. above all you should follow the progressive enhancement rule: use technologies that enhance the appearance and utility of your app when they're available, but still offer the basic functionality of your app...
...tures are unavailable. presenting a trusted website with a good performance is a consequence of using these enhancements; this in turn means building web apps which follow better practices. this way everybody will be able to use the app, but those with modern browsers will benefit from pwa features even more. an example application in this series of articles we will examine the source code of a super simple website that lists information about games submitted to the a-frame category in the js13kgames 2017 competition. you don't have to think about what the actual content on the website is; the main point is to learn how to use pwa features in your own projects. you can see this app in action online, and the source code is available on github. we'll be examining this code carefully over the...
Media - Progressive web apps (PWAs)
@import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type. these are ways of separating styling rules for different media types into different files. for full details of media types, see media in the css specification. there are more examples of the display property in a later page in this tutorial: xml data. printing css has specific support for printing and for paged media in general. a @page rule can set the page margins. for double-sided printing, you can specify the margins separately for @page:left and @page:right. for print media, you normally use appropriate length units like inches (in) and points (pt = 1/72 inch), or centimeters (cm) and millimeters (mm). it is equally appropriate to use ems (em) to match the font size...
.... you can control how the content of the document breaks across page boundaries, by using the page-break-before, page-break-after and page-break-inside properties. example this rule sets the page margins to one inch on all four sides: @page {margin: 1in;} this rule ensures that every h1 element starts on a new page: h1 {page-break-before: always;} more details for full details of css support for paged media, see paged media in the css specification. like other features of css, printing depends on browser choice and its settings. for example, the mozilla browser supplies default margins, headers, and footers for printing. keep in mind that you can't completely control the printed format. it is impossible to anticipate every user's browser choice and settings at the time of printi...
...these properties dynamically change the appearance of content as the user works with the interface. ...
...n: fixed; bottom: 0pt; right: 0pt; font-size: 200%; } #print-foot:after { content: counter(page); counter-increment: page; } } /* end print only */ view this document in your browser. it uses your browser's default style. print (or print preview) the document. the stylesheet places each section on a separate page, and it adds a header and footer to each page. if your browser supports counters, it adds a page number in the footer. heading for paged media section a this is the first section... page: 1 ...
stroke-linejoin - SVG: Scalable Vector Graphics
--> <path d="m9,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="arcs" /> <!-- the following pink lines highligh...
... 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="bevel" /> <!-- bottom left path: effect of the "miter-clip" value with fallback to "miter" if not supported. --> <path d="m3,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="miter-clip" /> <!-- bottom right path: effect of the "arcs" value with fallback to "miter" if not supported. --> <path d="m9,11 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="arcs" /> <!-- the following pink lines highlight the position of the path for each stroke --> <g id="highlight"> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="pink" fill="none" stroke-width="0.025" /> <circle cx="1" cy="5" r="0.05" fill="p...
... the arcs value indicates that an arcs corner is to be used to join path segments. the arcs shape is formed by extending the outer edges of the stroke at the join point with arcs that have the same curvature as the outer edges at the join point. example html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/...
... the miter-clip value indicates that a sharp corner is to be used to join path segments. the corner is formed by extending the outer edges of the stroke at the tangents of the path segments until they intersect. if the stroke-miterlimit is exceeded, the miter is clipped at a distance equal to half the stroke-miterlimit value multiplied by ...
vector-effect - SVG: Scalable Vector Graphics
not dependant on the transformations of the element (including non-uniform scaling and shear transformations) and zoom level. non-scaling-size this value specifies a special user coordinate system used by the element and its descendants. the scale of that user coordinate system does not change in spite of any transformation changes from a host coordinate space. ...
... level. non-scaling-size this value specifies a special user coordinate system used by the element and its descendants. the scale of that user coordinate system does not change in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of rotation and skew. also, it does not specify the origin of the user coordinate system. since this value suppresses scaling of the user coordinate system, it also has the characteristics of non-scaling-stroke. ...
...also, it does not specify the origin of user coordinate system. fixed-position this value specifies a special user coordinate system used by the element and its descendants. ...
...ince this value suppresses scaling of the user coordinate system, it also has the characteristics of non-scaling-stroke. non-rotation this value specifies a special user coordinate system used by the element and its descendants. the rotation and skew of that user coordinate system is suppressed in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of scaling. also, it does not specify the origin of user coordinate system. fixed-position this value specifies a special user coordinate system used by the element and its descendants. the position of user coordinate system is fixed in spite of any transformation changes from a host coordinate space. however, it does not specify the suppression of rotation, skew and scaling. when this ...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
both pis can contain "pseudo attributes" the same way that the xml-stylesheet pi does. the following document passes the two parameters "color" and "size" to the stylesheet "style.xsl". ...
...both pis can contain "pseudo attributes" the same way that the xml-stylesheet pi does. the following document passes the two parameters "color" and "size" to the stylesheet "style.xsl". ...
...cument, i.e. before the first element tag. all pis in the prolog must be honored, both ones occurring before and onces occurring after any xml-stylesheet pis. if there are multiple xml-stylesheet pis the parameters apply to all stylesheets as a consequence of that all stylesheets are imported into a single stylesheet per the xslt spec.reference? note that multiple xml-stylesheet xslt pis are not supported in firefox currently. xslt-param the xslt-param pi supports 4 attributes: name the local-name part of the parameter name. no syntax checking is done on the attribute, however if it is not a valid ncname it will never match any parameter in the stylesheet. namespace the namespace of the parameter name. no syntax checking is done on the attribute. value contains the string value ...
...lid ncname, the pi is ignored. if namespace is missing, the pi is ignored. if namespace is empty, the prefix mapping is removed. examples set the parameter 'books' to a nodeset containing all <book> elements in the 'http://www.example.org/mynamespace' namespace: <?xslt-param-namespace prefix="my" namespace="http://www.example.org/mynamespace"?> <?xslt-param name="books" select="//my:book"?> supported versions supported as of firefox 2.0.0.1. the value attribute is supported in firefox 2, but the select attribute crashes for some expressions in the 2.0 release. possible future developments should we allow any xslt functions in the expression? document() seems useful, but it seems tricky to maintain the invariant that generate-id() should produce the same string for the same document. ...
2015 MDN Fellowship Program - Archive of obsolete content
ive coaching, training and best practices for effectively communicating and educating with technical information. we expect this to be between 5-10 hours of your time per week. specific projects (we encourage you to target one of these in your application): testthewebforward brief project description mozilla participates in an important w3c open testing initiative, testthewebforward.com. to support our efforts, the fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. activities and deliverables identify gaps between existing documentation and current development environments. the work would entail refining existing tests to adapt to this framework. re...
... your normal workspace. the fine print mozilla will provide coaching, direction and training on teaching best practices. subject to mozilla’s travel reimbursement policies, mozilla will cover fellows travel, room, per diem food costs and visa costs up to $3,000 to attend the orientation. fellows are responsible for obtaining their own visas if any are required (mozilla will provide reasonable supporting documentation). the fellows will meet the stated deliverables of their projects and meet weekly with their mentor, the program lead and their other fellows. the fellow will also share the results of their projects at 1-2 events agreed upon by the fellow and the program director, as well as on their personal channels (blog, social media, etc). the fellow is responsible for any related visa...
...will meet the stated deliverables of their projects and meet weekly with their mentor, the program lead and their other fellows. the fellow will also share the results of their projects at 1-2 events agreed upon by the fellow and the program director, as well as on their personal channels (blog, social media, etc). the fellow is responsible for any related visas (mozilla can provide any necessary supporting documentation). fellows will be required to sign mozilla’s fellowship agreement in order to participate. if you’ve read all of this and still have a question, contact diane tate at diane@mozilla.com. if you don’t have specific questions and just want to introduce yourself, please use the application form. applications are closed. the application period has ended. watch this space ...
Interacting with page scripts - Archive of obsolete content
agemod({ include: pageurl, contentscript: "console.log(unsafewindow.foo);" }) tabs.open(pageurl); be careful using unsafewindow: you can't rely on any of its properties or functions being, or doing, what you expect. any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be careful. also, unsafewindow isn't a supported api, so it could be removed or changed in a future version of the sdk. expose objects to page scripts until firefox 30, you could use unsafewindow to perform the reverse procedure, and make objects defined in content scripts available to page scripts: // content-script.js unsafewindow.contentscriptobject = {"greeting" : "hello from add-on"}; // page-script.js var button = document.g...
...ustom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.defaultview. see the section below on using postmessage() before firefox 31. you can communicate between the content script and page scripts using window.postmessage(). content script to page script suppose we have a page called "listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that page. in the main add-on code, we have a page-mod that attaches the content script "talk.js" to the right page: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/listen.html", ...
...ection. ...
Communicating using "postMessage" - Archive of obsolete content
handling message events in the content script to send a message from a content script, you use the postmessage function of the global self object: self.postmessage(contentscriptmessage); this takes a single parameter, the message payload, which may be any json-serializable value. ...
...he handler function is passed the message payload. handling message events in the add-on script to send a message to a content script, use the worker's postmessage function. again, panel and page integrate worker directly: // post a message to the panel's content scripts panel.postmessage(addonmessage); however, for page-mod objects you need to listen to the onattach event and use the worker supplied to that: var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.postmessage(addonmessage); } }); to receive messages from a content script, use the worker's on function. to simplify this most content modules provide an onmessage property as an argument to the constructor: panel = require("sdk/panel").p...
...agemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { console.log('mouseover: ' + message); }); } }); the reason to prefer user-defined events is that as soon as you need to send more than one type of message, then both sending and receiving messages gets more complex. suppose the content script wants to send mouseout events as well as mouseover. now we have to embed the event type in the message payload, and implement a switch function in the receiver to dispatch the message: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage({" + " kind: 'mouseover'," + ...
Contributor's Guide - Archive of obsolete content
h are initialized to a given value when the class is instantiated. data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
...g classes, known as the base class. unlike languages like c++ and java, javascript does not have native support for classical inheritance. instead, it uses something called prototypal inheritance. as it turns out, it is possible to emulate classical inheritance using prototypal inheritance, but not without writing a significant amount of boilerplate code. content processes a content process was supposed to run all the code associated with a single tab. conversely, an add-on process was supposed to run all the code associated with a single add-on. neither content or add-on proceses were ever actually implemented, but by the time they were cancelled, the sdk was already designed with them in mind. to understand this article, it's probably best to read it as if content and add-on processes act...
... getting started learn how to contribute to the add-on sdk. modules a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface. the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them. unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. we will show how to do each of these things using the built-in components object provided by xulrunner application such as firefox and thunderbird. private properties people have come up with several ways to emulate private properties using existin...
Two Types of Scripts - Archive of obsolete content
ere are two distinct sorts of javascript scripts you might include in your add-on and they have access to different sets of apis. in the sdk documentation we call one sort "add-on code" and the other sort "content scripts". add-on code this is the place where the main logic of your add-on is implemented. your add-on is implemented as a collection of one or more commonjs modules. each module is supplied as a script stored under the lib directory under your add-on's root directory. minimally you'll have a single module implemented by a script called "main.js", but you can include additional modules in lib, and import them using the require() function. to learn how to implement and import your own modules, see the tutorial on implementing reusable modules. content scripts while your add-on...
... implement and import your own modules, see the tutorial on implementing reusable modules. content scripts while your add-on will always have a "main.js" module, you will only need to write content scripts if your add-on needs to manipulate web content. content scripts are injected into web pages using apis defined by some of the sdk's modules such as page-mod and panel. content scripts may be supplied as literal strings or maintained in separate files and referenced by filename. if they are stored in separate files you should store them under the data directory under your add-on's root. to learn all about content scripts read the working with content scripts guide. api access for add-on code and content scripts the table below summarizes the apis that are available to each type of scri...
...bjects defined in the core javascript language, such as math, array, and json. see the reference at mdn. āœ” āœ” the require() and exports globals defined by version 1.0 of the commonjs module specification. you use require() to import functionality from another module, and exports to export functionality from your module. if require() is available, then so are the modules supplied in the sdk. āœ” ✘ the console global supplied by the sdk. āœ” āœ” globals defined by the html5 specification, such as window, document, and localstorage. ✘ āœ” the self global, used for communicating between content scripts and add-on code. see the guide to communicating with content scripts for more details. ✘ āœ” ...
clipboard - Archive of obsolete content
examples set and get the contents of the clipboard. var clipboard = require("sdk/clipboard"); clipboard.set("lorem ipsum dolor sit amet"); var contents = clipboard.get(); set the clipboard contents to some html. ...
... examples set and get the contents of the clipboard. var clipboard = require("sdk/clipboard"); clipboard.set("lorem ipsum dolor sit amet"); var contents = clipboard.get(); set the clipboard contents to some html. ...
...ided data. parameters data : string the data to put on the clipboard. datatype : string the type of the data, , one of "text", "html", "image". optional. get(datatype) get the contents of the user's clipboard. parameters datatype : string retrieve the clipboard contents only if matching this type (optional). the function will return null if the contents of the clipboard do not match the supplied type. properties currentflavors data on the clipboard is sometimes available in multiple types. for example, html data might be available as both a string of html (the html type) and a string of plain text (the text type). this property is an array contains all types in which the data currently on the clipboard is available. ...
context-menu - Archive of obsolete content
und to the current context are automatically removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-on needs to add a context menu item whenever the user visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads. rather, create your item only once and supply a context that matches the target url. context menu items are displayed in the order created or in the case of sub menus the order added to the sub menu. menu items for each add-on will be grouped together automatically. if the total number of menu items in the main context menu from all add-ons exceeds a certain number (normally 10 but configurable with the extensions.addon-sdk.context-menu.
... '});' }); note that the listener function has parameters called node and data. the "node" argument node is the node that the user context-clicked to invoke the menu. if you did not use selectorcontext to decide whether to show the menu item, then this is the actual node clicked. if you did use selectorcontext, then this is the node that matched your selector. ...
...election api. var selection = require("sdk/selection"); and within the contentscript, reference the selected text as selection.text private windows if your add-on has not opted into private browsing, then any menus or menu items that you add will not appear in context menus belonging to private browser windows. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. more examples for conciseness, these examples create their content scripts as strings and use the contentscript property. in your own add-on, you will probably want to create your content scripts in separate files and pass their urls using the contentscriptfile property. see working with content scripts for more i...
ui - Archive of obsolete content
lbar at the top right of the browser window: togglebutton a toggle button is a special kind of button that's for representing a binary on/off state, like a checkbox. so they have a checked property which is toggled when the user clicks the button, and the icon gets a "pressed" look when the button is checked. it's otherwise identical to the action button. attaching panels to buttons is only supported from firefox 30 onwards. from firefox 30 onwards, you can attach panels to toggle buttons, by passing the button into the panel's constructor or its show() method: frame a frame enables you to create an html iframe, using bundled html, css and javascript. this can then be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. you...
...ou can attach panels to toggle buttons, by passing the button into the panel's constructor or its show() method: frame a frame enables you to create an html iframe, using bundled html, css and javascript. this can then be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. you initialize a frame with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. once you've created a frame you need to add it to a toolbar. toolbar the ability to add buttons to toolbars is new in firefox 30. in firefox 29 you can only add frames to toolbars. a toolbar gives you a horizon...
...lay", icon: "./icons/play.png" }); var frame = ui.frame({ url: "./frame-player.html" }); var toolbar = ui.toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: sidebar a sidebar gives you a vertical strip of space for presenting complex user interfaces. you initialize a sidebar with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. var ui = require("sdk/ui"); var sidebar = ui.sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") }); it appears on the left of the content window: ...
/loader - Archive of obsolete content
general it is not recommended to provide features via globals, it's almost always better to use pseudo-modules or, even better, modules. resolve the optional resolve option enables you to completely customize module resolution logic. resolve is assigned a function that takes: the id of the module passed into require() the id of the module that called require() on each require() call, the supplied function is then called with the id of the required module and that of the requiring module. the function returns a string representing the resolved module id, which is then resolved to its location url using the mapping provided in the paths option. if this option is not provided, the loader will use plain path resolution. this feature may also be used to implement specific security cons...
...ts x-ray vision with respect to objects inside the sandbox. defaults to true. let sandbox = sandbox({ name: 'resource:///modules/foo/bar.js', wantxrays: false, prototype: { console: { log: dump.bind(dump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '), error: dump.bind(dump, 'error: ') } } }); evaluate() evaluates code in the supplied sandbox. if options.source is provided then its value is evaluated, otherwise source is read from the supplied uri. either way, any exceptions will be reported as from the uri. optionally more options may be specified: options.encoding: source encoding, defaults to 'utf-8'. options.line: line number to start count from in stack traces. defaults to 1. options.version: version of js used...
...e and a version of require exposed to it with this function: let requirer = module(requirerid, requireruri); let require = require(loader, requirer); let boostrap = require(bootstrapid); resolveuri() this function is used by the loader to resolve module uri from an id using a mapping array generated from the loader's paths option. ...
dev/panel - Archive of obsolete content
with the browser that the developer tools are currently debugging. the messages follow the remote debugging protocol. for a simple walkthrough of using the dev/panel api to add a new tool, see adding a panel to the toolbox. basic usage defining the panel constructor to add a new tool you first need to define a constructor that inherits from the panel class, and in that constructor you need to supply values for various properties . you can set the constructor up manually if you like, or you can use the add-on sdk core/heritage module to simplify the mechanics of inheriting from panel. you can use the class utility function: const { panel } = require("dev/panel"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my...
...unction() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", .... }); in the constructor definition there are a number of mandatory and optional parameters for you to supply. name type description label string the string to display in the toolbox toolbar. mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing to an icon file, typically in your add-on's "data" directory. you can use the notation "./my-icon.png" as an alias for the url pointing to "...
...o this, don't forget to call start() on the port before passing it over to the panel document. volcan.js: a javascript api for the debugging protocol communicating with the debugger server by exchanging json messages can be cumbersome. so we've also provided a library called volcan.js which gives you a javascript api to the remote debugging protocol. note that at the moment volcan.js does not support the complete remote debugging protocol. we're still working on documenting exactly which messages are supported by volcan.js. to use volcan.js, you can just include it from your panel's html like this: <html> <head> <meta charset="utf-8"> <link href="./my-panel.css"rel="stylesheet"></link> <script src="resource://sdk/dev/volcan.js"></script> </head> <body> <div id =...
ui/button/toggle - Archive of obsolete content
wser windows or different tabs. for example, you might want to give it a different appearance when the current page is being served over https. the button api handles this by defining a tree of potential states. at the root is the global state, then there's a state you can set for each window, then a state you can set for each tab. more-specific states override less-specific states. for example, suppose the browser has two windows (w1 and w2), and each window has two tabs. initially the buttons in all tabs and windows will display the label value inherited from the global state: browser: label = "my default" w1 t1 > displays "my default" t2 > displays "my default" w2 t3 > displays "my default" t4 > displays "my default" ...
... automatically choose the best-fit icon for your button, depending on the device screen resolution and where the button is in the ui. on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. ...
...splay), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. so you can supply three icon files: icon: { "16": "./addon16.png", "32": "./addon32.png", "64": "./addon64.png" } this will look fine in both toolbar and menu panel, and for both screen resolutions. however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hidpi "32": "./addon32.png", // menu panel icon non hidpi "36": "./addon36.png", // toolbar icon hidpi "64": "./addon64.png" // menu panel icon hidpi } optional options: name type disabled boolean determines whether the button is disabled. d...
Modifying Web Pages Based on URL - Archive of obsolete content
basics of jpm. to modify any pages that match a particular pattern (for example, "http://example.org/") as they are loaded, use page-mod module. to create a page-mod, you need to specify two things: one or more content scripts to run whose job is to interact with web content. one or more patterns to match urls for the pages you want to modify. ...
...te to it. run jpm init, accepting all the defaults open the file index.js and add the code above run jpm run open ietf.org in the browser window that opens. below is what you should see. specifying the match pattern match pattern uses match-pattern syntax. you can pass a single match-pattern string, or an array. keeping the content script in a separate file in the example above, we've supplied content script as a string. unless the script is extremely simple, maintain the script as a separate file though. this makes the code easier to maintain, debug, and review. to do this, you need to: save the script in add-on's data directory. use contentscriptfile option instead of contentscript and pass it script url which can be obtained using self.data.url("my-script.js"). from firefo...
...s"), // send the content script a message inside onattach onattach: function(worker) { worker.port.emit("replacepage", "page matches ruleset"); } }); the replacepage message isn't a built-in message: it's a message defined by the add-on in the port.emit() call. injecting css note that the feature described in this section is experimental at the moment. we'll most likely continue to support the feature, but api details may change. rather than injecting javascript into a page, you can inject css by setting the page-mod's contentstyle option. var pagemod = require("sdk/page-mod").pagemod({ include: "*", contentstyle: "body {" + " border: 5px solid green;" + "}" }); as with contentscript, there's a corresponding contentstylefile option that ...
LookupNamespaceURI - Archive of obsolete content
here is an implementation of node.lookupnamespaceuri which should work cross-browser. note that all gecko-based browsers (including firefox) support node.lookupnamespaceuri. this function is not necessary for gecko-based browsers (though the function will quickly return the standard value for mozilla browsers) when used to reflect on static documents. however, due to bug 312019, this method does not work with dynamically assigned namespaces (e.g., those set with node.prefix). ...
...d browsers (though the function will quickly return the standard value for mozilla browsers) when used to reflect on static documents. however, due to bug 312019, this method does not work with dynamically assigned namespaces (e.g., those set with node.prefix). ...
...kupnamespaceurihelper (node, prefix) { // adapted directly from http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceurialgo var i, att, htmlmode = document.contenttype, // mozilla only xmlnspattern = /^xmlns:(.*)$/; switch (node.nodetype) { case 1: // element_node (could also just test for node.element_node, etc., if supported in all browsers) if (node.namespaceuri != null && node.prefix === prefix) { // note: prefix could be "null" in the case we are looking for default namespace return node.namespaceuri; } if (node.attributes.length) { for (i = 0; i < node.attributes.length; i++) { ...
JavaScript Daemons Management - Archive of obsolete content
then to create a constructor for such a class of objects (daemon) in order to standardize and simplify the instantiation of them. note: a minimalistic version of it (minidaemon) is published here. this more complex version of it is nothing but a big and scalable collection of methods for the daemon constructor. but the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. so the minidaemon framework will remain the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. the architecture of the daemon constructor explicitly avoids the use of closures. it also offers an alternative way to pass the this object to the cal...
...dule is daemon.js: both the daemon-safe.js module and the daemon-methods.js module require daemon.js to work. for a fast overview on the code proposed here you can git clone https://github.com/madmurphy/daemon.js.git. or, at your choice, directly download this .zip file. about the “callback arguments” polyfill in order to make this framework compatible with internet explorer (which doesn't support sending additional parameters to timers' callback function, neither with settimeout() or setinterval()) we included the ie-specific compatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the daemon.js module. daemon.js what follows is the module that declares the daemon constructor (th...
...e-specific compatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the daemon.js module. daemon.js what follows is the module that declares the daemon constructor (the core of this framework). the daemon constructor itself is nothing but a clone of the little framework minidaemon with added support for init and onstart functions (declarable during the instantiation of the daemon). so the minidaemon framework will remain the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. /*\ |*| |*| ******************************* |*| * daemon.js * |*| ******************************* |*| |*| ver. 1.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
script extensions, you're aware that the most important stuff goes in the chrome/ directory of your extension. well, the fact that you're also using c++ components doesn't change that one whit. so now you need to create the normal content/, locale/ and skin/ directories in which to place your chrome files. personally i like placing these directly under the root directory of my module, but i don't suppose it makes any difference if you prefer putting them under a chrome/ subdirectory or whatever. let freedom reign! once you've written the necessary chrome files (for instance, an overlay that adds a menu item to instantiate and use one of your components), you need to package them up as part of your extension. this is accomplished through the use of a jar manifest. for our simple extensi...
...ng and two trailing underscores) symbol that points to the component's implementation file. so you can write a simple component which deduces the root directory of your extensions by extrapolating from its location. this article explains how to create an xpcom component in javascript. you'll need an idl file for an interface that looks something like this: interface myilocation : nsisupports { readonly attribute nsifile locationfile; }; place the idl file in the public/ directory of your project or subproject. in the src/ directory, place the javascript file that implements the component. the component implementation will include the methods for retrieving the path or file for the extension's home directory: mylocation.prototype = { queryinterface: function(iid)...
... nsifile locationfile; }; place the idl file in the public/ directory of your project or subproject. in the src/ directory, place the javascript file that implements the component. the component implementation will include the methods for retrieving the path or file for the extension's home directory: mylocation.prototype = { queryinterface: function(iid) { if (iid.equals(nsisupports)) return this; if (iid.equals(myilocation)) return this; components.returncode = components.results.ns_error_no_interface; return null; }, get locationfile() { return __location__.parent.parent; } } this assumes that the component resides in a subdirectory of the extension directory (by convention, this directory is called components/). the paren...
Inline options - Archive of obsolete content
the user interface for the preferences defined with this new syntax appears in the extension's detail view in the add-on manager. this functionality originally appeared in firefox mobile and is now available in firefox on the desktop as well. options file the xul allowed for the inline options is limited to a few new tags. ...
...ype 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. the root <vbox> just acts as a container, it isn't merged into the main window. if you need script support, see the display notifications section. setting types there are several types of <setting>s, each with a different type attribute: type attribute displayed as preference stored as bool checkbox boolean boolint checkbox integer (use the attributes on and off to specify what values to store) integer textbox integer string ...
...so like for the type="file", once a user browses and picks a file, when it updates the label it will trigger the oninputchanged attribute. so if you would like to do some changes to the xul on the inline options page you can do so. the this value is the setting xul element. see mxr for what all this holds: http://mxr.mozilla.org/mozilla-release/source/toolkit/mozapps...
Updating addons broken by private browsing changes - Archive of obsolete content
idls nsitransferable: see using the clipboard for information about the new init method. imgicache: this must no longer be obtained as a service. see the imgicache article for more information. moziasyncfavicons/nsifaviconservice: setandf...
...idownloadmanager now has activeprivatedownloads, activeprivatedownloadcount, and privatedbconnection members to complement the existing public ones. nsidownloadmanager's addlistener method is deprecated. addprivacyawarelistener should be used instead, or no notifications will be received for private downloads. there is a new download-manager-remove-download-guid notification, which passes an nsisupportscstring subject for the guid or null. nsihttpauthmanager: setauthidentity and getauthidentity now take an optional boolean parameter to indicate whether the identity is classified as private. nsistricttransportsecurityservice: processstsheader, removestsstate, isstshost, and isstsuri now take a flags parameter that understands nsisocketprovider.no_permanent_storage or nothing. nsipr...
...s of firefox 21. nsirecentbadcertsservice: this is no longer a global service, and has been renamed to nsirecentbadcerts. to obtain this, acquire the nsix509certdb service, and use the new getrecentbadcerts method, passing a boolean indicating whether the private bad certificates or public ones are desired. observer notifications none of the ones listed above will be sent as of firefox 20. the supporting per-window private browsing article explains further about the equivalent notifications, which are all backwards compatible through to firefox 12 (and are sent side-by-side with the global private browsing notifications in older versions). chrome apis openbrowserwindow: takes an optional parameter to indicate desired properties of the window. passing {private: true} will cause a priva...
Add-ons - Archive of obsolete content
u are already familiar with building an extension. extension packaging extensions are packaged in a form of installable bundle which can be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of an xul program. extensions support in seamonkey 2 starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions. these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. firefox addons developer guide the original document is in japanese and distributed via the xuldev.org website. so there may be still some reference to the xuldev website (...
...ared to the old xpinstall/-style extensions. firefox addons developer guide the original document is in japanese and distributed via the xuldev.org website. so there may be still some reference to the xuldev website (we want to host source code on mdc, not on xuldev), and to japanese things (like some specific locales, which have been translated to french since non-latin characters are not well supported). hotfix extension this document has been moved to the add-ons wiki. how to convert an overlay extension to restartless first off, what kind of add-on are we talking about here? well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own. some of that will have to be replaced and the rest will need to ...
... moved to the add-ons wiki. how to convert an overlay extension to restartless first off, what kind of add-on are we talking about here? well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own. some of that will have to be replaced and the rest will need to be loaded differently. inline options firefox 7 supports a new syntax for defining extensions' preferences for both bootstrapped and traditional extensions. the user interface for the preferences defined with this new syntax appears in the extension's detail view in the add-on manager. this functionality originally appeared in firefox mobile and is now available in firefox on the desktop as well. install manifests an install manifest is the file...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
for printing that page. so what advantages does this redesign give you as a site administrator? you mean besides the fact that as designer, i can control design details on thousands of news pages with just a few files? besides the fact that the engineers can finally focus on building out the working functionality of the site rather than worrying about appearance or where the next spacer.gif is supposed to go? besides the five minutes it recently took for one of our developers to rearrange a module when he thought it would take him an hour or two? besides the idea that we're changing our entire color scheme every day of the week by merely pointing to a different css file and altering an image variable? hmmm. i'm having a tough time thinking of any advantages... what disadvantages did you e...
...n hour or two? besides the idea that we're changing our entire color scheme every day of the week by merely pointing to a different css file and altering an image variable? hmmm. i'm having a tough time thinking of any advantages... what disadvantages did you encounter? honestly, there were several challenges and glitches we ran into along the way. first of all, since wired news is a heavily ad-supported site, our advertising units were the cause of several important decisions. our ad-serving partner basically requires that we use iframes to dynamically pull in ads from available inventory. because of the iframe, we backed off of the idea that we'd be able to adhere to xhtml strict rules, and settled for using the xhtml transitional dtd. we were hoping to go all the way with the xhtml conve...
... or specialized browsing environments? and forward-compatible with browser applications of the future? are you comfortable with the idea that your documents may not look exactly the same in every browser? if the answer to one or more of those questions is "yes," chances are, you could be ripe to make the leap. keep in mind the last disadvantage i just mentioned. not every browser will be able to support the css used to replace table layouts. in those cases, the browser will either render your documents with many bugs, or you'll have to consciously choose to hide certain bits of style information from browsers that can't support css adequately enough. what are the browser percentages of your current user base, and what about your target user base (which may be different)? will the majority of...
Creating a status bar extension - Archive of obsolete content
extension identification information certain information is needed so fir...
...ation information it's also necessary to include information that identifies the application or applications in which your extension is designed to run. although this sample extension only works in firefox, it's entirely possible to create extensions that work in multiple xul-based applications. it's also necessary to indicate what versions of the target application or applications your extension supports. if it won't work in older versions of firefox, or hasn't been tested on newer versions, you can restrict the extension so that only supported versions of the target application will attempt to use it. the target application information is contained within the em:targetapplication description block. property name description id an id indicating the target application.
...pt to use it. the target application information is contained within the em:targetapplication description block. property name description id an id indicating the target application. "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" is a guid that uniquely identifies firefox as the target. minversion the oldest version of the target application on which the extension is supported. maxversion the most recent version of the target application on which the extension is known to work. for details on the format of an install manifest, read the install manifests section. the chrome manifest the chrome manifest is a file that tells the target application where to look for the chrome package for your extension. the chrome is the set of user interface eleme...
List of Mozilla-Based Applications - Archive of obsolete content
nner moznet .net control embeddable gecko for .net applications wraps xulrunner for use in .net applications my internet browser localized browser uses gecko myna application server javascript application server for java uses mozilla rhino nextcms (fr) cms nightingale music player community run effort to continue songbird support for linux olpc web browser browser oneteam jabber client opendocument viewer viewer opengate's tools cd burner, file browser, and hardware diagnostic softwares opengate is the opensource side of the easyneuf project, “a free software computer, easy and preinstalled” open mashups development tool openof...
...xul and the mozilla framework are heavily used in the gui snapstick internet on tv article that talks about snapstick using firefox sogo groupware front-end uses thunderbird code songbird music xulrunner application spi...
...aven't seen information elsewhere tuxguitar tabulature editor uses xulrunner twitfactory standalone twitter/identi.ca client uis university information system intranet application, 1000 users, thin client based on ff3 unison desktop enterprise email i think it's using mailnews code but don't have any information to link to. feel free to supply references. uox3 ultima online server-emulator uses mozilla spidermonkey verbosio xml editor no releases available verseminder bible passage app virgin media security security tools seems to use xulrunner virtualbox virtualization tool use xpcom as its component model on linux waterfox 64-bit variant of fir...
Defining Cross-Browser Tooltips - Archive of obsolete content
w to define &quot;tooltips&quot; in a cross-browser, standards-friendly way. authors are used to using the alt attribute to create "tooltips" in web browsers. the classic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior. see bug 25537 for a lengthy, sometimes passionate discussion of gecko's behavior in this regard. the problem according to the html 4.01 definition of the alt attribute: alt = text cs for user agents that cannot display images, forms, or applets, this attribute specifies alternate text. the language of the alternate text is specified by the lang attribute. in other words...
...rnate text. the language of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. this assumes that the browser can find the image and that it supports the image format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. on the other hand, the html 4.01 definition of the title attribute states: title = text cs this attribute offers advisory information about the element for which it is set. unlike the title element, which provides information abo...
...e. on the other hand, the html 4.01 definition of the title attribute states: title = text cs this attribute offers advisory information about the element for which it is set. unlike the title element, which provides information about an entire document and may only appear once, the title attribute may annotate any number of elements. please consult an element's definition to verify that it supports this attribute... values of the title attribute may be rendered by user agents in a variety of ways. for instance, visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object). between these two passages, it is fairly clear that the proper method for defining a "tooltip" for an image (or, indeed, for any element)...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
introduction microsoft has removed support for netscape plug-ins from ie 5.5 sp 2 and beyond. if you are a plug-in author, you may find this project saves you a lot of work! this page describes a control that implements the np api and hosts most netscape-compatible plug-ins. now you can use your plug-ins in any recent version of ie or in any other activex container for that matter. the control itself is implemented in a dll called pluginhostctrl.dll which is standalone from the rest of the mozilla project. if you're wondering how microsoft used to support the np api, look for a file called plugin.ocx in your windows system directory. this 100k activex control contains the entire np api implementation and probably worked much like pluginhostctrl.dll does now. the sections below tell yo...
...ne. build it it is quite simple to build the control locate the pluginhostctrl directory: open pluginhostctrl.dsp build "win32 debug" or another target open some of the test files under pluginhostctrl\tests in internet explorer to verify the control has built and registered correctly. the control currently reads plug-ins from your most current netscape 4.x and ie installations. there is no support for mozilla or ns 6.x yet. a note to developers if you intend to modify this control in any way then you must also change the clsid from {dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2} to something else and any other guids this control relies upon (iid, libids etc). this is necessary so that your control may coexist with the generic version and any other versions that other plug-ins vendors may have ...
...am of data to feed the plug-in. if you havent't specified a "type" param, the control will attempt to use the mime type of this stream to create the correct plug-in. <param name="pluginspage" ...> is equivalent to pluginspagespecifies a url where the plug-in may be installed from. the default plug-in will redirect you to this page when you do not have the correct plug-in installed. you may also supply any custom plug-in parameters as additional <param> elements. still to do only hosts windowed plug-ins. an official pluginhostctrl.cab file. doesn't work for the adobe acrobat plug-in yet. plug-ins cannot create writeable streams or seek in readable streams. liveconnect scripting is not supported. if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that e...
Blackwood - Archive of obsolete content
the blackwood project, started by engineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser. blackwood consists of a series of java-based extensions to mozilla. ...
... the blackwood project, started by engineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser. blackwood consists of a series of java-based extensions to mozilla. ...
...ject, started by engineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser. blackwood consists of a series of java-based extensions to mozilla. ...
Structure of an installable bundle - Archive of obsolete content
tall.rdf extension/theme install manifest /application.ini application launch manifest /bootstrap.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). note that other files and directories (e.g. chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a supporting application. (>=2.0) /chrome.manifest chrome registration manifest (>=1.8) /components/* xpcom components (*.js, *.dll), and interface files from *.xpt (>=1.7) /defaults/preferences/*.js default preferences (>=1.7) /plugins/* npapi plugins (>=1.8) /chrome/icons/default/* window icons (>=1.8) /icon.png ...
...er /dictionaries/*.{aff|dic} myspell dictionaries firefox 2 and greater of course, an extension need not (and normally won't) have all of these directories. themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a jar file. platform-specific files gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for platform-specific subdirectories, described below. instead, you need to use manifest flags, such as the os and abi flags, in your chrome manifest to specify components that should be loaded for specific platforms. for example: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component comp...
...y-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means you can no longer have platform-specific preference files in your bundle. platform-specific subdirectories: gecko 1.9.2.x and earlier note: platform-specific subdirectory support was removed in gecko 2.0. see the section platform-specific files to learn how to use platform-specific files. in some cases a single extension or application may wish to include binary component or plugins for multiple platforms, or theme authors might want to include multiple platform-specific jar files. to facilitate the first case, the extension/app loader has special sub-directories sp...
Drag and drop events - Archive of obsolete content
drag sent when a drag operation begins. dragend sent when a drag operation ends. ...
... drag sent when a drag operation begins. dragend sent when a drag operation ends. ...
... drag sent when a drag operation begins. dragend sent when a drag operation ends. ...
Documentation for BiDi Mozilla - Archive of obsolete content
this is preliminary documentation of the changes introduced to mozilla as part of the bidi support contributed by ibm (a.k.a. ibmbidi), written by simon montagu and posted to the mozilla-layout mailing list. while it was published in 2001 and might not be totally accurate, it does help understanding the internals of the bidi code. overview of bidi processing bidi text is reordered according to the unicode bidi algorithm (uba). the implementation is based on ibm's international components for unicode (icu), which was chosen after comparing and testing the available open-source implementations. as far as we could discover, icu is the only one which is 100% compatible with uba, including support for explicit directional controls (lro, rlo, etc, and their html equivalents). bidi proces...
...that a logical application will display it (from a bidi point of view) as it is displayed by mozilla. text pasted from the clipboard is treated exactly as if it came from a logical source. form controls: based on bidi options in preferences, the text mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and lists, and fixes for problems with different combinations of dir and align. improvements to lists with hebrew and arabic list-style-type summary of new classes class name xpcom interface (if applicable) implementation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of th...
...it is created when resolving text containing...
JavaScript Client API - Archive of obsolete content
the best, and most up-to-date, reference to sync's internal apis is the source code. ...
...istently store anything, but rather serve as short-lived data stores during the course of a single sync and act as proxies to other data stores within the application (like the places database) outside of sync. creating a custom engine the sync client ships with a number of engines out of the box (history, bookmarks, etc). it is possible for other components, including 3rd party extensions, to supplement the set of engines and synchronize their own data. a word of warning: the javascript client api is still a young component and is continuing to evolve. therefore, developers outside of the sync core should know that their code could require significant refactoring in future releases. before developing against the javascript api, it is recommended to speak to developers of the api. see htt...
... createrecord the createrecord( id, collection ) method gets called by the engine to request a new record for an item with a given guid. it's your store's responsibility to instantiate a record object, assign the given guid, and return it. itemexists(guid) should simply return true if an item with the given guid exists in the store, false otherwise. change...
Twitter - Archive of obsolete content
refore need to be familiar with twitter's own api. (it's easy!) methods each method in twitter's api maps to a method here. for example, the twitter method for tweeting, statuses/update, maps to jetpack.lib.twitter.statuses.update(). to call trends/current, use jetpack.lib.twitter.trends.current(). for search, jetpack.lib.twitter.search(). replace slashes with dots. most of twitter's methods are supported, but not all. list methods, spam reporting methods, and oauth are not currently supported. if something is not supported but you would like it to be, please file a bug. (or write a patch!) arguments each and every method in the library takes a single argument, an object. there are two styles you can use to define this object. the first is simple: define properties on the object correspo...
...pond to the parameters of the twitter method. with this style you can use any of the various jquery.ajax() options in your request: data, success, complete, etc. example: jetpack.lib.twitter.statuses.update({ data: { status: "o frabjous day!" }, username: "basic_auth_username", password: "basic_auth_password", success: function () console.log("hey!") }); user authentication you can supply a username and password to methods that require authentication using the second, more advanced call style described above. or you can simply rely on firefox. when you call a method that requires authentication -- such as jetpack.lib.twitter.statuses.update() -- without providing a username or password, firefox will prompt the user for them if she is not already authenticated with twitter. both...
... the second, more advanced call style described above. or you can simply rely on firefox. when you call a method that requires authentication -- such as jetpack.lib.twitter.statuses.update() -- without providing a username or password, firefox will prompt the user for them if she is not already authenticated with twitter. both methods use http basic authentication. in the future, the library may support oauth. see twitter's authentication documentation for related information. faq see twitter's api faq. since jetpack's twitter library is a very thin wrapper around twitter's api, most everything there applies here, and not much applies here that doesn't apply there. example usage tweeting jetpack.lib.twitter.statuses.update({ status: "o frabjous day!" }); firefox will prompt for a userna...
Extensions - Archive of obsolete content
prism has support for extensions. extensions are built using the same methods as any mozilla-based extension. since prism is a totally separate host application, there are some prism-specific issues that you need to handle when creating your extension. most notably, the prism application id and the differences in the user interface (ui). extensions typically overlay the host application's ui to add toolbar buttons, menus and other features. one of prism's features is an extreme lack of ui elements, which means that trying to use the same overlays in firefox and prism is really not possible. the basics in order to install an extension in prism, you need to follow the guidelines for building a mozilla-based extension. ...
...face (ui). extensions typically overlay the host application's ui to add toolbar buttons, menus and other features. one of prism's features is an extreme lack of ui elements, which means that trying to use the same overlays in firefox and prism is really not possible. the basics in order to install an extension in prism, you need to follow the guidelines for building a mozilla-based extension. to support prism specifically, you'll need to add prism to the list of target applications in the extension's install.rdf file. the code snippet will look something like this: <em:targetapplication> <!– prism –> <description> <em:id>prism@developer.mozilla.org</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>1.0.0.*</em:maxversion> </description> </em:targetapplication> i...
...m, you may need to port your favorite extensions. this usually means extracting and editing the install.rdf file to add prism as a target application. you may also need to modify the extension's overlay to be able to work with the prism ui. many archive tools, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the xpi. installing prism supports a basic add-on user interface which allows a user to manage extensions. using this dialog, a user just launches a webapp and opens the add-ons dialog. then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” button, navigating to the extension and selecting it for installation. extensions can be removed using the same dialo...
Priority Content - Archive of obsolete content
keller licensing: these css charts appear to be under a cc:by-nc-sa license, please make note of that on the page when you do the migration. started: using mozilla in testing and debugging web sites original: using mozilla in testing and debugging web sites wiki location: ...
...keller licensing: these css charts appear to be under a cc:by-nc-sa license, please make note of that on the page when you do the migration. started: using mozilla in testing and debugging web sites original: using mozilla in testing and debugging web sites wiki location: using mozilla in testing and d...
...tion: scripting plugins: macromedia flash migrators: dependant on (these parts need to be done, put your name down) completed: soap in netscape gecko-based browsers original: soap in netscape gecko-based browsers wiki location: soap in gecko-based browsers migrators: doron rosenberg in progress: css support charts original: css support charts and archive.org mirror wiki location: css support charts migrators: serge k. keller licensing: these css charts appear to be under a cc:by-nc-sa license, please make note of that on the page when you do the migration. started: using mozilla in testing and debugging web sites original: using mozilla in testing and debugging web sites wiki location: using mozilla in testing and debugging web sites migrators: serge k. keller note: henr...
RDF Datasource How-To - Archive of obsolete content
rticle is at least partially outdated. help bring it up to date, if you can. the xpcom registration parts and the "as of this writing, it is not currently possible to implement javascript xpcom components" comment seem outdated didn't check the whole article. this document is a cookbook that describes how to create a native, client-side datasource that works with mozilla's rdf implementation. it supersedes (and borrows from) the original document put together by robert churchill. what is a datasource? the "rdf universe" consists of a set of statements about internet resources; for example, "my home page was last modified april 2nd", or "that news article was sent by bob". in the most abstract sense, a datasource is a collection of such statements. more concretely, a datasource is a translato...
...xpcom progid in order to be instantiated from the repository. constructing a dll for a component is beyond the scope of this document; the reader is referred to the rdf factory as a guideline. registering an rdf datasource is fairly simple: in the dll's nsregisterself() method, you simply call the component manager's registercomponent() method: extern "c" pr_implement(nsresult) nsregisterself(nsisupports* aservicemanager, const char* apath) { nsresult rv; ... // assume compmgr refers to the component manager rv = compmgr->registercomponent(kmydatasourcecid, "my data source", ns_rdf_datasource_progid_prefix "my-datasource", apath, pr_true, pr_true); ... } replace kmydatasourcecid with your datasource's clsid. replace "my data source" with a ...
...source" with a value appropriate for your datasource. this value, when prefixed with "rdf:", is a datasource identifier, and may be used with nsirdfservice::getdatasource() to retrieve your datasource from the rdf service. for example, the above datasource would be accessable as follows: nsirdfservice* rdf; rv = nsservicemanager::getservice(krdfservicecid, kirdfserviceiid, (nsisupports**) &rdf); if (ns_succeeded(rv)) { nsirdfdatasource* mydatasource; rv = rdf->getdatasource("rdf:my-datasource", &mydatasource); if (ns_succeeded(rv)) { // ...do something to mydatasource here... ns_release(mydatasource); } nsservicemanager::releaseservice(krdfservicecid, rdf); } displaying rdf as content now that you've gone through all ...
Running Tamarin acceptance tests - Archive of obsolete content
t python executable in cygwin. the locations of avm, asc, builtinabc and shellabc must also be defined using windows paths (replace backslashes [\] with forward slashes [/]): export avm=c:/location/of/avmshell.exe export asc=c:/location/of/asc.jar ... c:/python26/python.exe ./runtests.py --threads=3 other flags of interest (for a list of all flags, run runtests.py with -h/--help) --nohtml : will suppress the creation of an html output file --rebuildtests : will only rebuild test .abc's, will not attempt to run them. can also be using in conjunction with --threads -f --forcerebuild force rebuild all test files -q --quiet : will print a period (.) for each test run regardless of results, then print the test run summary when finished --ascargs= : additional arguments to pass to asc.jar --vmarg...
... adb 'adb' stands for android debug bridge. adb is used to access your android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices lists the device id of each phone. if you have more than 1 phone connected to usb, use "adb -s " for each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb deb...
...ber of threads to the number of phones found via usb. running with 2 or more phones uses threads to run tests in parallel and reduces running times dramatically. you must, in any case, at least use --androidthreads or --threads=1 (or will fail due to multiple tests running). $ cd tamarin-redux/test/acceptance $ ./runtests.py --androidthreads note on using an emulator: the emulator does seem to support hardware floating point but gives a buserror when running avmshell -darm_vfp. it's unreliable, losing its adb connection frequently. an emulator is ok for testing a few abc files but for any consistency a real device is better. ...
Running Tamarin performance tests - Archive of obsolete content
core: new option of --score will display a cumulative score for every metric. really most useful with an index file (or v8 tests), since running with raw time values will skew the results towards longer running tests csv output: "--csv filename" will save run results to a csv file that can be analyzed using excel pivottables. use --csvappend if you want to append the results to the csv file support files testconfig.txt this file contains instructions for how the harness should handle performance tests. metricinfo.py this file contains a list of metrics that the harness will look for and record. see the file header for details testing the android shell the instructions above apply to running tests on an android device as well, but with a few differences. you should set environment vari...
... adb 'adb' stands for android debug bridge. adb is used to access your android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices lists the device id of each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb debugging enabled? testsuite setup example commands: root the phone $ adb root copy...
...lo.abc hello exitcode=0 running performance tests to run performance tests on android you don't need to pass --androidthreads or --threads=1 as with the acceptance tests; in fact, a usage error will result. just type the following commands after making sure you've set the environment variables correctly. $ cd /test/performance $ ./runtests.py note on using an emulator: the emulator does seem to support hardware floating point but gives a buserror when running avmshell -darm_vfp. it's unreliable, losing its adb connection frequently. an emulator is ok for testing a few abc files but for any consistency a real device is better. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
ller script is relatively short, but it exercises most of the important features of the xpinstall api, and it can easily be used as a template for other more general software installations. in this article, we use the unix install file, but the installers for all the platforms are quite similar, and you can easily take what you learn here and apply it to installations on any platform that mozilla supports. about browser.xpi browser.xpi is the xpi archive in which the main components of the mozilla browser are archived for installation. mozilla cross-platform installations use the xpi format as a way to organize, compress, and automate software installations and software updates. a xpi is a pkzip-compressed archive (like zip and jar files) with a special script at the highest level that mana...
...(when the installation is actually begun with a call to performinstall at the end), is the communicatorfolder directory defined at line 22 as "program." "program" is one of a short list of keywords that can be used in place of full path names in methods such as addfile. "program" represents the directory where software itself is installed (e.g., c:\program files\ on win32 systems), as opposed to supporting directories like "components", "chrome", or "temporary" (see getfolder in the xpinstall api reference for a list of keywords). registering the software registering software is sometimes a requirement of both the operating system and of the netscape 6 platform. when you install new chrome, for example, like the browser.xpi install does, you need to alert the chrome registry to these chang...
...; ... in lines 42-58, registerchrome is called as many times as there are different directories that contain content that needs to be registered with the chrome registry. note that in the first few lines of this process, new content from the xpi is being registered, and in the remainder, it is new skin information. in this most common form of the registerchrome function (it can also be used to support the now-deprecatedmanifest.rdf style of installation archive), the three parameters represent, in order, the chrome switch used to indicate what kind of software is being registered, the target destination of the software (e.g., the "chrome" folder in the example above), and the path within the xpi (or jar theme archive) where the contents.rdf file is located. see registerchrome in the xpins...
Deprecated and defunct markup - Archive of obsolete content
help anyone who comes across them in old code or documentation. ...
...(like <textbox>) <thumb> (<button> with deprecated <gripper>; implements sliding box in center of scrolbar) <title> (to add a caption on a <titledbox> <titledbox> (box with a frame) <titledbutton> (attempt to combine text and images before <button>) <toolbarpaletteitem> required to embed non-buttons in customisable toolbars --neil 03 march 2011 <treebody> (old/experimental and unsupported xul tags) lives on as the internal name for the ancestor <treechildren> element --neil 03 march 2011 <treecaption> (old/experimental and unsupported xul tags) <treecolgroup> (former name for <treecols> <treecolpicker> (internal use only; part of xbl for <tree>) <treefoot> (old/experimental and unsupported xul tags) <treeindentation> (old/experimental and unsupported xul tags)...
...supported xul tags) <treecolgroup> (former name for <treecols> <treecolpicker> (internal use only; part of xbl for <tree>) <treefoot> (old/experimental and unsupported xul tags) <treeindentation> (old/experimental and unsupported xul tags) was a part of the old <tree> that predated <outliner> that was not converted to <listbox>--neil 03 march 2011 <treeicon> (old/experimental and unsupported xul tags) <treerows> (internal use only; part of xbl for <tree>) attributes @debug="true" provided struts and springs around boxes to facilitate identification of flex issues but does not seem to work now you need a special debug_layout build --neil 03 march 2011 references xul element reference by neal deakin rapid application development with mozilla, by nigel mcfarlane ...
Working With Directories - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). ...
...the first line below with retrieve the directory corresponding to the user's home directory, while the second will retrieve the directory 'myfiles' on the desktop. ...
... unavailable nsiscriptableio 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 nsiscriptableio.getfile(). you can access a subdirectory by supplying a directory name as the second argument, or refer to one of the special directories by supplying a null string for the second argument. the first line below with retrieve the directory corresponding to the user's home directory, while the second will retrieve the directory 'myfiles' on the desktop. var dir1 = io.getfile("home", ""); var dir2 = io.getfile("desktop", "myfiles"); to refer to a subdirectory, rather than using a path, use nsifile.append() to build up a path. for instance: ...
Building Trees - Archive of obsolete content
rather than generate content for every row in the tree, the results are stored in a list inside the builder. this means that dom nodes are not constructed for any of the items. ...
...treeitem uri="?"> <treerow> <treecell label="?subject"/> <treecell label="?sender"/> <treecell label="?date"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> features of the tree builder besides the label of a cell, there are several other cell properties you can set when using the tree builder. the supported properties are: label, mode, properties, src and value. the label attribute is used to set the label for a cell. the mode is used for progress meter columns. it may be set to either “normal” for a normal progress meter or “undetermined” for an undetermined progress meter. the value attribute is used to set the current progress value for normal progress meters. the value attribute ma...
... row to 150 pixels. you may want to change the syntax to refer to a specific treechildren element rather than all of them. once the row height is changed, we can see the full photos. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). using tree properties since we need to use special css for trees, the properties attribute on a cell becomes extremely useful. it can be used to define extra properties for reference later in a stylesheet. for example, if the properties attribute was set to the value "?creator", you could style the photos c...
Introduction - Archive of obsolete content
bar or pop up menus tabbed dialogs trees for hierarchical or tabular information keyboard shortcuts the displayed content can be created from the contents of a xul file or with data from a datasource. in mozilla, such datasources include a user's mailbox, their bookmarks and search results. the contents of menus, trees and other elements can be populated with this data, or with your own data supplied in an rdf file. there are several ways you can use xul: firefox extension an extension adds functionality to the browser itself, often in the form of extra toolbars, context menus, or customizations to the browser's user interface. this is done using a feature of xul called an overlay, which allows the ui provided from one source, in this case, the firefox browser, to be merged together...
...red in lowercase as xml is case-sensitive (unlike html). attribute values in xul must be placed inside quotes, even if they are numbers. xul files are usually split into four files, one each for the layout and elements, for style declarations, for entity declarations (used for localization) and for scripts. in addition, you may have extra files for images or for platform specific data. xul is supported in mozilla and browsers that are also based upon on the gecko engine, such as netscape 6 or later and mozilla firefox. due to various changes in xul syntax over time, you will want to get the latest version for the examples to work properly. xul is fairly similar in firefox and to other browsers, although it has some specific differences such as support for customizable toolbars. this tuto...
...to get the latest version for the examples to work properly. xul is fairly similar in firefox and to other browsers, although it has some specific differences such as support for customizable toolbars. this tutorial attempts to cover much of xul's functionality, however, not all features are discussed. once you are familiar with xul, you can use the xul reference to find out about other features supported by specific elements. next » ...
Property Files - Archive of obsolete content
the property file. the function getstring() returns the value of the string or null if the string does not exist. finally, the string is displayed in an alert box. text formatting the next method is getformattedstring(). this method also gets a string with the given key name from the bundle. in addition, each occurrence of formatting code (e.g. %s) is replaced by each successive element in the supplied array. var dir = "/usr/local/document"; var count = 10; var strbundle = document.getelementbyid("strings"); var result = strbundle.getformattedstring("resultmessage", [ dir, count ]); alert(result); this example will display following message in an alert box. 10 files found in the /usr/local/document directory. you will notice the formatting codes %1$s and %2$s is used, and replaced diff...
...(to get something like "50% off" returned), escape the percentage character with another percentage character, like this: my.percentage.string = %s%% off not escaping the percentage character will generate an incorrect string that strips the space character between the percentage character and the next word of the string ("50%off"). non-ascii characters, utf-8 and escaping gecko 1.8.x (or later) supports property files encoded in utf-8. you can and should write non-ascii characters directly without escape sequences, and save the file as utf-8 without bom. double-check the save options of your text editor, because many don't do this by default. see localizing extension descriptions for more details. in some cases, it may be useful or needed to use escape sequences to express some characters. ...
...files encoded in utf-8. you can and should write non-ascii characters directly without escape sequences, and save the file as utf-8 without bom. double-check the save options of your text editor, because many don't do this by default. see localizing extension descriptions for more details. in some cases, it may be useful or needed to use escape sequences to express some characters. property files support escape sequences of the form: \uxxxx , where xxxx is a unicode character code. for example, to put a space at the beginning or end of a string (which would normally be stripped by the properties file parser), use \u0020 . in the next section, we will look at xbl, which can be used to define the behavior of an element. « previousnext » see also how to localize html pages, xul file...
XPCOM Interfaces - Archive of obsolete content
do the following: var sound = components.classes["@mozilla.org/sound;1"].createinstance(); if (sound) sound.queryinterface(components.interfaces.nsisound); xpcom interfaces can inherit from other interfaces. the interfaces that inherit from others have their own functions and the functions of all the interfaces that they inherit from. all interfaces inherit from a top-level interface called nsisupports. it has one function supplied to javascript, queryinterface(), which we have already seen. because the interface nsisupports is implemented by all components, the function queryinterface() function is available in every component. several components may implement the same interface. typically, they might be subclasses of the original but not necessarily. any component may implement the func...
...th of these lines together: var alocalfile = components.classes["@mozilla.org/file/local;1"].createinstance(components.interfaces.nsilocalfile); this will do the same thing as the two lines but in one line of code. it eliminates the need to create the instance and then query it for an interface in two separate steps. ...
...l;1"].createinstance(components.interfaces.nsilocalfile); this will do the same thing as the two lines but in one line of code. it eliminates the need to create the instance and then query it for an interface in two separate steps. if you call queryinterface() on an object and the requested interface is not supported by an object, an exception is thrown. if you're not sure that an interface is supported by a component, you can use the instanceof operator to check: var afile = components.classes["@mozilla.org/file/local;1"].createinstance(); if (afile instanceof components.interfaces.nsilocalfile){ // do something } the instanceof operator returns true if afile implements the nsilocalfile interface. this also has the side effect of calling queryinterface(), so afile will be a valid nsi...
XUL accessibility guidelines - Archive of obsolete content
ssibility channel for general discussion around internet accessibility with logger. useful at conferences. apple accessibility. portal to apple accessibility. lars (linux accessibility resource site). portal for general linux accessibility. microsoft accessibility. portal for microsoft accessibility. accessibility - mdc. accessibility hub on the mozilla developer center. mozilla.support.accessibility. mozilla accessibility newsgroup. #accessibility. accessibility channel on mozilla's irc server. guidelines keyboard access keyboard access is important to users who can't use a mouse. many screen reader users and those with physical disabilities rely on the keyboard as their primary input tool. these users require easy, predictable, and well-documented keyboard con...
...r interaction ensure that help documentation is up to date. verify that alerts are displayed through appropriate xul elements. ensure the user is informed of any user based errors and that instruction and opportunity for reperforming error causing actions is allowed. ensure that users have control of response time. media audio informative audio files such as podcasts can be made accessible by supplying a word-for-word transcript. transcripts should identify the speakers and describe other relevant sounds such as laughing or singing. transcripts can be time consuming to generate, but is the only way to make audio content accessible. video a video file can be made accessible by adding synchronized captions. most media delivery formats provide a means for displaying captions. video should ...
...ation and is warned about flashing content. no control over animation or warnings about flashing exist. other checkpoint pass fail custom widgets custom widgets provide accessible functionality. custom widgets are inaccessible. further references the official w3c accessibility guidelines, soon to be released: 2.0 and techniques for 2.0 which will supercede 1.0. these include language-neutral guidelines and also refer to techniques for xhtml, which is relevant for xul, as html can also be included inside of xul by use of the xhtml namespace. ...
arrowscrollbox - Archive of obsolete content
element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. smoothscroll type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controlle...
...ts you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked. smoothscroll type: boolean can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox. if not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoothscroll preference. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer gets and sets the value of the tabindex attribute. methods ensureelementisvisible( element ) return type: no return value if the specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. scrollbyind...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
ing the button's type attribute so that when the button is pressed, the panel will be displayed. a panel may also be opened via a script using the openpopup method. the panel is closed when the user clicks outside the panel, presses escape or when the panel's hidepopup method is called. warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported. some features may work, but only on some platforms. for those versions of firefox, it is best to avoid child frames in a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, pos...
... ...
...nd y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location. anchor the popup may be either anchored to another node or opened freely. to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: bef...
preferences - Archive of obsolete content
<preferences> element should contain one or more <preference> elements. note: it's not clear which of the following methods and properties are public. examples <preferences> <preference id="pref_one" name="extensions.myextension.one" type="bool"/> <preference id="pref_two" name="extensions.myextension.two" type="string"/> ... etc ... ...
... , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element. also executes code specified in onchanged attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientr...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related preferences system documentation: introduction: getting started | examples | tro...
toolbox - Archive of obsolete content
pe of box but defaults to vertical orientation. if a toolbar is placed inside a toolbox, a grippy is displayed on its left or upper edge. the user may click the grippy to collapse the toolbar. if multiple toolbars are placed in the same toolbox, they will all collapse into the same row. the firefox browser does not have grippies so toolbars cannot be collapsed and expanded. note: gecko 2.0 adds support for external toolbars. these are toolbars that are not children of a toolbox. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externaltoolbars property. more information is available in ...
..., focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom too...
...lize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name. you can supply a comma-separated list of toolbar item ids as the second argument to add some items by default. the method returns the dom element for the created toolbar. collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox. expandtoolbar( toolbar ) not in firefox return type: no return value expand the give...
Dialogs in XULRunner - Archive of obsolete content
you can use in a dialog. in the future, i will try to go into more detail on some of the existing and planned xul input controls. not too sure if i’ll use the <dialogheader>, but if i did, the single element would be a big time saver over building the header from scratch. common dialogs some of the most frequently used common dialogs are for opening and saving files. for instance, windows has supported built-in file open and file save dialogs for many years, and the macintosh has always had them. it makes creating an application easier for developers; in addition, the consistent user experience also makes applications easier to use. xul supports native implementations of filepickers (mozilla terminology for file open and save dialogs). newer releases will allow using preferences to switch...
... future articles in this series will look at input controls, printing, the clipboard, and xpcom. see also dialog xul tutorial:creating dialogs nsifilepicker xul...
...le", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filtertext | nsifilepicker.filterall); var res = fp.show(); if (res == nsifilepicker.returnok) { var thefile = fp.file; alert(thefile.leafname); // --- do something with the file here --- } } xul does not currently support any other common dialogs. that could change in future releases. firefox and thunderbird both support nearly native page setup and print dialogs. however, xul does support elements to make creating wizards a simple task as well. future articles in this series will look at input controls, printing, the clipboard, and xpcom. see also dialog xul tutorial:creating dialogs nsifilepicker xul tutorial:open and save dialogs « previous original document information author: mark f...
XULRunner Hall of Fame - Archive of obsolete content
see also featured mozilla-based applications, many of which use xulrunner. xulrunner 5+ based applications these applications use xulrunner 5 or greater. azardi free win/mac/linux epub 2/epub 3 desktop reader using html5 and latest css features of gecko for interactive e-books. version updates match the rapid release cycle. now available with xulrunner 30 with i18n support. mathml support is significant. includes smil audio overlays and idpf fixed layout. celtx all-in-one media pre-production software. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly programmable web browser with a leopard-oriented design inspired by emacs. source evergreen - staff client evergreen is an open source library system. source...
...r 1.9 or earlier buzzbird xul-based desktop twitter client. github bluegriffon the next-generation web editor based on the rendering engine of firefox. build instructions convertigo enterprise mashup server a web integrator and web clipper tool to build enterprise mashups nightingale nightingale is a communtiy fork of the songbird media player, bringing back linux support and much more. build instructions kirix strata a new specialty browser for accessing and manipulating data from the web telekast an open source teleprompter and script editor. source tomtom home 2 pc application to manage tomtom gps devices understanding faith (desktop version) a multimedia religious education resource for catholic secondary schools in australi...
...or earlier. abstract an accounting package with breakthrough level of automation. latest release: 0.0.2 november 2010 - source clines a clone of color lines (game). latest release: 1.2 november 2008 - source cocoapsyc.app a psyc im/chat client for mac os x (also available as a firefox extension). latest release 0.5 febuary 2010 - source daim (fr) / daim (english) superb tool for image analysis build on top of a professional imagelib. echofon for windows a twitter client. emusic remote the emusic remote makes downloading from emusic a snap. latest release: 1.0.0.2 march 2009 - source findthatfont! font managing tool for windows and linux, that helps you find the font you're looking for. latest release december 2007 flickr uploadr 3.
2006-12-01 - Archive of obsolete content
announcements introducing rhinoloader a byproduct of helma that extends java applications with rhino/js. it is basically a java classloader that creates classes from javascript files. server side spidermonkey juicescript is an open source version of a server side javascript. it supports a apache2 module and stand alone version. http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it. peter wilson's reply was to add a method that does the deleting with a native implementation that releases the resources held by the object as seen in this database interface: var mydbase = new pgsqlconnection; mydbase.connect("database"); mydbase.exec("select * f...
... http://www.whitebeam.org is an example of open source server side javascript. ...
...entation function) mydbase.close() spidermonkey for server side inquiry about why javascript hasn't caught on for general server-side scripting. peter wilson lists some important comparisons between spidermonkey and php. he states that javascript is powerful server-side scripting but it lacks in popularity since its only supported by netscape, lacks a wide range of libraries, minimal marketing support. http://www.whitebeam.org is an example of open source server side javascript. ...
Adobe Flash - Archive of obsolete content
ssary flash content is crucial to ensuring the user has a positive experience on not just your site, but the entire web. as part of mozilla's effort to improve the user experience, a feature was added in firefox 49 that automatically blocks certain flash modules that have little or no user-noticeable impact from being used. these block-listed modules include various fingerprinting and http_cookie#supercookie modules. in the future, other modules may be blocked as well. and, of course, eventually flash support will be removed from firefox entirely. most of its functions can be reproduced using modern web apis. using the right html the object element or the embed element can be used to invoke plugins in netscape gecko browsers. the former is part of the w3c html 4 standard, whereas the latter...
...flash animation affects something in the html page that contains the flash animation. example 3 shows fscommands in action. if you are embedding a flash animation and wish to use fscommands in netscape gecko browsers, currently you must use the embed element and not the object element. you can always nest the embed element within the object element that you serve to ie. future flash versions may support the object element for use with fscommands in netscape gecko browsers. this issue is being tracked in mozilla's bug 184722. the background color of the entire page is toggled by clicking on a color within the flash animation. clicking on the animation makes a callback to the external environment that hosts the plugin (the html page) and looks for a javascript method to handle the call from w...
...></param> <embed src="js2flash.swf" width="250" height="150" swliveconnect="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="myflash"> </embed> </object> ..... function myflash_dofscommand(command, args) { // handle any callback logic that you may have designed into your flash plugin // the flash animation will supply you with the values for command and args // this is a function that handles any information that the flash animation may pass it // actionscript can communicate with javascript via fscommands! } in the above code listing, the javascript function handles what flash sends it, and is named the same as the embed element's name attribute, concatenated with "_dofscommand". the source listing fla...
The First Install Problem - Archive of obsolete content
ns seems unavoidable. this document presents windows solutions for plugin vendors. the solution suggests that plugin vendors ought to leave dlls on a windows desktop whether or not a netscape gecko browser is detected, and then write keys in the windows registry giving future netscape gecko browsers the path where the plugin resides and meta-information about how to load the plugin. this document supplements the key parsing methodology suggested for installers. the solution is to encourage plugin vendors to write registry keys to the win32 system registry, like the example application. this document proposes a meta-information model in the win32 registry similar to the one used by microsoft's hkey_classes_root\clsid\ where a new activex control (ocx) on the system presents its uuid as a regis...
...e mimetype description that apears when you type "about:plugins" as a url in mozilla's location bar. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] description=myapplication plugin for app files "suffixes" -- this will be a semi-colon concatenated list of supported suffixes. this information is also stored under the suffixes subkey (see below), but that key doesn't link suffixes to a particular mimetype. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] suffixes=app suffixes -- a sub...
...ut that key doesn't link suffixes to a particular mimetype. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\mimetypes\application/x-myapp] suffixes=app suffixes -- a subkey containing string values (reg_sz) representing all the suffixes (3 digit extensions) supported by this module. example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\suffixes] inside this subkey, string values might look like: app typ avi note that these string values (reg_sz) don't actually have values affiliated with them. "description" -- string value describing t...
TCP/IP Security - Archive of obsolete content
based version of ssl version 3. more information on tls is available in rfc 4346, the tls protocol version 1.1, available at https://www.ietf.org/rfc/rfc4346.txt. another good source of information is nist sp 800-52, guidelines on the selection and use of transport layer security, available from https://csrc.nist.gov/publications/nistpubs/.) the use of tls typically requires each application to support tls; however, unlike application layer controls, which typically involve extensive customization of the application, transport layer controls such as tls are much less intrusive because they do not need to understand the application’s functions or characteristics. although using tls may require modifying some applications, tls is a well-tested protocol that has several implementations that...
...rs; data link layer controls for other types of connections, such as dial-up modem communications, are usually provided through software. because the data link layer is below the network layer, controls at this layer can protect both data and ip information. compared to controls at the other layers, data link layer controls are relatively simple, which makes them easier to implement; also, they support other network layer protocols besides ip. because data link layer controls are specific to a particular physical link, they cannot protect connections with multiple links, such as establishing a vpn over the internet. an internet-based connection is typically composed of several physical links chained together; protecting such a connection with data link layer controls would require deployi...
...nsport layer protocols such as ssl are most commonly used to provide security for communications with individual http-based applications, although they are also used to provide protection for communication sessions of other types of applications such as smtp, point of presence (pop), internet message access protocol (imap), and file transfer protocol (ftp). because all major web browsers include support for tls, users who wish to use web-based applications that are protected by tls normally do not need to install any client software or reconfigure their systems. newer applications of transport layer security protocols protect both http and non-http application communications, including client/server applications and other network traffic. controls at each layer offer advantages and feature...
Theme changes in Firefox 2 - Archive of obsolete content
ss new file; css used in the application's about box. global/alltabs-box-bkgnd.png new file; the background for the "all tabs" drop-down menu at the right side of the tab bar. global/alltabs-box-overflow-bkgnd.png new file; the background for the "all tabs" drop-down menu when there are enough tabs to activate tab bar scrolling. global/browser.css revised to support new styles for the main browser window. global/globalbindings.xml updated to support changes to the tab bar, including per-tab close buttons. global/icons/alltabs.png not actually used; left over from earlier drafts of the theme. global/inactivetab-left.png removed file. global/inactivetab-right.png removed file. global/menu.css upda...
... global/tabbrowser-tabs-bkgnd.png new file; the background for the tab bar, displayed behind all tabs. global/toolbar.css needs to be updated to include new styles. mozapps/extensions/about.css updated with a simplified set of style names, since several styles were identical. mozapps/extensions/extensions.css css for the add-ons manager window. updated to support the new features of the firefox 2 add-ons manager. mozapps/extensions/itemdisabledfader.png new file; a translucent png used as an overlay on top of items that are disabled in the add-ons manager. mozapps/extensions/itemenabledfader.png new file; a translucent png used as an overlay on top of items that are enabled in the add-ons manager. mozapps/extensions/no...
...n .button-icon .feedsubscribelink .feedsubscribelinkbox .field .link .link:hover:active .plain .plain > .button-box .plain:focus > .button-box .stylelessborderless the default theme also includes styles for a[href] img, body, h1, h2, and html. safebrowser/browser-protection.css this file, new to firefox 2, skins browser protection features. ...
-ms-filter - Archive of obsolete content
color> | <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. ...
...<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. endcolor the end color, supports only opaque colors in the #rrggbb notation. ...
...he end color, supports only opaque colors in the #rrggbb notation. endcolorstr the end color, supports both opaque colors (#rrggbb) and colors with alpha opacity using the #aarrggbb notation. gradienttype default: 0 (equivalent to linear-gradient(to bottom, …)) set to a non-zero value to make the gradient horizontal (equivalent to linear-gradient(to right, …)) startcolor the end color, supports only opaque colors in the #rrggbb notation. startcolorstr the end color, supports both opaque colors (#rrggbb) and colors with alpha opacity using the #aarrggbb notation. html <div class="gradient horizontal"></div> <div class="gradient vertical"></div> css html, body { overflow-x: hidden; max-width: 100vw; } .gradient { width: 100vw; height: 60px; height: 50vh; } .grad...
:-moz-system-metric(windows-default-theme) - Archive of obsolete content
y (e.g. to xul / chrome code). see bug 1396066 for more details. example html content <p id="defaultthemes"> this paragraph should have a green background with luna/royale/zune/aero windows themes and red with other themes. </p> <p id="nondefaultthemes"> this paragraph should have a green background with windows classic or third-party themes and red with other themes. ...
... bug 1396066 for more details. example html content <p id="defaultthemes"> this paragraph should have a green background with luna/royale/zune/aero windows themes and red with other themes. </p> <p id="nondefaultthemes"> this paragraph should have a green background with windows classic or third-party themes and red with other themes. ...
...classic or third-party themes and red with other themes. </p> <p id="notsupported">theme detection is not supported.</p> css content #defaultthemes, #nondefaultthemes { background-color: #ffa0a0; } #defaultthemes:-moz-system-metric(windows-default-theme) { background-color: #a0ffa0; } #nondefaultthemes:not(-moz-system-metric(windows-default-theme)) { background-color: #a0ffa0; } #notsupported:-moz-system-metric(windows-default-theme), #notsupported:not(:-moz-system-metric(windows-default-theme)) { display: none; } specifications not part of any specification. ...
ActiveXObject - Archive of obsolete content
the activexobject object enables and returns a reference to an automation object. this object is used only to instantiate automation objects, and has no members. syntax let newobj = new activexobject(servername.typename[, location]) parameters servername the name of the application providing the object. typename the type or class of the object to create. location optional the name of the network server where the object is to be created. remarks automation servers provide at least one type of object. ...
...eet.cells collection. // make excel visible through the application object. excelsheet.application.visible = true; // place some text in the first cell of the sheet. excelsheet.activesheet.cells(1,1).value = "this is column a, row 1"; // save the sheet. excelsheet.saveas("c:\\test.xls"); // close excel with the quit method on the application object. ...
... the sheet. excelsheet.saveas("c:\\test.xls"); // close excel with the quit method on the application object. excelsheet.application.quit(); 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. not supported in windows 8.x store apps. note: creating an activexobject on a remote server is not supported in internet explorer 9 standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows store apps or later. ...
Enumerator.atEnd - Archive of obsolete content
the enumerator.atend method returns a boolean value indicating if the enumerator is at the end of the collection. syntax myenum.atend() remarks the required myenum reference is any enumerator object. the atend method returns true if the current item is the last one in the collection, the collection is empty, or the current item is undefined. otherwise, it returns false. ...
... applies to: enumerator object ...
... applies to: enumerator object ...
Enumerator.item - Archive of obsolete content
the enumerator.item method returns the current item in the collection. syntax enumobj.item() remarks the required enumobj reference is any enumerator object. the item method returns the current item. if the collection is empty or the current item is undefined, it returns undefined. ...
... applies to: enumerator object ...
... applies to: enumerator object ...
Enumerator.moveFirst - Archive of obsolete content
the enumerator.movefirst method resets the current item in the collection to the first item. syntax enumobj.movefirst( ) remarks the required enumobj reference is any enumerator object. if there are no items in the collection, the current item is set to undefined. ...
... applies to: enumerator object ...
... applies to: enumerator object ...
Enumerator.moveNext - Archive of obsolete content
the enumerator.movenext method moves the current item to the next item in the collection. syntax enumobj.movenext( ) remarks the required enumobj reference is any enumerator object. if the enumerator is at the end of the collection or the collection is empty, the current item is set to undefined. ...
... applies to: enumerator object ...
... applies to: enumerator object ...
VBArray.dimensions - Archive of obsolete content
the vbarray.dimensions method returns the number of dimensions in a vbarray. syntax array.dimensions( ) remarks the required array is a vbarray object. example the dimensions method provides a way to retrieve the number of dimensions in a specified vbarray. the following example consists of three parts. the first part is vbscript code to create a visual basic safe array. the second part is javascript code that determines the number of dimensions in the safe array and the upper bound of each dimension. both of these parts go into the <head> section of an html page. ...
... applies to: vbarray object ...
... applies to: vbarray object ...
VBArray.getItem - Archive of obsolete content
the vbarray.getitem method returns the item at the specified location. syntax safearray.getitem(dimension1[, dimension2, ...], dimensionn) parameters safearray a vbarray object. dimension1, ..., dimensionn specifies the exact location of the desired element of the vbarray. n equals the number of dimensions in the vbarray. example the following example consists of three parts. the first part is vbscript code to create a visual basic safe array. the second part is javascript code that iterates the visual basic safe array and prints out the contents of each element. ...
...see version information. applies to: vbarray object ...
...see version information. applies to: vbarray object ...
VBArray.lbound - Archive of obsolete content
the vbarray.lbound method returns the lowest index value used in the specified dimension of a vbarray. syntax safearray.lbound(dimension) remarks if the vbarray is empty, the lbound method returns undefined. if dimension is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error. parameters safearray a vbarray object. dimension optional optional. the dimension of the vbarray for which the lower bound index is wanted. if omitted, lbound behaves as if a 1 was passed. example the following example consists of three parts. ...
... applies to: vbarray object ...
... applies to: vbarray object ...
VBArray.toArray - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the vbarray.toarray method returns a standard javascript array converted from a vbarray. syntax safearray.toarray( ) remarks the required safearray reference is a vbarray object. the conversion translates the multidimensional vbarray into a single dimensional javascript array. each successive dimension is appended to the end of the previous one. for example, a vbarray with three dimensions and three elements in each dimension is converted into a javascript array as follows: suppose the vbarray contains: (1, 2, 3), (4, 5, 6), (7, 8, 9). after translation, the javascript array contains: 1, 2, 3, 4, 5, 6, 7, 8, 9. there is currently no way to convert a javascript array into a vbarr...
... applies to: vbarray object ...
... applies to: vbarray object ...
VBArray.ubound - Archive of obsolete content
the vbarray.ubound method returns the highest index value used in the specified dimension of the vbarray. syntax safearray.ubound(dimension) parameters safearray a vbarray object. dimension optional the dimension of the vbarray for which the higher bound index is wanted. if omitted, ubound behaves as if a 1 was passed. remarks if the vbarray is empty, the ubound method returns undefined. if dim is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error. example the following example consists of three parts. ...
... applies to: vbarray object ...
... applies to: vbarray object ...
@cc_on - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps. conditional compilation is supported in internet explorer 10 standards mode and in all earlier versions. the @cc_on statement activates conditional compilation support within comments in a script. syntax @cc_on remarks the @cc_on statement activates conditional compilation within comments in a script. it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always put conditional compilation code in comments. ...
...activates conditional compilation within comments in a script. it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always put conditional compilation code in comments. this enables hosts that do not support conditional compilation to ignore it. it is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will accept your script as valid syntax: an @if or @set statement outside of a comment also activates conditional compilation. example the following example illustrates the use of the @cc_on statement. /*@cc_on @*/ /...
... ...
@if - Archive of obsolete content
the @if statement conditionally executes a group of statements, depending on the value of an expression. syntax @if ( condition1 ) text1 [@elif ( condition2 ) text2] [@else text3] @end parameters text1 optional text to be parsed if condition1 is true. text2 optional text to be parsed if condition1 is false and condition2 is true. text3 optional text to be parsed if both condition1 and condition2 are false. ...
...among several options should be used for text output. it is not common to use conditional compilation variables in scripts written for asp or asp.net pages or command-line programs. this is because the capabilities of the compilers can be determined by using other methods. when you write a script for a web page, always add conditional compilation code in comments. this enables hosts that do not support conditional compilation to ignore it. example the following example illustrates the use of the @if...@elif...@else...@end statement. /*@cc_on @*/ /*@ document.write("javascript version: " + @_jscript_version + "."); document.write("<br />"); @if (@_win32) document.write("running on a 32-bit version of windows."); @elif (@_win16) document.write("running on a ...
...nt. /*@cc_on @*/ /*@ document.write("javascript version: " + @_jscript_version + "."); document.write("<br />"); @if (@_win32) document.write("running on a 32-bit version of windows."); @elif (@_win16) document.write("running on a 16-bit version of windows."); @else document.write("running on a different operating system."); @end @*/ requirements supported in all versions of internet explorer, but not in windows 8.x store apps. ...
Reference - Archive of obsolete content
er possible; language="javascript1.x" tags will always use the current version now, i.e. js 1.6. so while the examples do show what js 1.2 does, they incorrectly indicate that it's possible to switch to the 1.2 engine. --maian 05:41, 22 september 2005 (pdt) this is true. the wording should be changed with the javascript 1.x examples, as well as refer to the versions in the past tense. i also support the use of a deprecated pre box with these examples. since it's been 9 months since the last comment on this, i think i'll go ahead and change all of the examples. if anyone disagrees, you can always revert. sevenspade 13:19, 2 july 2006 (pdt) after some thought, i removed the references to using language="javascript1.2", and all references are merely presented as information detailing ...
..., javascript 2.0, javascript xxxxii.1, etc. comes out ? make a footnote on each page, pointing to a page listing "hot new javascript features", which in turn points to 1 page for 1.6, 1 page for 1.7, etc., listing all the differences from one version to the next ? this would be the simplest thing for us to write. but someone trying write some javascript 2.0, wanting a list of all the features it supports, might be annoyed at having to read through *all* the updates. make a footnote on each page, pointing to a page listing "hot new javascript features", which lists all the differences between the current latest version, and the documented 1.5 version ? (every time a new version comes out, a few more things are added to that page). none of those options appeal to me. what is the right way to...
...anuary 2007 (pst) why distinguish global objects from global properties from global functions? why do we distinguish global objects from global properties from global functions? it seems like "global object" and "global property" are synonyms, and all global functions are global objects/properties. is there something i'm missing? ruakh 20:31, 26 february 2007 (pst) this was something that was supposed to be fixed in the reorganization, which has still yet to occur. sevenspade 22:34, 26 february 2007 (pst) since it doesn't look like the reorganization is going to happen in the very near future, is there any reason i shouldn't take care of this now? ruakh 14:40, 27 february 2007 (pst) please don't start making large changes without getting an ok from dev-mdc. what did you have in mind?
XForms Secret Element - Archive of obsolete content
the default value is false. type restrictions the secret element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. ...
...the default value is false. type restrictions the secret element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. ...
...the default value is false. type restrictions the secret element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. ...
XForms Select Element - Archive of obsolete content
introduction allows the user to choose one or more selections from a list of pre-defined items (see the spec). the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements. you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. this attribute, when set to 'open', allows the user to provide free en...
...hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed. incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of holding a sequence. the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from a...
...ted if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group the select is represented as group of checkboxes (xhtml/xul). ...
XForms Textarea Element - Archive of obsolete content
the default value is false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the xforms textarea element is represented by a multiline text field (xhtml/xul). ...
...the default value is false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the xforms textarea element is represented by a multiline text field (xhtml/xul). ...
...the default value is false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the xforms textarea element is represented by a multiline text field (xhtml/xul). ...
XQuery - Archive of obsolete content
xquery is a w3c standard language which is meant to be for xml what sql is for relational data--i.e., the ability to search, sort, extract, and remold data. it offers powerful and yet intuitive searching based on xpath, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc. while xquery is currently not supported in firefox (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows on...
...ich allows one to perform xqueries on external urls, the currently loaded webpage (even if originally from poorly formed html), and/or xml (including well-formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). ...
...ginally from poorly formed html), and/or xml (including well-formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besides its also being open source), but now some problems may exist with bdbxml (unlike saxon). a simple usage example is available. notes for developers wishing t...
Index - Game development
ss, canvas, games, javascript, webgl, image-rendering, pixel this article discusses a useful technique for giving your canvas/webgl games a crisp pixel art look, even on high definition monitors. 28 efficient animation for web games animation, games, javascript this article covers techniques and advice for creating efficient animation for web games, with a slant towards supporting lower end devices such as mobile phones. we touch on css transitions and css animations, and javascript loops involving window.requestanimationframe. 29 implementing controls using the gamepad api controls, gamepad api, gamepads, games, javascript, controllers the gamepad api is very easy to develop with. now it's easier than ever to deliver a console-like experience t...
...eyboard, mouse ok, we've dealt with touch, keyboard and mouse controls. now let's move on to look at how to set up the game to be controlled using a console gamepad, using the gamepad api. 33 mobile touch controls controls, games, javascript, mobile, pointer, touch that covers adding touch controls for mobile; in the next article we'll see how to add keyboard and mouse support. 34 unconventional controls controls, doppler, games, javascript, makey makey, proximity, tv leap motion, voice i hope you liked the experiments — if you have any others that you think might interest other people, feel free to add details of them here. 35 tiles and tilemaps overview 2d, canvas, games, javascript, static, webgl, tilemap, tiles tilema...
... square tilemaps implementation: static maps canvas, games, javascript, static, atlas, spritesheet, tilemap, tilemaps, tiles this article covers how to implement static square tilemaps using the canvas api. 38 webrtc data channels api, games, needscontent, network, p2p, webrtc, data channels the webrtc (web real-time communications) api is primarily known for its support for audio and video communications; however, it also offers peer-to-peer data channels. this article explains more about this, and shows you how to use libraries to implement data channels in your game. 39 tools for game development games, gecko, guide, javascript on this page you can find links to our game development tools articles, which eventually aims to cover framew...
WebVR — Virtual Reality for the Web - Game development
use in games. vr devices with the popularity of oculus rift and a lot of other devices in production coming soon to the market, the future looks bright — we already have sufficient technology to make the vr experience "good enough" for playing games. there are many devices to chose from: desktop ones like oculus rift or htc vive, through consoles with playstation vr (which admittedly doesn't support webvr at this time), to mobile experiences like gear vr or google cardboard. note: for more information, read our webvr concepts article. the webvr api the webvr api is the central api for capturing information on vr devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and othe...
...rmation on vr devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and other applications. note: there are of course other apis useful for creating games, for example the gamepad api for control inputs, and the device orientation api for handling display orientation on mobile. browser support and spec status currently browser support for the webvr api is still experimental — it works in nightly builds of firefox and experimental builds of chrome (mozilla and google teamed up to work on the implementation together), but sooner rather than later we'll see it in regular builds. the webvr spec is in editor's draft status which means it is still subject to change. the development i...
...you're "inside" the experience. it's not easy to achieve, but it doesn't require realistic images. quite the contrary as having a basic shapes flying around in high framerate can make a lot. remember: experimenting is key - see what works for your game in particular. the future of webvr it's happening — consumer devices are reaching the market right now, and we already have javascript apis to support them on the web. all we need now is a stable specification, good ux and ui, better hardware and more tools and libraries — and all of that is on the horizon. it's the perfect time to dive in and experiment with webvr. ...
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
client hints are a set of http request header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. ...
... client hints are a set of http request header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences. client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution. use of client hints isn't automatic: rather, servers must announce that they support client hints. ...
...for example, based on accept-ch example above, the client could append dpr, width, viewport-width, and downlink headers to all subsequent requests. in the second example, the server gives the browser the hints by setting the accept-ch meta tag. ...
Mobile accessibility - Learn web development
pecific accessibility considerations. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, and an understanding of the previous articles in the course. objective: to understand what problems exist with accessibility on mobile devices, and how to overcome them. accessibility on mobile devices the state of accessibility — and support for web standards in general — is good in modern mobile devices. long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). these days, mobile devices...
...e browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). these days, mobile devices can usually handle fully-featured websites, and the main platforms even have screenreaders built in to enable visually impaired users to use them successfully. modern mobile browsers tend to have good support for wai-aria, too. to make a website accessible and usable on mobile, you just need to follow general good web design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control mechanisms — make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops...
...ng responsive image techniques. thinking about high resolutions. many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. again, you can serve images as appropriate using responsive image techniques. in addition, many image requirements can be fulfilled using the svg vector images format, which is well-supported across browsers today. svg has a small file size and will stay sharp regardless of whatever size is being displayed (see adding vector graphics to the web for more details). note: we won't provide a full discussion of responsive design techniques here, as they are covered in other places around mdn (see above links). specific mobile considerations there are other important issues to ...
Handling different text directions - Learn web development
previous overview: building blocks next many of the properties and values that we have encountered so far in our css learning have been tied to the physical dimensions of our screen. we create borders on the top, right, bottom, and left of a box, for example. these physical dimensions map very neatly to content that is viewed horizontally, and by default the web tends to support left-to-right languages (e.g. english or french) better than right-to-left languages (such as arabic). in recent years however, css has evolved in order to better support different directionality of content, including right-to-left but also top-to-bottom content (such as japanese) — these different directionalities are called writing modes. as you progress in your study and begin to work with layou...
...xt to wrap round the image. you could replace left with inline-start as shown in the example below. change the writing mode on this example to vertical-rl to see what happens to the image. change inline-start to inline-end to change the float. here we are also using logical margin values to ensure the margin is in the correct place no matter what the writing mode is. ...
...if you are not using multiple writing modes then for now you might prefer to use the physical versions. however, ultimately we expect that people will transition to the logical versions for most things, as they make a lot of sense once you start also dealing with layout methods such as flexbox and grid. ...
Introduction to CSS layout - Learn web development
.positioned { background: rgba(255,84,104,.3); border: 2px solid rgb(255,84,104); padding: 10px; margin: 10px; border-radius: 5px; } .positioned { position: sticky; top: 30px; left: 30px; } note: to find more out about positioning, see our positioning article. table layout html tables are fine for displaying tabular data, but many years ago — before even basic css was supported reliably across browsers — web developers used to also use tables for entire web page layouts — putting their headers, footers, different columns, etc. in various table rows and columns. this worked at the time, but it has many problems — table layouts are inflexible, very heavy on markup, difficult to debug, and semantically wrong (e.g., screen reader users have problems navigating t...
...page when you use table markup is due to a set of css properties that define table layout. these properties can be used to lay out elements that are not tables, a use which is sometimes described as "using css tables". the example below shows one such use; using css tables for layout should be considered a legacy method at this point, for those situations where you have very old browsers without support for flexbox or grid. let's look at an example. first, some simple markup that creates an html form. each input element has a label, and we've also included a caption inside a paragraph. each label/input pair is wrapped in a <div>, for layout purposes. <form> <p>first of all, tell us your name and age.</p> <div> <label for="fname">first name:</label> <input type="text" id="fname"...
... summary this article has provided a brief summary of all the layout technologies you should know about. read on for more information on each individual technology! overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Legacy layout methods - Learn web development
ethods from time to time. it is worth understanding how they work, and why they are different to css grid layout. this lesson will explain how grid systems and grid frameworks based on floats and flexbox work. having studied grid layout you will probably be surprised how complicated this all seems! this knowledge will be helpful to you if you need to create fallback code for browsers that do not support newer methods, in addition to allowing you to work on existing projects which use these types of systems. it is worth bearing in mind, as we explore these systems, that none of them actually create a grid in the way that css grid layout creates a grid. they work by giving items a size, and pushing them around to line them up in a way that looks like a grid. a two column layout let's start ...
...l.span9 { width: calc((6.25%*9) + (2.08333333%*8)); } .col.span10 { width: calc((6.25%*10) + (2.08333333%*9)); } .col.span11 { width: calc((6.25%*11) + (2.08333333%*10)); } .col.span12 { width: calc((6.25%*12) + (2.08333333%*11)); } note: you can see our finished version in fluid-grid-calc.html (also see it live). note: if you can't get this to work, it might be because your browser does not support the calc() function, although it is fairly well supported across browsers — as far back as ie9. semantic versus “unsemantic” grid systems adding classes to your markup to define layout means that your content and markup becomes tied to your visual presentation. you will sometimes hear this use of css classes described as being “unsemantic” — describing how the content looks —...
...ated, which will be useful in working with older sites and in understanding the difference between the native grid of css grid layout and these older systems. previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Beginner's guide to media queries - Learn web development
ld be avoided. note: media types are optional; if you do not indicate a media type in your media query then the media query will default to being for all media types. media feature rules after specifying the type, you can then target a media feature with a rule. width and height the feature we tend to detect most often in order to create responsive designs (and that has widespread browser support) is viewport width, and we can apply css if the viewport is above or below a certain width — or an exact width — using the min-width, max-width, and width media features. these features are used to create layouts that respond to different screen sizes. for example, to change the body text color to red if the viewport is exactly 600 pixels, you would use the following media query. @media...
...lor: blue; } } open this example in the browser, or view the source. in practice, using minimum or maximum values is much more useful for responsive design so you will rarely see width or height used alone. there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support. each feature is documented on mdn along with browser support information, and you can find a full list at using media queries: media features. orientation one well-supported media feature is orientation, which allows us to test for portrait or landscape mode. to change the body text color if the device is in landscape orientation, use the following media query. @media (orientation: landsc...
...y to make the components responsive. ...
JavaScript performance - Learn web development
battery. it can make the ui feel unresponsive or janky. we'll introduce concepts for handling that as well. download impact web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing, tracking pixels, and features like maps and support features. all of this javascript must be downloaded. eventually. performance optimizatins should include: reducing the amount of javascript that is needed. some features requiring complex javascript can be done with a few lines of javascript. requiring a library for other features may improve developer experience, but is all that javascript required? is there a lighter weight or home spu...
...rove developer experience, but is all that javascript required? is there a lighter weight or home spun solutions? some features may not be necessary, and though they may add some bling, is the cost of the feature in terms of performance worth it? remove unused code split the javascript into smaller files code-split javascript into critical and non-critical parts. module bundlers like webpack support code-splitting. optimize these smaller files minification reduces the number of characters in your file, thereby reducing the number of bytes or weight of your javascript. gzipping compresses the file further, and should be used even if you don't minify. brotli is similar to gzip, generally outperforming gzip's compression. render impact web applications include a lot of javascrip...
... used even if you don't minify. brotli is similar to gzip, generally outperforming gzip's compression. render impact web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing, tracking pixels, and features like maps and support features. battery impact conclusion while optimizing your media files and scripts will get you very far along in terms of web performance optimization, everything that touches a web pages impacts performance. in the next article we take a look at some html features that can impact performance, including some attributes specifically created to improve performance. previous overview: p...
Introduction to the server side - Learn web development
inserting data from a database into placeholders in html templates (this is a much more efficient way of storing large amounts of content than using static websites). a dynamic site can return different data for a url based on information provided by the user or stored preferences and can perform other operations as part of returning a response (e.g. sending notifications). most of the code to support a dynamic website must run on the server. creating this code is known as "server-side programming" (or sometimes "back-end scripting"). the diagram below shows a simple architecture for a dynamic website. as in the previous diagram, browsers send http requests to the server, then the server processes the requests and returns appropriate http responses. requests for static resources are hand...
...un inside a web browser and has little or no access to the underlying operating system (including limited access to the file system). web developers can't control what browser every user might be using to view a website — browsers provide inconsistent levels of compatibility with client-side code features, and part of the challenge of client-side programming is handling differences in browser support gracefully. server-side code can be written in any number of programming languages — examples of popular server-side web languages include php, python, ruby, c#, and nodejs(javascript). the server-side code has full access to the server operating system and the developer can choose what programming language (and specific version) they wish to use. developers typically write their code usi...
... the different types of tasks faced in a particular domain. again, while both client and server-side code use frameworks, the domains are very different, and hence so are the frameworks. client-side web frameworks simplify layout and presentation tasks while server-side web frameworks provide a lot of “common” web server functionality that you might otherwise have to implement yourself (e.g. support for sessions, support for users and authentication, easy database access, templating libraries, etc.). note: client-side frameworks are often used to help speed up development of client-side code, but you can also choose to write all the code by hand; in fact, writing your code by hand can be quicker and more efficient if you only need a small, simple web site ui. in contrast, you would al...
Getting started with Ember - Learn web development
al object-oriented programming, while still allowing developers to utilize functional programming techniques. ember makes use of two main syntaxes: javascript (or optionally, typescript) ember's own templating language, which is loosely based on handlebars. the templating language is used to make build and runtime optimizations that otherwise wouldn't be possible. most importantly, it is a superset of html — meaning that anyone who knows html can make meaningful contributions to any ember project with minimal fear of breaking code. designers and other non-developers can contribute to page templates without any knowledge of javascript, and interactivity can be added later. this language also enables lighter asset payloads due to compiling the templates into a "byte code" that can be ...
...which is a common approach to mitigating the slow i/o of dom changes). for more information on the technical aspects of the glimmer vm, the github repository has some documentation — specifically, references and validators may be of interest. everything else in ember is just javascript. in particular, javascript classes. this is where most of the "framework" parts come into play, as there are superclasses, where each type of thing has a different purpose and different expected location within your project. here is a demonstration the impact ember has on the javascript that is in typical projects: gavin demonstrates how < 20% of the js written is specific to ember. getting started the rest of the ember material you'll find here consists of a multi-part tutorial, in which we'll make a...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Ember interactivity: Events, classes and state - Learn web development
ling with vanilla javascript objects, the this keyword refers to the "context" or "scope" of the component. one component's this will be different from another component's this. we can define what is available inside this by generating a component class to go along with your component. this is a vanilla javascript class and has no special meaning to ember, other than extending from the component super-class. to create a header class to go with your header component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js: import component from '@glimmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code. update ...
...the @action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template. @action also binds the this of the function to the class instance. ...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Framework main features - Learn web development
mately builds. like jsx, handlebars uses curly braces to inject the value of a variable. handlebars uses a double-pair of curly braces, instead of a single pair. given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the other way around. typescript is useful for the strictness it allows developers to enforce on their code. for instance, consider a function add(), which takes integers a and b and returns their sum. in javascript, that function could be written like this: function add(a, b) { return a + b...
... framework's components offer a way to describe the external properties they may need, the internal state that the component should manage, and the events a user can trigger on the component's markup. the code snippets in the rest of this section will use react as an example, and are written with jsx. properties properties, or props, are external data that a component needs in order to render. suppose you're building a website for an online magazine, and you need to be sure that each contributing writer gets credit for their work. you might create an authorcredit component to go with each article. this component needs to display a portrait of the author and a short byline about them. in order to know what image to render, and what byline to print, authorcredit needs accept some props. a r...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Getting started with React - Learn web development
ipt? react utilizes features of modern javascript for many of its patterns. its biggest departure from javascript comes with the use of jsx syntax. jsx extends javascript's syntax so that html-like code can live alongside it. for example: const heading = <h1>mozilla developer network</h1>; this heading constant is known as a jsx expression. react can use it to render that <h1> tag in our app. suppose we wanted to wrap our heading in a <header> tag, for semantic reasons? the jsx approach allows us to nest our elements within each other, just like we do with html: const header = ( <header> <h1>mozilla developer network</h1> </header> ); note: the parentheses in the previous snippet aren't unique to jsx, and don’t have any effect on your application. they're a signal to you (and...
... react to a website without create-react-app by copying some <script> elements into an html file, but the create-react-app cli is a common starting point for react applications. using it will allow you spend more time building your app, and less time fussing with setup. requirements in order to use create-react-app, you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). you may also use the yarn package manager as an alternative, but we'll assume you are using npm in this set of tutorials. see package management basics for more information on npm and yarn. if you're using windows, you will need to install some software to give you parity with unix/macos terminal...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Command line crash course - Learn web development
there’s a good range of options from the "cmd" program to "powershell" — which can be run from the start menu by typing the program name. and below, you can see the macos terminal application. how do you access the terminal? many developers today are using unix-based tools (e.g. the terminal, and the tools you can access through it). many tutorials and tools that exist on the web today support (and sadly assume) unix-based systems, but not to worry — they are available on most systems. in this section, we’ll look at how to get access to the terminal on your chosen system. linux/unix as hinted at above, linux/unix systems have a terminal available by default, listed among your applications. macos macos has a system called darwin that sits underneath the graphical user interf...
...nstall a third-party cli tool and make use of it. the vast ecosystem of installable tools for front end web development currently exists mostly inside npm, a privately owned, package hosting service that works closely together with node.js. this is slowly expanding — you can expect to see more package providers as time goes on. installing node.js also installs the npm command line tool (and a supplementary npm-centric tool called npx), which offers a gateway to installing additional command line tools. node.js and npm work the same across all systems: macos, windows, and linux. install npm on your system now, by going to the url above and downloading an running a node.js installer appropriate to your operating system. if prompted, make sure to include npm as part of the installation. ...
...however, for now we'll err on the side of simplicity and install globally to keep things simple. we'll look more at local installs and why they're good in the next article. installing prettier for this article we will install prettier as a global command line utility. prettier is an opinionated code formatting tool for front end developers, focusing around javascript-based languages and adding support for html, css, scss, json and more. prettier can: save the cognitive overhead of getting the style consistent manually across all your code files; prettier can do this for you automatically. help newcomers to web development format their code in best-practice fashion. be installed on any operating system and even as a direct part of project tooling, ensuring that colleagues and friends ...
Deploying our app - Learn web development
needs to be added to our local git repository before we can push it up there, otherwise it won't be able to find it. you'll need to run a command with the following structure (use the provided https option for now — especially if you are new to github — not the ssh option): git remote add github https://github.com/yourname/repo-name.git so if your remote url was https://github.com/remy/super-website.git, as in the screenshot above, your command would be git remote add github https://github.com/remy/super-website.git change the url to your own repository, and run it now. now we're ready to push our code to github; run the following command now: git push github master at this point you'll be prompted to enter a username and password before git will allow the push to...
...ppen. when approaching tests there's a good deal of ways to approach the problem: end-to-end testing, which involves your visitor clicking a thing and some other thing happening. integration testing, which basically says "does one block of code still work when connected to another block?" unit testing, where small and specific bits of functionality are tested to see if they do what they are supposed to do. and many more types. also see our cross browser testing module for a bunch of useful testing information remember also that tests are not limited to javascript; tests can be run against the rendered dom, user interactions, css, and even how a page looks. however, for this project we’re going to create a small test that will check the third-party nasa data feed and ensure it's in...
...though the test for this project does not include a test framework, as with all things in the front-end development world, there are a slew of framework options. the test itself isn't what is important. what is important is how the failure or success is handled. some deployment platforms will include a specific method for testing as part of their pipeline. products like github, gitlab, etc., all support running tests against individual commits. as this project is deploying to netlify, and netlify only asks about the build command, we will have to make the tests part of the build. if the test fails, the build fails, and netlify won’t deploy. let’s get started. go to your package.json file and open it up. find your scripts member, and update it so that it contains the followi...
Accessibility API cross-reference
columnheader column_header column_header, table_column_header columnheader <th scope=col> edit control with drop down list box, different from droplist combobox combo_box combo_box combobox abstract role - a form of widget that performs an action but does not receive input data. command a supporting section of the document, designed to be complementary to the main content at a similar level in the dom hierarchy, but remains meaningful when separated from the main content. complementary <aside> n/a but <div> or even <p> have been suggested for this purpose a widget that may contain navigable descendants or owned children. composi...
...xtselectable n/a n/a not clipped to boundary of parent, does not auto-move with parent floating n/a n/a identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order. ...
...ent which, at the user's discretion, allows assistive technology to override the general default of reading in document source order. very poor support in user agents and ats, and no sufficient techniques available n/a n/a aria-flowto indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. supported for anything that's not a menu is poor n/a n/a aria-haspopup the item can get the keyboard focus focusable focusable focusable tabindex attribute with value of 0 or more the item has focus for text input. for other kinds of keyboard operation, e.g. ui controls, see armed focused focused focused availa...
Accessibility/LiveRegionDevGuide
this page is currently under construction. this developer's guide lays out general guidelines that assistive technology (at) developers can use in developing live region support. this guide was written from an atk/at-spi point of view as part of the orca live region support project. however, many of the concepts were also used during the development of firevox, an at using iaccessible2. sometimes the very best guide for some developers is the code itself. please refer to the liveregions and gecko python modules in orca for a real world example. for more information about live regions, please read the aria properties spec or the live region report to learn about aria live region markup and the live region api support document for the latest firefox api with regards to live regions. as...
...it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties. ...
...oon as possible. container-atomic the atomic property determines if a live region change should be presented on it's own or if an at should present the entire region. if atomic is set to "true", it means that the region must be presented as a whole while atomic="false" (default) indicates that the region can stand on it's own. the text offsets associated with a text changed event are used when supporting this property. the offsets can be acquired directly in a text changed event object in at-spi and through the use of iaccessibletext::get_oldtext and iaccessibletext::get_newtext in iaccessible2. when atomic is set to "false", the start index and end index/run length are used as given. the result being that only the change will be presented. when atomic is set to "true", the entire region s...
Information for users
now has help topics (from the menubar: ? > help contents f1 > accessibility features) which describe any special features and keyboard shortcuts designed to help users with disabilities. please check the accessibility help topic for more information. firefox accessibility features this page defines most of the accessibility features possible in firefox. features include assistive technology support on windows (like window-eyes, jaws, etc.), firefox keyboard support, available accessibility extensions like fire vox and other extensions. assistive technology compatibility this is a wiki page which users can edit to provide up to date information on any issues related to compatibility with assistive technologies such as screen readers, screen magnifiers, voice input software and on sc...
...is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Multiprocess on Windows
r callback implementation forwards the method call to the main thread in order to invoke the method on the wrapped object. the interceptor is also aware that any outparams, which contain interfaces, must also be wrapped with interceptors of their own. this code lives in the mscom library, located in the tree at /ipc/mscom. its headers are exported to mozilla/mscom. ensuring that the interceptor supports your interfaces this information is current, but is likely to change when bug 1346957 is landed. interceptors cannot replicate interfaces without access to the metadata that describes those interfaces. since we are using com, we already generate metadata by declaring interfaces using midl. this does not (yet) work as transparently as we would like. com metadata midl outputs two differe...
..."fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib). oicf metadata is much richer than typelib metadata, however com requires typelibs whenever it is being used with interpreted languages. in particular, typelibs were originally designed to work with 1990s-era visual basic. typelib metadata is limited to supporting the same language features which were supported by vb at that time. given those two options, it may seem that oicf is the preferred format. however, for various reasons, our com interceptor currently only supports typelib metadata. in order for the interceptor to be able to work with our interfaces, we must do some additional work to compensate for typelib's weaknesses. the required steps...
...utparams that consist of arrays of interfaces recall that one of the limitations of typelibs is that their metadata isn't as rich as oicf metadata. something typelibs do not include in their metadata, is idl annotations, such as length_is and size_is. remember, for interceptors to work correctly, they must be able to wrap any outparams that are interfaces with their own interceptors. without the support for length_is and size_is annotations, the interceptor cannot tell the difference between a scalar outparam and an array outparam. if your interface outputs an array of interfaces, the interceptor would only wrap the first element in the array, because it cannot distinguish between scalars and arrays. note: if your new interface does not contain either of these annotations, then you do not ...
Theme concepts
the themes example weta_fade. obviously, you can still provide a single wide image if you prefer. multiple image themes as an alternative to creating a single image theme, you have the option to use multiple images. these images can be individually anchored to locations within the header, with the option to apply tiling to each image. depending on the effect you want to create you may need to suppress the mandatory "theme_frame": image with an empty or transparent image. you would use an empty or transparent image if, for example, you wanted to tile a centrally justified image, such as to create this effect here you specify the weta image like this: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta_for_tiling.png"] }, and the images tiling with: "prope...
...re is currently limited compatibility between themes in the major browsers. opera takes an entirely different approach, and microsoft edge themes are not yet open to developers. there is good compatibility between firefox static themes and chrome themes, providing the ability to port a single header image theme from firefox to chrome. ...
...ent approach, and microsoft edge themes are not yet open to developers. there is good compatibility between firefox static themes and chrome themes, providing the ability to port a single header image theme from firefox to chrome. however, noting that "frame": and "tab_background_text": only support rgb color array definition on chrome. ...
Add-ons
fox user interface add new features to firefox there are several types of add-ons, but the most common type are extensions. developing extensions in the past, there were several toolsets for developing firefox extensions, but as of november 2017, extensions must be built using webextensions apis. other toolsets, such as overlay add-ons, bootstrapped add-ons, and the add-on sdk, are no longer supported. extensions written using webextensions apis for firefox are designed to be cross-browser compatible. in most cases, it will run in chrome, edge, and opera with few if any changes. they are also fully compatible with multiprocess firefox. you can see the apis currently supported in firefox and other browsers. extension workshop the firefox extension workshop can help you develop extensio...
...extension an enterprise guide for developing and using extensions how to develop themes for firefox firefox developer communities extensions for firefox for android in 2020, mozilla will release a new firefox for android experience. this new, high-performance browser for android has been rebuilt from the ground up using geckoview, mozilla’s mobile browser engine. ...
... publishing add-ons addons.mozilla.org, commonly known as "amo," is mozilla's official site for developers to list add-ons, and for users to discover them. by uploading your add-on to amo, you can participate in our community of users and creators and find an audience for your add-on. ...
Browser chrome tests
rowser.xul). note: be careful when naming your functions and variables. since the test files are executed in the same scope as the browser window, conflicting variable names could cause trouble while running the tests. you should attempt to reduce the side effects of the testing code and "clean up" after yourself, to avoid influencing other tests. the comparison functions are identical to those supported by mochitests, see how the comparison functions work in the mochitest documentation for more details. the eventutils helper functions are available on the eventutils object defined in the global scope. the test file name must be prefixed with "browser_", and must have a file extension of ".js". files that don't match this pattern will be ignored by the test harness. using a descriptive fil...
...ils and helpers in a file called head.js, that must live in the same folder as the browser-chrome tests. this file will be injected into the test scope for each test living in the same folder. notice that any function call in head.js main scope will run before the main test() method. asynchronous tests when writing async tests, you can use the add_task method with promises. the test suite also supports asynchronous tests, using the same function names as mochitest. call waitforexplicitfinish() from test() if you want to delay reporting a result until after test() has returned. call finish() once the test is complete. be aware that the test harness will mark tests that take too long to complete as failed (the current timeout is 30 seconds). function test() { waitforexplicitfinish(); ...
... tests after yours. adding a new browser chrome test to the tree to add a new browser chrome test to the tree, add it to the browser.ini file in the same folder as the test. also remember that the test file's name must begin with "browser_" for the test to be recognized as a browser chrome test. if you are adding the first tests in a directory, make sure to also include any head.js you added to support-files, and additionally, ensure that your browser.ini is referenced by a moz.build file somewhere, such as: browser_chrome_manifests += [ 'test/functional/mochitest/browser.ini' ] support-files once added to support-file section of browser.ini support files may be referenced as https://example.com/browser/[path_to_file] or chrome://mochitests/content/browser/[path_to_file]. <tmui styl...
Command line options
s name implies on all platforms, i.e. instances created with this parameter do not accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -override /path/to/override.ini load the specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard at startup by loading the following override.ini. firefox only. [xre] enableprofilemigrator=0 -profilemanager start with profile manager. short form: -p without a profile name. -p "profile_name" bypass profile manager and launch application with the profile named profile_name. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name i...
....x, as there lower case invokes purify mode (memory and leak detection). other platforms accept both upper and lower case. -profile "profile_path" start with the profile with the given path. firefox, thunderbird and seamonkey2.x only. "profile_path" can either be an absolute path ("/path/to/profile") or a relative path ("path/to/profile"). note: on mac os x specifying a relative path is not supported anymore from firefox 4.0 and up due to a regression, see bug 673955. browser -browser start with the browser component. firefox and seamonkey only. -foreground make this instance the active application. -new-tab url open url in a new tab. firefox and seamonkey2.x only. -new-window url open url in a new window. firefox and seamonkey2.x only. --kiosk url open url full screen witho...
...ee bug 1080319. execute the specified remote_command in an already running application process. firefox -remote "openurl(www.mozilla.org, new-tab)" this option is only available on x-windows unix platforms. miscellaneous -attach-console write messages for the debugging console into the window which launched the application instead of opening a new window for the debugging messages. only supported on the windows operating system. -console start application with a debugging console. note: windows only. -h or -help or -? print the list of all available command line options. note that on windows this only works with a redirection such as |more (bug 355889). this option is available only in a command console. -osint tells the application that it is being launched by the os shell...
Interface Compatibility
ur applications, programming interfaces change. the rules which govern interface changes are different depending on the consumers and the languages involved. web content apis which are visible to web content are not modified, except as a last resort when inherent security vulnerabilities or incompatibility with other browsers make it the only option. any changes, including new features, must have super-review. one exception to this rule is apis which are explicitly shipped with mozilla prefixes as a technology preview. this includes css properties that begin with the -moz- prefix (e.g. -moz-box-shadow), or javascript apis that begin with the moz prefix (e.g. canvasrenderingcontext.mozdrawtext). these apis may be removed or replaced with standard interfaces in future releases of mozilla. jetpa...
..., or other similar techniques. binary interfaces traditionally, mozilla has maintained a set of xpcom interfaces and functions with the @status frozen marking. using these interfaces, and using dynamic calls to queryinterface, it has been possible to write binary xpcom components which were compatible with multiple versions of firefox. beginning with mozilla 2 (firefox 4), this will no longer be supported: all @status markings have been removed, and extensions that use binary components will need to recompile for each major version they wish to support. js-ctypes is the recommended way for extensions to call into os or third-party native code. you should strongly consider migrating existing code to use js-ctypes instead of binary components. if necessary, it is possible for an extension t...
...rted: all @status markings have been removed, and extensions that use binary components will need to recompile for each major version they wish to support. js-ctypes is the recommended way for extensions to call into os or third-party native code. you should strongly consider migrating existing code to use js-ctypes instead of binary components. if necessary, it is possible for an extension to support multiple versions by shipping multiple shared libraries (dlls) in the same extension package, and selecting the correct version using versioning flags in its chrome.manifest file. jsapi, nspr, nss, and other libraries which are currently shipped as separate shared libraries may be integrated into libxul, and extension authors should avoid linking against them. ...
HTTP Cache
this document describes the new http cache version 2. the code resides in /network/cache2. api here is a detailed description of the http cache v2 api, examples included. this document only contains what cannot be found or may not be clear directly from the idl files comments. the cache api is completely thread-safe and non-blocking. there is no ipc support. it's only accessible on the default chrome process. when there is no profile the new http cache works, but everything is stored only in memory not obeying any particular limits. it is strongly encoraged to not use the old cache api any more - nsicacheservice et al. it will soon be completely obsoleted and removed (bug 913828). nsicachestorageservice the http cache entry-point. accessible as a service ...
... the cache entry and has open and keeps open the output stream on it, other consumers may open input streams on the entry. the data will be available as the writer writes data to the cache entry's output stream immediately, even before the output stream is closed. this is called concurrent read/write. concurrent read and write important difference in behavior from the old cache: the cache now supports reading a cache entry data while it is still being written by the first consumer - the writer. this can only be engaged for resumable responses that (bug 960902) don't need revalidation. reason is that when the writer is interrupted (by e.g. external canceling of the loading channel) concurrent readers would not be able to reach the remaning unread content. this could be improved by keep...
...details for more information. code examples tbd opening an entry creating a new entry recreating an already open entry implementation threading the cache api is fully thread-safe. the cache is using a single background thread where any io operations like opening, reading, writing and erasing happen. also memory pool management, eviction, visiting loops happen on this thread. the thread supports several priority levels. dispatching to a level with a lower number is executed sooner then dispatching to higher number layers; also any loop on lower levels yields to higher levels so that scheduled deletion of 1000 files will not block opening cache entries. open_priority: except opening priority cache files also file dooming happens here to prevent races read_priority: top level docu...
How Mozilla determines MIME Types
ect pdf and postscript. if the file starts with <?xml, asks the externalhelperappservice for a mime type for the uri. this is done because the generic text/xml mime type does not work for xul files, and xhtml files get a different dom when interpreted as text/xml. the image library will be asked for the mime type given the content. this should allow reliable detection of all image types mozilla supports. checks whether the data is html by looking for some common html tags. the uri is handed to the externalhelperappservice for mime type guessing if all else fails, the buffer (i.e. the first few bytes of the file) is searched for embedded nulls; if none are found, text/plain will be used, otherwise application/octet-stream. externalhelperappservice (located at uriloader/exthandler/nsext...
...ensions is checked (containing currently 13 entries, nsexternalhelperappservice.cpp line 463 (this is done for speed – it is faster to find data in the hardcoded list than asking the os or looking in preferences) if the extension is not listed there, it becomes interesting. firstly, the operating system is asked for a mime type. (on unix, this means checking mime.types.) if that fails, a user-supplied helper app is searched for by extension, and the specified mime type will be used. (i.e. the list in edit/preferences/helper applications) if that failed, a list of "extra" mime types is searched for an extension match. see line 507 for the complete list. if that also failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type i...
...mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-list and a description of the mime type. related information document loading - from load start to finding a handler original document information author(s): christian biesinger last updated date: march 7, 2005 copyright information: copyright (c) christian biesinger ...
How to get a stacktrace with WinDbg
tom of the command window. tip: all commands must be entered exactly as written, one line at a time, into the bottom of the command box. copying and pasting each line is the easiest method to avoid mistakes some commands start with a period (.) or a pipe character (|), which is required. (the keystroke for a pipe character on us keyboards is shift+\) submit the log file on a bug or via the support site, even if nothing seems to happen during the debug process start debugging now that firefox is opened in the debugger, you need to configure your windbg to download symbols from the mozilla symbol server. to load the symbols, enter the three commands below, pressing enter after each one. (more details are available at using the mozilla symbol server.) .sympath srv*c:\symbols*http://s...
...o. once the browser crashes, you will see an error (such as "access violation") in the windbg command window. if firefox hangs and there is no command prompt available in the debugger, open the debug menu and choose break. once the browser has crashed or been stopped, continue with the steps below. ...
... producing a minidump sometimes the stacktrace alone is not enough information for a developer to figure out what went wrong. a developer may ask you for a "minidump" or a "full memory dump", which are files containing more information about the process. ...
Extending a Protocol
ds a message from the content process (main thread) to the chrome process (ui thread). the tutorial is designed for beginners and will walk you through all the steps you need to get things working. the tutorial is designed for browser engineers who are implementing dom/web apis that need to, for example, send a message to the os or spin up something off the main thread - so it's biased towards supporting w3c/whatwg dom apis. what are we going to implement? tl:dr: you can see the final implementation of pecho.ipdl as a diff in phabricator. to make this tutorial less abstract (more fun!), we are going to implement a js method called echo() on the navigator interface. the method will take one argument, a domstring, which we will pass to the parent process. then we will send that same str...
...the actual // methods for sending messages, as we will soon see. class echochild final : public pechochild { friend class pechochild; // allows us to participate in reference counting ns_inline_decl_threadsafe_refcounting(echochild, final) public: explicit echochild(); protected: void actordestroy(actordestroyreason awhy) override; // we get sendecho(nscstring& astring) from the superclass. private: ~echochild() = default; bool mactoralive; }; } // end of namespace dom } // end of namespace mozilla and add the echochild.h to dom/ipc/moz.build, as part of the exports.mozilla.dom array. again, remember that this must be in alphabetical order! compiling this will now complain: "fatal error: 'mozilla/dom/echoparent.h' file not found", so let's define echoparent.h. ...
...nearly there though! let's give this a compile and see how we are doing! we should see ./mach build make significant progress now, but obviously, wihtout a backing cpp implementation, it's not going to do much. let's implement the .cpp files, starting with windowglobalparent.cpp. implementing methods on windowglobalparent.cpp open up dom/ipc/windowglobalparent.cpp and...
Implementing Download Resuming
this document describes how an embedder or other gecko/necko-using application can implement download resuming. the interfaces in question exist in the form they are described here since gecko 1.8a4 (firefox 1.5, seamonkey 1.0, xulrunner 1.8.0.1). introduction various protocols support getting partial files. this means that if a download was interrupted, it can be resumed from that point on, rather than regetting the whole file. the necko implementations of http 1.1 (rfc 2616) as well as ftp support this feature. not only is the ability to specify a start position important, but it's also important to have some assurance that the file did not change since the initial download attempt. that would lead to a situation where the first part of the file corresponds to the initial versio...
...er's onstoprequest method with a failure status. (todo: document what webbrowserpersist/exthandler do). the front-end code can then notify the user of this, and offer to resume the download. resuming a download in order to resume a download, you should create a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does not support resuming. otherwise, call resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no assurance that the file remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications. you may ...
...end to existing files (as opposed to overwriting them), and is therefore not usable for this task (see bug 129921). detecting when a file changed if the file changed (that is, the entity id does not match), then necko will notify the stream listener with an ns_error_entity_changed error code. the front-end may want to offer the user to get the new file from scratch in such a case. resuming not supported in some cases, it's not possible to detect whether the server supports resuming until the user actually tries to resume. in such a case, the stream listener will get an ns_error_not_resumable status. here, too, the front-end may want to offer downloading the entire file from scratch. ...
Integrated Authentication
this document provides an overview of mozilla's support for integrated authentication. this entails support for the the simple and protected gss-api negotiation mechanism (spnego) internet standard (rfc 2478) to negotiate either kerberos, ntlm, or other authentication protocols supported by the operating system. spnego is commonly referred to as the "negotiate" authentication protocol. mozilla does not have its own internal implementation of spnego. instead, it leverages system libraries that provide spnego; sspi on microsoft windows, and gss-api on linux, mac osx, and other unix-like systems. the mozilla implementation of spnego can be found under extensions/auth/. it used to live in extensions/negotiateauth. ...
...erred to as the "negotiate" authentication protocol. mozilla does not have its own internal implementation of spnego. instead, it leverages system libraries that provide spnego; sspi on microsoft windows, and gss-api on linux, mac osx, and other unix-like systems. the mozilla implementation of spnego can be found under extensions/auth/. it used to live in extensions/negotiateauth. mozilla also supports raw ntlm authentication using an internal implementation (based on the documentation provided by eric glass) that supports ntlmv1/lmv1 and ntlm2 session key modes. as of mozilla 1.7, there is no support for ntlmv2/lmv2. this is mainly due to the fact that ntlmssp does not provide a means to negotiate use of ntlmv2/lmv2. <i>this document is incomplete ...</i> flow diagram the diagram below ...
...ts ntlm may be negotiated as the authentication protocol. so, it is paramount that the browser does not freely exchange ntlm user credentials with any server that requests them. the ntlm response includes a hash of the user's logon credentials. on older versions of windows this hash is computed using a relatively weak algorithm (see hertel for more info on ntlm authentication). mozilla currently supports a whitelist of sites that are permitted to engage in spnego authentication with the browser. this list is intended to be configured by an it department prior to distributing mozilla to end-users. the preferences are: pref("network.negotiate-auth.trusted-uris", site-list); pref("network.negotiate-auth.delegation-uris", site-list); pref("network.automatic-ntlm-auth.trusted-uris", site-list);...
JavaScript-DOM Prototypes in Mozilla
tive c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node. when xpconnect wraps a c++ object it will create a jsobject that is unique to this c++ object. in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsixpcscriptable::dont_share_prototype set, but lets assume that's not the case here). as an example of this let's look at an html image element in a document. var obj = document.images[0]; he...
... modifying host objects is an unsafe practice. it is not guaranteed to work or be error-free in any implementation. it is not standard and cannot be expected to have any result. here is an attempt to modify a host object: (function(){ try { image.prototype.src = 1; } catch(ex){ alert(ex); } })(); this demonstrates that the image constructor, a host object supported in nearly all browsers for mac and windows, has a prototype property, and that an attempt to modify the prototype's src - property results in an error. another example would be modifying the pagex property of a mouseevent instance. the pagex property actually needs a patch because it doesn't get set correctly in initmouseevent bug 411031. here is a diagram that shows the prototype layout ...
...prototype of the class is by looking at the parent of the primary interface in the class info (if the name is a class constructor, such as htmlimageelement) or by looking at the parent of the interface that the iid stored in the nsscriptnamespacemanager for this name represents (if the name is a class prototype, such as node). once the name of the parent interface is known (and the name is not nsisupports) the code will look up a property by that name on the global object. this will cause the code to recurse down along the parent chain of the interface of interest for the name we started out resolving (i.e. nswindowsh::globalresolve() will be called for every name on the parent chain). the result of this recursion is that by resolving the name htmlimageelement, we'll create the constructor ht...
CustomizableUI.jsm
3 types themselves: button which are simple toolbar buttons which do something when clicked view which are toolbar buttons with a 'view' of further options. the view can be shown as its own panel when such a widget is in the toolbar, or as a sliding 'subview' of the menu panel when such a widget is in the menu panel. custom which are widgets that are custom-created by some js supplied by the consumer for more details, see api-provided widgets. 'special' widgets: these are the representations of xul <toolbarseparator>, <toolbarspring> and <toolbarspacer> elements. customizableui provides apis to add, move and remove all these different widgets, and mostly abstracts the dom away from you. the lifetime of your widget should be identical to the lifetime of the add-on...
...mization of the user interface. in order to use this facility, you should create a plain js object which defines some of the event handlers defined below. not all event handler methods need to be defined. customizableui will catch exceptions. events are dispatched synchronously on the ui thread, so if you can delay any/some of your processing, that is advisable. the following event handlers are supported: onwidgetadded(awidgetid, aarea, aposition) fired when a widget is added to an area. awidgetid is the widget that was added, aarea the area it was added to, and aposition the position in which it was added. onwidgetmoved(awidgetid, aarea, aoldposition, anewposition) fired when a widget is moved within its area. awidgetid is the widget that was moved, aarea the area it was moved in, ao...
...there has been 1 endbatchupdate call for each beginbatchupdate call). if any of the endbatchupdate calls pass aforcedirty=true, we will flush to the prefs file. parameters aforcedirty force customizableui to flush to the prefs file when all batch updates have finished. createwidget() create a widget. to create a widget, you should pass an object with its desired properties. for a list of supported properties, see api-provided widgets. parameters aproperties the specification for the widget return value a wrapper around the created widget. note: if your extension is compatible with versions of firefox below 29, i.e. before customizableui was introduced, then you have to make sure that in case of running on newer browsers, xul overlay does not contain description of the button...
PerfMeasurement.jsm
e -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") see measuring performance using the perfmeasurement.jsm code module for details on how to use this api. note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data. any measurable event that was not being recorded has a value of -1 (that is, 0xfffffffffff...
... profiled. cpu_migrations uint64 the number of times the profiled thread migrated from one cpu core to another. event types measured constant the eventsmeasured constant provides a mask indicating which event types were recorded. variable type description eventsmeasured eventmask a bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the perfmeasurement object. constants event mask constants these constants are used to construct the mask indicating which events you want to monitor. constant value description cpu_cycles 0x00000001 measure cpu cycles elapsed. instructions 0x00000002 measure the number of instructions executed. cache_references 0x00000004 measure...
...e event types you want to record; see event mask constants for a list of values. or together all the event types you want to record, and pass that value here. pass perfmeasurement.all to record all event types. return value a new perfmeasurement object configured to record the specified event types. methods canmeasuresomething() indicates whether or not the platform on which your code is running supports this code module. static bool canmeasuresomething(); parameters none. return value if even one of the event types can be recorded, this will return true. otherwise, it returns false. reset() resets all the enabled counters to zero. void reset(); parameters none. start() starts measuring the performance indicators that were specified when the perfmeasurement object was created. void start()...
Webapps.jsm
ist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setup...
...arequestchannel, aid, aoldapp, anewapp) _computefilehash: function(afilepath) _sendappliedevent: function(aapp) _openandreadpackage: function(azipfile, aoldapp, anewapp, aislocalfileinstall,) _openpackage: function(azipfile, aapp, aislocalfileinstall) _opensignedpackage: function(ainstallorigin, amanifesturl, azipfile, acertdb) _readpackage: function(aoldapp, anewapp, aislocalfileinstall, aisupdate,) _checksignature: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, arequestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkforstoreidmatch: function(aisupdate, anewapp, astoreid, astoreversion) revertdownloadpackage: function(ai...
...: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, arequestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkforstoreidmatch: function(aisupdate, anewapp, astoreid, astoreversion) revertdownloadpackage: function(aid, aoldapp, anewapp, aisupdate, aerror) uninstall: function(amanifesturl) _promptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: function(adata, amm) getnotinstalled: function(adata, amm) geticon: function(adata, amm) getall: function(acallback) isrece...
Index
firefox for ios uses the xliff xml-based file format to hold and transfer localization data. xliff (extensible localisation interchange file format) is a localization standard governed by the oasis standards body. 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 corruption. most translation tools support the xliff standard, making localizing the xliff files for firefox for ios easy to do using translation tools. editing the raw xliff file is also rather easy, especially if you're already familiar with xml. this tutorial will walk you through the steps you need to take to translation strings within an xliff file. 21 localizing extension descriptions add-ons, extensions, guide, i...
... 21 localizing extension descriptions add-ons, extensions, guide, internationalization, localization this article provides details on how to go about localizing the descriptions of mozilla add-ons, as well as for other metadata about your add-on. 22 localizing extension metadata on addons.mozilla.org add-ons, extensions, internationalization, localization amo supports localized metadata for each extension. this data describes the extension, and doesn't necessarily change with each revision (but it can). the localizable data fields of an extension are: 23 localizing with koala this tutorial will guide you through making a couple of changes to firefox's user interface using koala, an add-on for komodo edit created to help localizing mo...
...nes when dealing with ui code with respect to localization. it is aimed at mozilla and extension developers. 42 gettext internationalization, localizability, localization gettext lets you define and use singular and plural forms of a string. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). ...
Localizing extension metadata on addons.mozilla.org
remember, all fields are optional when localizing. ...
...nts when you submit a new extension to amo, the process is divided into several steps. in step 2, you'll be asked to provide the attributes listed above in the add-on's default locale (selected in step 1). the values you provide here are used as fallback values if someone requests a language that doesn't exist. step 4 allows you to translate any of the above fields into any other language amo supports. remember, all fields are optional when localizing. any field that is blank will just show up in the default locale. getting translation help you are kindly advised not to use any automatic online translation, which can bring unpleasant low-quality output to users. always prefer a qualified human translation. amo doesn't directly provide translation assistance to extension authors, but th...
...lation assistance to extension authors, but there are a couple services that can help: babelzilla.org babelzilla.org is a community dedicated to the localization of extensions for moz family apps. they are volunteer translators from all over the world and are maintaining translations for more than 400 extensions with an online translation system. they also provide help for adding a localization support to your extension if there is no localization structure yet. you can already request for amo fields localization on the forums, and these fields will be added soon to the web translation system. amazon mechanical turk this is not free, but for a very modest amount of money you can get your amo page quickly translated by native speakers. create an account and then, using the “basic open-en...
Extras
attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indefinite"/> <g transform="translate(-15, -15)"> <path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,...
... style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indefinite"/> <circle fill="url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </mtext> </msup> <mrow> <mo>ā…†</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(0,0,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(0,255,0);stop-opacity:1"/> </lineargradient> <lineargradient id="gra...
...5;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="url(#grad3)" r="30"/> <g transform="translate(-30,-30)"> <switch> <foreignobject width="60" height="60" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <munderover> <mo>∑</mo> <mrow> <mi>n</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mo>+</mo> <mi>∞</mi> </mrow> </munderover> <mfrac> <msup> <mi>α</mi> <mi>n</mi> </msup> <mrow> <mi>n</mi> <mo>!</mo> </mrow> </mfrac> </mrow> </math> </foreignobject> <text>exp(α)</text> </switch> </g> </g> </svg> </div> inline javascript html content <math display="block"> <mfrac> <mtext id="num">mouse</mtext> <mtext id="denum">over</mtext> </mfrac> </math> javascript content function whoistherealert(evt) { alert("who is there?"); } ...
Using the viewport meta tag to control layout on mobile browsers
or narrow screens using media queries — if the virtual viewport is 980px for example, media queries that kick in at 640px or 480px or less will never be used, limiting the effectiveness of such responsive design techniques. to mitigate this problem, apple introduced the "viewport meta tag" in safari ios to let web developers control the viewport's size and scale. many other mobile browsers now support this tag, although it is not part of any web standard. apple's documentation does a good job explaining how web developers can use this tag, but we had to do some detective work to figure out exactly how to implement it in fennec. for example, safari's documentation says the content is a "comma-delimited list," but existing browsers and web pages use any mix of commas, semicolons, and spaces ...
...e, instead of laying out the page as it would if originally loaded in landscape. if web developers want their scale settings to remain consistent when switching orientations on the iphone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in: <meta name="viewport" content="initial-scale=1, maximum-scale=1"> suppress the small zoom applied by many smartphones by setting the initial scale and minimum-scale values to 0.86. the result is horizontal scroll is suppressed in any orientation and the user can zoom in if they want to. <meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86"> common viewport sizes for mobile and tablet devices if you want to ...
...ientation as well as physical screen size, operating system and the pixel density of the device. specifications specification status comment css device adaptationthe definition of '<meta name="viewport">' in that specification. working draft non-normatively describes the viewport meta element there is clearly demand for the viewport meta tag, since it is supported by most popular mobile browsers and used by thousands of web sites. it would be good to have a true standard for web pages to control viewport properties. as the standardization process proceeds, we at mozilla will work to keep up to date with any changes. ...
Gecko Profiler FAQ
rofiler platform doesn’t capture any information about lines. it only knows what function was executed and what line this function starts at. for native code, the profiler captures the necessary information but doesn’t have a way to display it. similarly it also can’t show you instruction level information about where each sample was captured (this is why there is no support for line-level sampling for native code either.) at this point the granularity of each sample it displays is a native function. therefore the gecko profiler is not a suitable tool for finding hotspots within a single function. for this purpose you should try to use a native profiler on your platform of choice (for example xperf/vtune on windows, instruments on osx, and perf/zoom...
...ible that those profiles only show you that we spend a lot of time in gc / cc. in that case, the gecko profiler is the wrong tool to debug this. even about:memory would be more useful. overview of the changes in the last (year?) to cleopatra/etc faster, hopefully more reliable has a timeline tab lets you hide threads with a context menu supports symbolication for local builds on windows if you run “mach buildsymbols” first profiling non-nsthreads? the current setup requires each thread that you want to profile to notify the profiler about its existence. we have this hooked up for nsthreads, and as of very recently also for rayon threads (used in stylo). we have not attempted to register other threads wit...
...ple is due. then go to the previous step. i there an equivalent to itimer_prof vs itimer_real settings? (itimer_prof interrupts every n ms regardless of which thread used the time, real interrupts every nms of wall-clock time) the gecko profiler does not know which thread is used at which time. it interrupts all threads based on wall-clock time. [jesup] ok, that's the equivalent to itimer_real, kinda, except that per the previous question it doesn't interrupt every thread at once and snapshot the thread you started the itimer on, it interrupts each thread one at a time, which likely means distortion of the measurement if the number of threads monitored is significant (especially at high sample rates). a cleaner snapshot would stop all threads,...
Memory reporting
cludingthis. implement one or both as needed. if you have both, sizeofexcludingthis is the interesting one; sizeofincludingthis always has the same basic form. and here's how you'd write a memory reporter if there was a single global mystring object. mystring *gmystring; class mystringreporter moz_final : public nsimemoryreporter { moz_define_malloc_size_of(mallocsizeof) public: ns_decl_isupports ns_method collectreports(nsihandlereportcallback* ahandlereport, nsisupports* adata) { // btw: if gmystring wasn't a pointer, you'd use // |gmystring.sizeofexcludingthis(mallocsizeof)| instead. return moz_collect_report( "explicit/mystring", kind_heap, units_bytes, gmystring->sizeofincludingthis(mallocsizeof), "memory used for mystring."); } }; ns_impl...
...and moz_collect_report is a macro that makes things a bit shorter. ...
...t of the allocated object or somewhere in its middle. this is doubly true if d features multiple inheritance. and if amallocsizeof is passed a pointer that doesn't point to the start of an object it will give bogus results or even crash. so, if in doubt, define d::sizeofincludingthis and you should be safe. the override annotations say that d's methods override the corresponding methods in b. on supporting compilers it gets expanded to the override keyword. it helps prevent accidentally having small differences in the function signatures (e.g. forgetting a const) that prevent the overriding from happening. other considerations a number of the existing basic data structures already have sizeof{in,ex}cludingthis functions, e.g. nstarray and nsthashtable. nsthashtable's functions take an ext...
Scroll-linked effects
effects explained often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the css position or transform property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynchronous scrolling in order to provide a consistent 60 frames per second experience to the user. in the asynchronous scrolling model, the visual scroll position is updated in the compositor thread and is visible to the user before the scroll event is updated in the dom and fired on the main thread. this means that the effects implemented will lag a little bit behind what the ...
...per console (starting in version 46) if it detects the presence of a scroll-linked effect on a page. pages that use scrolling effects without listening for scroll events in javascript will not get this warning. see the asynchronous scrolling in firefox blog post for some more examples of effects that can be implemented using css to avoid jank. future improvements going forward, we would like to support more effects in the compositor. in order to do so, we need you (yes, you!) to tell us more about the kinds of scroll-linked effects you are trying to implement, so that we can find good ways to support them in the compositor. currently there are a few proposals for apis that would allow such effects, and they all have their advantages and disadvantages. the proposals currently under considera...
... with an additional proposal to map scroll position to time and use that as a timeline for the animation. compositorworker: allows javascript to be run on the compositor thread in small chunks, provided it doesn't cause the framerate to drop. scroll customization: introduces a new api for content to dictate how a scroll delta is applied and consumed. as of this writing, mozilla does not plan to support this proposal, but it is included for completeness. call to action if you have thoughts or opinions on: any of the above proposals in the context of scroll-linked effects. scroll-linked effects you are trying to implement. any other related issues or ideas. please get in touch with us! you can join the discussion on the public-houdini mailing list. ...
about:memory
mages and workers, and for browser subsystems such as the startup cache and xpconnect. some add-on memory usage is identified, as the following example shows. ...
... some add-ons are identified by a name, such as tree style tab. others are identified only by a hexadecimal identifie...
...a0zr8.new/extensions/%7b59c81df5-4b7a-477b-912d-4e0fdf64e5f2%7d/components/chatzilla-service.js) │ └───1,872,144 b (00.19%) ++ treestyletab@piro.sakura.ne.jp/js-non-window/zones/zone(0x100496800) more things worth pointing out are as follows. some add-ons are identified by a name, such as tree style tab. others are identified only by a hexadecimal identifier. you can look in about:support to see which add-on a particular identifier belongs to. for example, 59c81df5-4b7a-477b-912d-4e0fdf64e5f2 is chatzilla. all javascript memory usage for an add-on is measured separately and shown in this sub-tree. for add-ons that use separate windows, such as chatzilla, the memory usage of those windows will show up in this sub-tree. for add-ons that use xul overlays, such as adblock plus,...
MailNews automated testing
automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases. this page and its sub-pages describe (and link to) the available test mechanisms within mailnews, and provide supporting information for developers and testers. functional testing xpcshell-tests and make check these are core test harnesses to which mailnews adds its own tests. these tests are run against almost every changeset that gets committed to the thunderbird and seamonkey code bases. xpcshell-tests are run in javascript without any chrome present. this makes them especially useful for testing at the component / module level. xpcshell-tests are the quickest tests to...
... are the quickest tests to run. mailnews provides additional facilities as described on the mailnews automated testing page (see below). "make check" is used to run compiled code tests. these tests can go beyond the limitations of xpcshell-tests (for example, access c++ code) and other testing options that don't test at the right level. testing frameworks the asynctestutils extended framework supports: asynchronous test operation: a reasonably convenient means of writing tests that involve asynchronous operations by using generators. in the long term we would like to lose this extra complexity in favor of the event-loop-spinning style of operation used by mozmill. message synthesis: create messages by specifying what properties the messages should have. message injection: inject synt...
...tra complexity in favor of the event-loop-spinning style of operation used by mozmill. message synthesis: create messages by specifying what properties the messages should have. message injection: inject synthesized messages via local or imap (using a fake server). message manipulation: mark messages as read, tag them, untag them, move them to other folders, trash them, etc. enhanced logging: supports generating rich json streams to disk or over the network for consumption by logsploder or other tools. performance testing mail leak and bloat tests these tests start up thunderbird or seamonkey and record any leaks found, as well as the total memory requirement. although currently based on simple tests, these are useful for determining if new leaks have been introduced. for more inform...
Midas
introduction midas is the code name for gecko's built-in rich text editor. midas can be enabled via javascript on an html document. when midas is enabled, the document becomes editable by the user. scripting for midas is based on the dhtml commands supported by internet explorer. internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko. internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable. once midas is invoked, a few more methods of the document object become available. you can try demo of this here. properties document.designmode by setting this prop...
...mmand can be executed on the document in its current state. document.querycommandindeterm determines whether the current selection is in an indetermined state. document.querycommandstate determines whether the given command has been executed on the current selection. document.querycommandvalue determines the current value of the document, range, or current selection for the given command. supported commands command value description backcolor a color code. this command will set the background color of the document. bold if there is no selection, the insertion point will set bold for subsequently typed characters. if there is a selection and all of the characters are already bold, the bold will be removed. otherwise, all selected chara...
...nd generate css style attribute if the stylewithcss command is true. subscript if there is no selection, the insertion point will set subscript for subsequently typed characters. if there is a selection and all of the characters are already subscripted, the subscript will be removed. otherwise, all selected characters will be drawn slightly lower than normal text. superscript if there is no selection, the insertion point will set superscript for subsequently typed characters. if there is a selection and all of the characters are already superscripted, the superscript will be removed. otherwise, all selected characters will be drawn slightly higher than normal text. underline if there is no selection, the insertion point will set ...
About NSPR
o various host environments. nspr20, an effort started in 1996, built on that original idea, though very little is left of the original code. (the "20" in "nspr20" does not mean "version 2.0" but rather "second generation".) many of the concepts have been reformed, expanded, and matured. today nspr may still be appropriate as the platform dependent layer under java, but its primary application is supporting clients written entirely in c or c++. how it works nspr's goal is to provide uniform service over a wide range of operating system environments. it strives to not export the lowest common denominator, but to exploit the best features of each operating system on which it runs, and still provide a uniform service across a wide range of host offerings. threads threads are the major featur...
...here are routines to convert to and from most well-known forms of ascii into the 64-bit nspr representation. memory management nspr provides api to perform the basic malloc, calloc, realloc and free functions. depending on the platform, the functions may be implemented almost entirely in the nspr runtime or simply shims that call immediately into the host operating system's offerings. ...
...the basic api is stable and expected to remain that way. nspr is functionally complete and has entered a mode of sustaining engineering. ...
NSS 3.15 release notes
has released network security services (nss) 3.15, which is a minor release. distribution information the hg tag is nss_3_15_rtm. nss 3.15 requires nspr 4.10 or newer. ...
...s_3_15_rtm/src/ new in nss 3.15 new functionality support for ocsp stapling (rfc 6066, certificate status request) has been added for both client and server sockets. tls client applications may enable this via a call to ssl_optionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2. it replaces function secitem_reallocitem, which is now declared as obsolete. support for single-operation (eg: not multi-part) symmetric key encryption and decryption, via pk11_encrypt and pk11_decrypt. certutil has been updated to support creating name constraints extensions. new functions in ssl.h ssl_peerstapledocspresponse - returns the server's stapled ocsp response, when used with a tls client socket that negotiated the status_request extension. s...
...e default handler should add appropriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidechannel. bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. dropped (32-bit) sparc v8 processor support on solaris. the shared library libfreebl_32int_3.so is no longer produced. bugs fixed in nss 3.15 this bugzilla query returns all the bugs fixed in nss 3.15: https://bugzilla.mozilla.org/buglist.cgi?list_id=6278317&resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.15 ...
NSS 3.30 release notes
arballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_rtm/src/ new in nss 3.30 new functionality in the pkcs#11 root ca module (nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true. applications that need to distinguish them from other other root cas, may use the exported function pk11_hasattributeset. support for callback functions that can be used to monitor ssl/tls alerts that are sent or received. new functions in cert.h cert_compareava - performs a comparison of two certava structures, and returns a seccomparison result. in pk11pub.h pk11_hasattributeset - allows to check if a pkcs#11 object in a given slot has a specific boolean attribute set. in ssl.h ssl_...
...tsessionticketkeypair - configures an asymmetric key pair, for use in wrapping session ticket keys, used by the server. this function currently only accepts an rsa public/private key pair. new macros in ciferfam.h pkcs12_aes_cbc_128, pkcs12_aes_cbc_192, pkcs12_aes_cbc_256 - cipher family identifiers corresponding to the pkcs#5 v2.1 aes based encryption schemes used in the pkcs#12 support in nss in pkcs11n.h cka_nss_mozilla_ca_policy - identifier for a boolean pkcs#11 attribute, that should be set to true, if a ca is present because of it's acceptance according to the mozilla ca policy notable changes in nss 3.30 the tls server code has been enhanced to support session tickets when no rsa certificate (e.g. only an ecdsa certificate) is configured. rsa-ps...
... attribute, that should be set to true, if a ca is present because of it's acceptance according to the mozilla ca policy notable changes in nss 3.30 the tls server code has been enhanced to support session tickets when no rsa certificate (e.g. only an ecdsa certificate) is configured. rsa-pss signatures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported. the pk12util tool now supports importing and exporting data encrypted in the aes based schemes defined in pkcs#5 v2.1. bugs fixed in nss 3.30 this bugzilla query returns all the bugs fixed in nss 3.30: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.30 compatibility nss 3.30 shared libraries are...
NSS 3.44 release notes
https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_rtm/src/ other releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate. ...
...her releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate. notable changes in nss 3.44 it is now possible to build nss as a static library (bug 1543545) initial support for building for ios. ...
...ock should make at most one sql query, rather than one for each attribute 1531236 - provide accessor for certcertificate.dercert 1536734 - lib/freebl/crypto_primitives.c assumes a big endian machine 1532384 - in nss test certificates, use @example.com (not @bogus.com) 1538479 - post-handshake messages after async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to build nss as a static library 1487597 - early d...
NSS 3.45 release notes
found, returns secsuccess and sets *results to null. if a failure is encountered while fetching any of the matching certificates, secfailure is returned and *results will be null. ...
...l note: in 3.45, selfserv does not yet support delegated credentials. see bug 1548360. note: in 3.45 the sslchannelinfo is left unmodified, while an upcoming change in 3.46 will set sslchannelinfo.authkeybits to that of the delegated credential for better policy enforcement. see bug 1563078. ...
... sslchannelinfo.authkeybits to that of the delegated credential for better policy enforcement. see bug 1563078. bug 1550579 - replace arm32 curve25519 implementation with one from fiat-crypto bug 1551129 - support static linking on windows bug 1552262 - expose a function pk11_findrawcertswithsubject for finding certificates with a given subject on a given slot bug 1546229 - add ipsec ike support to softoken bug 1554616 - add support for the elbrus lcc compiler (<=1.23) bug 1543874 - expose an external clock for ssl this adds new experimental functions: ssl_settimefunc, ssl_createantireplaycontext, ssl_setantireplaycontext, and ssl_releaseantireplaycontext. the experimental function ssl_initantireplay is removed. bug 1546477 - various changes in response to the ongoin...
NSS 3.47 release notes
hanges to default tls configuration the next nss team plans to make two changes to the default tls configuration in nss 3.48, which will be released in early december: tls 1.3 will be the default maximum tls version. see bug 1573118 for details. tls extended master secret will be enabled by default, where possible. see bug 1575411 for details. ...
...g 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) h...
...947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification not constant time bug 1578238 - handle invald tag sizes for ckm_aes_gcm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.2 records with large padding with sha384 hmac bug 1577448 - create additional nested s/mime ...
NSS 3.54 release notes
e 2020, which is a minor release. distribution information the hg tag is nss_3_54_rtm. nss 3.54 requires nspr 4.26 or newer. nss 3.54 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_54_rtm/src/ other releases are available in nss releases. notable changes in nss 3.54 support for tls 1.3 external pre-shared keys (bug 1603042). use arm cryptography extension for sha256, when available. (bug 1528113). certificate authority changes the following ca certificates were added: bug 1645186 - certsign root ca g2 sha-256 fingerprint: 657cfe2fa73faa38462571f332a2363a46fce7020951710702cdfbb6eeda3305 bug 1645174 - e-szigno root ca 2017 ...
...02 - verisign class 3 public primary certification authority - g3 sha-256 fingerprint: eb04cf5eb1f39afa762f2bb120f296cba520c1b97db1589565b81cb9a17b7244 a number of certificates had their email trust bit disabled. see bug 1618402 for a complete list. bugs fixed in nss 3.54 bug 1528113 - use arm cryptography extension for sha256. bug 1603042 - add tls 1.3 external psk support. bug 1642802 - add uint128 support for hacl* curve25519 on windows. bug 1645186 - add "certsign root ca g2" root certificate. bug 1645174 - add microsec's "e-szigno root ca 2017" root certificate. bug 1641716 - add microsoft's non-ev root certificates. bug 1621151 - disable email trust bit for "o=government root certification authority; c=tw" root. bug 1645199 - remove addtrust root cer...
... - g2" root certificate. bug 1618402 - remove symantec root certificates and disable email trust bit. bug 1640516 - nss 3.54 should depend on nspr 4.26. bug 1642146 - fix undefined reference to `port_zalloc_stub' in seed.c. bug 1642153 - fix infinite recursion building nss. bug 1642638 - fix fuzzing assertion crash. bug 1642871 - enable ssl_sendsessionticket after resumption. bug 1643123 - support ssl_exportearlykeyingmaterial with external psks. bug 1643557 - fix numerous compile warnings in nss. bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys. bug 1645479 - don't use secitem_makeitem in secutil.c. bug 1646520 - stricter enforcement of asn.1 integer encoding. this bugzilla query returns all the bugs fixed in nss 3.54: https://bugzilla.mozilla.o...
NSS Sample Code Sample1
r that will be used // to transport keys between the primary host and itself. this // key needs to exist long enough to be used to process the // response to a key transport request that is made to the primary // server. the example here shows how to create a permanent (token) // rsa key for this purpose. (this key will also be used for // storage of the keys, since nss does not support permanent symmetric // keys at the current time.) // 3. the secondary host sends its rsa public key to the primary host as // part of a request for a particular key, or to be added to a list // of secondary hosts. // 4. the administrator of the primary host verifies that the rsa key // that was received belongs to a valid secondary host. the adminstrator // may do this by chec...
...st for a particular key, or to be added to a list // of secondary hosts. // 4. the administrator of the primary host verifies that the rsa key // that was received belongs to a valid secondary host. the adminstrator // may do this by checking that the key was received in a signed email // message, or by checking a digest value with the adminstrator of the // secondary host. [need support for digest check values] // 5. the primary host exports (wraps) the symmetric key using the // secondary host's rsa key. the wrapped value is sent back to // the secondary host. // 6. the administrator of the secondary host verifies that the wrapped // key data came from the primary host. the same methods outlined // in step 4 may be used here. // 7. the secondary host unwraps th...
...metric key using the // secondary host's rsa key. the wrapped value is sent back to // the secondary host. // 6. the administrator of the secondary host verifies that the wrapped // key data came from the primary host. the same methods outlined // in step 4 may be used here. // 7. the secondary host unwraps the the key using its own rsa private key. // note: currently nss does not support permanent symmetric keys. // the secondary host may store the wrapped value that was received // from the primary in a file, and unwrap it each time the key is required // (such as at server startup). // nss actually has some support for permanent symmetric keys. however this // example will need to be modified somewhat in order to demonstrate it. // utility function to print hex d...
NSS environment variables
(1 to enable) enable auditing of activities of the nss cryptographic module in fips mode. audit data 3.11.2 nss_enable_pkix_verify boolean (any non-empty value to enable) use libpkix, rather than the old cert library, to verify certificates. 3.12 nss_fips string ("fips","true","on","1") will start nss in fips mode. 3.12.5 nss_hash_alg_support string specifies agorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. 3.12.3 nss_output_file string (filename) output file path name for the pkcs #11 module logger. default is stdout. 3.7 nss_sdb_use_cache string ("no","yes","auto") controls whether nss uses a loc...
...otiation if the peer's hello bears the tls renegotiation_info extension. this is the safe renegotiation. 3.12.5 modified in 3.12.6 nss_ssl_require_safe_negotiation boolean (1 to enable) it controls whether safe renegotiation indication is required for initial handshake. in other words a connection will be dropped at initial handshake if a server or client do not support safe renegotiation. the default setting for this option is false. 3.12.5 nss_ssl_server_cache_mutex_timeout integer (seconds) timeout time to detect dead or hung process in multi-process ssl server. default is 30 seconds. 3.4 nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypt...
... if not specified, default to relative symlinks (symlinks whose targets are relative pathnames). on windows, copies of files are always published. before 3.0 ns_use_gcc boolean (1 to enable) on systems where gcc is not the default compiler, this tells nss to build with gcc. before 3.0 nss_allow_sslkeylogfile boolean (1 to enable) enable nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable. as of nss 3.24 this is disabled by default. 3.24 nss_build_continue_on_error boolean (1 to enable) continue building nss source directories when a build error occurs. 3.12.4 nss_use_system_sqlite boolean (1 to enable) use the system installed...
NSS tools : crlutil
abase directory containing the certificate and key database files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in the same directory. -i crl-import-file specify the file which contains the crl to import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, cre...
...here: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer. this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl. * add revocation reason code extension: the reasoncode is a non-critical crl entry extension that identifies the reason for the certificate revocation.
...sion: the reasoncode is a non-critical crl entry extension that identifies the reason for the certificate revocation. reasoncode non-critical code where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date wher...
SSL functions
the nss home page links to additional ssl documentation. ...
... the nss home page links to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. ...
...inks to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (dxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr ...
NSS tools : crlutil
Mozilla › Projects › NSS › tools › crlutil
e files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in the same directory. -i crl-import-file specify the file which contains the crl to import -f password-file specify a file that will automatically supply the password to include in a certificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname ...
...names: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer. this extension allows users to easily determine when a particular crl supersedes another crl crlnumber non-critical number where: crlnumber: identifies the name of an extension critical: should be set to 0 since this is non-critical extension number: value of long which identifies the sequential number of a crl. * add revocation reason code extension: the reasoncode is a non-critical crl entry extension that identifies the reason for the ce...
...e is a non-critical crl entry extension that identifies the reason for the certificate revocation. reasoncode non-critical code where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-crit...
SpiderMonkey Build Documentation
debug build instead, as described below.) cd js/src # this name should end with "_opt.obj" to make the version control system ignore it. mkdir build_opt.obj cd build_opt.obj /bin/sh ../configure.in # use "mozmake" on windows make a few notes about this: the most common build problems are dependency problems. see the build prerequisites page for your platform. spidermonkey does not support building in your source directory. you must configure and build in a separate build directory, as shown above. note: if you are on mac and getting an error similar to "checking whether the c compiler (gcc-4.2 ) works... no configure: error: installation or configuration problem: c compiler cannot create executables." you can try configuring like so: cc=clang cxx=clang++ ../configur...
...following will pass the -g3 flag to the compiler, causing it to emit debug information about macros. then you can use those macros in gdb commands: $ cxxflags=-g3 $src/configure ... checking whether the c++ compiler (c++ -g3 ) works... yes ... $ cross-compiling options for cross-compiling you will need a cross-compiling compiler. that tends to be easier with clang as clang has cross-compiling support built in. you may need other libraries though. for example on debian linux you'll need the following to cross compile from x86_64 to x86. apt install clang libstdc++-8-dev-i386-cross binutils-i686-gnu zlib1g-dev:i386 you'll also need rust, in addition to having normal rust set up you'll need to add another target to your existing rust toolchain (don't add a new toolchain spidermonkey will ...
...-run configure. building your application while "how to build your complete application" is clearly out of scope for this document, here are some tips that will help get you on your way: the spidermonkey developers frequently and deliberately change the jsapi abi. you cannot use headers built for one version/configuration of jsapi to create object files which will be linked against another. support for js_threadsafe was recently removed, and threadsafe builds are now enabled by default. the js-config script, described below, is the recommended way to determine correct include paths, required libraries, etc. for your embedding to use during compilation. we highly recommend calling the js-config script from your embedding's makefile to set your cflags, ldflags, and so forth. to install ...
JSAPI reference
herwise the garbage collector will not find all reachable objects and may collect objects that are still reachable, leading to a crash. (in spidermonkey 1.7 and earlier, the jsmarkop hook was used instead. this has since been removed.) the tracing apis are used by the garbage collector and jstraceop hooks. jsapi applications may also use them to examine the object graph. ...
...sg added in spidermonkey 17 js_psgs added in spidermonkey 17 js_self_hosted_get added in spidermonkey 31 js_self_hosted_getset added in spidermonkey 31 js_ps_end added in spidermonkey 17 jsfastnative added in spidermonkey 1.8 obsolete since javascript 1.8.5 the behavior of a jsclass can be customized using these flags: jsclass.flags jsclass_has_private jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 jsclass_implements_barriers added in spidermonkey 17 jsclass_emulates_undefined added in spidermonkey 24 jsclass_has_reserved_slots(n) jsclass_global_flags jsclass_new_enumerate obsolete since jsapi 37 jsclass_new_resolve obsolete since jsapi 36 jsclass_share_all_properties obsolete since javascript 1.8.5 jsclass_new_r...
...8 added in spidermonkey 1.8.1 security callbacks are set per-runtime. jssecuritycallbacks js_getsecuritycallbacks added in spidermonkey 13 js_setsecuritycallbacks added in spidermonkey 13 js_setcontextsecuritycallbacks obsolete since jsapi 13 js_getruntimesecuritycallbacks obsolete since jsapi 13 js_setruntimesecuritycallbacks obsolete since jsapi 13 threading the following functions support the spidermonkey threading model. note: js_threadsafe is now permanently on and the jsruntime is single-threaded. to execute more than one js script at once, use multiple jsruntimes. jsapi 1.7 and earlier they are only available in js_threadsafe builds. added in spidermonkey 1.8 these functions are always available, but in non-js_threadsafe builds, they do nothing. js_beginrequest js...
SpiderMonkey 1.8.8
and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —insert-actual-release-date-here platform support spidermonkey 1.8.8 is supported on all the platforms where firefox insert-actual-firefox-version-number-here runs. spidermonkey 1.8.8 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other...
...erwise <stdint.h> is used. the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio. in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010. in the meantime moz_custom_stdint_h is intended to function as a bridge to always using the standard header. for more information on the fixed-size integer types changes, see this blog post. new c apis ...list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have be...
...future direction include-followup-on-experimental-library-versioning-scheme-here spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 17
compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — 25 march 2013 platform support spidermonkey 17 is supported on all the platforms where firefox 17 runs. spidermonkey 17 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javasc...
...erwise <stdint.h> is used. the environment variable is provided as a solution for embedders whose code requires particular definitions of those types, and those particular definitions are incompatible with the standard definitions or the custom implementation needed for older versions of visual studio. in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010. in the meantime moz_custom_stdint_h is intended to function as a bridge to always using the standard header. for more information on the fixed-size integer types changes, see this blog post. new c apis ...list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have be...
...future direction include-followup-on-experimental-library-versioning-scheme-here spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. in the future every api is going to take handles instead of raw pointers. exact stack rooting is requirement for a (moving) generational garbage collector. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don...
Split object
problem posed by the window object. three interrelated requirements on the window object seemed to conflict. the window object is the global object for scripts in web pages. firefox has to maintain this for web compatibility. for performance, access to global properties must be fast. there is a glaring difference in the lifetime of the window object as seen from two different angles. suppose a script in page a, in tab ta, has a reference to the window object of page b in another tab tb. the window object for tab tb must persist as the user navigates from page to page in that tab. to the script in page a, the window must appear to be a single object that moves from page to page. but each web page must load with fresh globals. (the problem is even a bit subtler than this, since t...
...rom page to page in that tab. to the script in page a, the window must appear to be a single object that moves from page to page. but each web page must load with fresh globals. (the problem is even a bit subtler than this, since the reference may be direct or indirect. the script in a might have opened tb by calling window.open, which returns a direct reference to tb's window. more indirectly, suppose there's a javascript function defined in page b that refers to global variables in page b. if page a gets a reference to that function, then by calling it, it is indirectly accessing tab tb's window. the function object carries a reference to the window, via the scope chain. to further complicate matters, a and b are in the same security domain, so security checks between them automatically s...
...t, spidermonkey returns the inner object instead. inner and outer objects are in certain other respects the same object: if object.hasownproperty is called on an inner object, and the named property is found on an outer object, that's considered close enough and hasownproperty returns true. note that none of the rules listed here affects ordinary property accesses. spidermonkey's split object support, by itself, does not cause inner object properties to appear on the outer object or vice versa. split objects that need this behavior must implement it in custom jsclass hooks. in the case of window, each half has custom hooks. ...
Thread Sanitizer
the default way of symbolizing the traces is much slower than using llvm-symbolizer for that purpose: llvm ships with a symbolizer binary that tsan will readily use to immediately output symbolized traces much faster. furthermore, additional debug information is included in traces when llvm-symbolizer is used. to use it, either make sure the llvm-symbolizer binary is ...
...ign and fixing them would cause possible performance issues. tsan offers two possibilities to ignore such known races. compile-time blacklisting functions with racy memory access can be flagged, such that the compiler will not instrument them. in our codebase, this is done using the moz_tsan_blacklist macro on the function definition. it will expand to the appropriate attributes if the compiler supports them. compile-time blacklisting is the preferred way of blacklisting, because it does not have a performance impact. still, blacklisting should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtime suppression list. this list is a good tool to temporarily hide some traces, especially for debugg...
...cklisting, because it does not have a performance impact. still, blacklisting should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtime suppression list. this list is a good tool to temporarily hide some traces, especially for debugging purposes. however, unlike compile-time blacklisting, runtime suppressions do have a performance impact, especially if the race in question keeps showing up a lot. for more information on how to use the runtime suppression list, see the tsan wiki. ...
Animated PNG graphics
Mozilla › Tech › APNG
authors the apng specification was authored by: stuart parmenter <pavlov@pavlov.net> vladimir vukicevic <vladimir@pobox.com> andrew smith <asmith15@littlesvr.ca> overview apng is an extension of the portable network graphics (png) format, adding support for animated images. it is intended to be a replacement for simple animated images that have traditionally used the gif format, while adding support for 24-bit images and 8-bit transparency. apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet. apng is backwards-compatible with png; any png decoder should be able to ignore the apng-specific chunks and display a single image. terminology the default image is the image described by the standard 'idat' chunks, an...
...is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet. apng is backwards-compatible with png; any png decoder should be able to ignore the apng-specific chunks and display a single image. terminology the default image is the image described by the standard 'idat' chunks, and is the image that is displayed by decoders that do not support apng. the canvas is the area on the output device on which the frames are to be displayed. the contents of the canvas are not necessarily available to the decoder. as per the png specification, if a 'bkgd' chunk exists it may be used to fill the canvas if there is no preferrable background. the output buffer is a pixel array with dimensions specified by the width and height parameters of th...
...s region (x,y,width,height) must lie completely within the parent png canvas fixed dispose_op description (after, not before) changed dispose_op to render_op; added disposal description; added blend flag changed delay_time to a delay numerator and denominator, for specifying delays that don't into integer numbers of milliseconds. added note to clarify that palette animation is not supported. removed start_frame from actl; require fctl for frame 0; added skip_frame fctl flag. from 0.4 reintroduced num_frames into actl moved sequence_number from adat into fctl changed contents of adat to fctl+idats+fend added clarifications on what's allowed and what isn't renamed actl to actl, fctl to fctl, adat to fdat and fend to fend to comply with the png spec chunk...
Accessibility API Implementation Details
this article (from 2007) reviews the progress and technology as it has developed. ...
...this article (from 2007) reviews the progress and technology as it has developed. ...
...this article (from 2007) reviews the progress and technology as it has developed. ...
XPCOM changes in Gecko 2.0
les were loaded and called, asking them to register themselves. if you used xpcomutils.jsm, some of this was hidden from you, but it was still there. starting in gecko 2, however, components are registered using manifest files, similarly to how chrome is registered. in fact, the same chrome manifest file will be used to register components. all existing xpcom components will need to be updated to support this. however, it's very easy to do, and you can actually support both types of registration for backward compatibility. component manifests all component registration is now handled through manifest files. for extensions, this is the same chrome.manifest currently used to register chrome. xpt files the path of any xpt files must be listed explicitly in a manifest using an interfaces directiv...
...ur life would be much easier over the long term if you switch to using js-ctypes instead. also note that extensions using binary components must now use the unpack property in the install manifest. platform-specific directories the component/chrome system used to look in platform-specific subdirectories of an extension, such as platform/winnt_x86-msvc/chrome.manifest on windows. this is no longer supported. you can use the os and abi chrome registration directives to achieve the same effect: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means that ...
...ading their manifests, loading their components, and continuing the startup process, all without having to restart the browser. electrolysis content processes can simply read the component registrations during startup. xpcnativewrapper changes you can't disable xpcnativewrappers from your manifest specifying xpcnativewrappers=no in your manifest (that is, xpcnativewrapper automation) is no longer supported. this was always intended to be a short-term workaround to allow extensions to continue to work while their authors updated their code to use xpcnativewrappers. if your add-on depends upon xbl bindings attached to content objects—for example, the ability to call functions or get and set properties created by the xbl binding—you will need to use the xpcnativewrapper property wrappedjsobj...
XPCOM glue classes
ptr, it is the responsibility of the object itself to implement reference counting. ...
...ference counting. ...
...g. ...
mozIRegistry
warning: the content of this article may be out of date. it appears to be a design document for something that never got implemented. introduction the title of this document is completely misleading. it's not really about any "registry interface" so much as it's about how mozilla supports a more dynamic binding between interface clients and the code that actually provides the implementation of those interfaces. it happens that this objective requires storing information about which implementation to use in a place distinct from your source code. and it happens that we've chosen, up till now, to store that information in the "netscape registry" file. which explains how this information came to be associated with the notion of a "registry." someday (i hope) this page will be pr...
...h implementation to use in a place distinct from your source code. and it happens that we've chosen, up till now, to store that information in the "netscape registry" file. which explains how this information came to be associated with the notion of a "registry." someday (i hope) this page will be properly titled so that everybody knows it is the place to come to in order to find out how they are supposed to link together the various xpcom components that together form the mozilla browser. the information below is intended to tell you everything you need to know about how to do that. summary clients will rely on nsrepository to create instances of a given class. clients requiring dynamic "binding" of clsids will be required to use some higher-level services (tbd) to figure out the clsids t...
...ng out an appropriate implementation given some arbitrary desired properties. nsrepository this is basically the same as is provided today (see mozilla/xpcom/public/nsrepository.h). the primary change to this component is that we will modify it to utilize the new moziregistry interface versus the nsreg.h functions it calls today. in addition, it likely will have a couple of minor extensions: support for specifying the .reg file name on initialize(). i think this might make it a little more flexible, thereby making xpcom more general-purpose. adding support so that the underlying moziregistry implementation can be tailored by the initializer (client application). this is so that one can choose the basic libreg-based registry implementation versus a more advanced, e.g., rdf-based, one.
mozISpellCheckingEngine
the built in hunspell engine has contract id "@mozilla.org/spellchecker/engine;1". extensions can use this interface to check spelling or provide its own spell checker to editors. ...
...the built in hunspell engine has contract id "@mozilla.org/spellchecker/engine;1". extensions can use this interface to check spelling or provide its own spell checker to editors. ...
...word a word to check for correct spelling. return value returns true if word is spelled correctly according to the dictionary attribute, and returns false if word is misspelled. getdictionarylist() gets the list of dictionaries. void getdictionarylist( [array, size_is(count)] out wstring dictionaries, out pruint32 count ); parameters dictionaries a list of dictionaries supported by this spell checker. the dictionary attribute can be set to one of these. each dictionary name is typically but not always a locale code. count the length of dictionaries. removedirectory() removes all the dictionaries in the specified directory from the spell checker. void removedirectory( nsifile dir ); parameters dir an nsifile object indicating the dir...
nsIAccessibleStates
constants state constants msaa state flags - used for bitfield. more than 1 allowed. constant value description state_unavailable 0x00000001 the object is unavailable, that is disabled. ...
..._focusable 0x00100000 the object can be focused. state_selectable 0x00200000 the object can be selected. state_linked 0x00400000 the object is formatted as a hyperlink. the object role will usually be role_text_leaf. (see nsiaccessiblerole.constants). state_traversed 0x00800000 the object is a hyperlink that has been visited (previously clicked) by a user. state_multiselectable 0x01000000 supports multiple selection. state_extselectable 0x02000000 supports extended selection. state_alert_low 0x04000000 this information is of low priority. state_alert_medium 0x08000000 this information is of medium priority. state_alert_high 0x10000000 this information is of high priority. state_protected 0x20000000 maps to gnome's role* atk_role_passwd_text, nothing for java? state_haspopu...
... 0x20000000 maps to gnome's role* atk_role_passwd_text, nothing for java? state_haspopup 0x40000000 new in msaa 2.0. state_required state_alert_low state_important state_alert_medium currently unused. state_invalid state_alert_high indicates a validation failure. state_checkable state_marqueed extended state constants extended state flags (for now non-msaa, for java and gnome/atk support) constant value description ext_state_supports_autocompletion 0x00000001 for editable areas that have any kind of auto completion. ext_state_defunct 0x00000002 object no longer exists. ext_state_selectable_text 0x00000004 for text which is selectable, object must implement nsiaccessibletext. ext_state_editable 0x00000008 implements nsiaccessibleeditabletext. ext_state_active 0x00...
nsIArray
provides basic functionality for retrieving elements at a specific position, searching for elements. indexes are zero-based, such that the last element in the array is stored at the index length-1. for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. the convention is that the elements of the array should not be modified. documentation within a specific interface should describe variations from this convention. ...
...hin a specific interface should describe variations from this convention. it is also convention that if an interface provides access to an nsiarray, that the array should not be queryinterfaced to an nsimutablearray for modification. if the interface in question had intended the array to be modified, it would have returned an nsimutablearray! null is a valid entry in the array, and as such any nsisupports parameters may be null, except where noted. method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array. read ...
... the array. exceptions thrown ns_error_failure if the array is empty (to make it easy to detect errors). ns_error_out_of_memory if there is not enough memory to complete the operation. indexof() get the position of a specific element. note that since null is a valid input, exceptions are used to indicate that an element is not found. unsigned long indexof( in unsigned long startindex, in nsisupports element ); parameters startindex the initial element to search in the array. to start at the beginning, use 0 as the startindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array. exceptions thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, a...
nsIAuthModule
netwerk/base/public/nsiauthmodule.idlscriptable this interface is intended to be used as server and client authentication service. ...
... voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the data received from the server. aintokenlength the length of the input token. aouttoken a buffer containing the plaintext data from the server. aouttokenlength the length of the output token buffer. exceptions thrown ns_error_not_implemented if the underlying authentication mechanism does not support security layers. wrap() once a security context has been established through calls to getnexttoken() it may be used to protect data exchanged between client and server. calls to this method are used to protect items of data to be sent to the server. void wrap( [const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned ...
... server. aintokenlength the length of the input token. confidential if set to true, it will encrypt the data, otherwise data will just be integrity protected (checksummed). aouttoken a buffer containing the resulting data to be sent to the server. aouttokenlength the length of the output token buffer. exceptions thrown ns_error_not_implemented if the underlying authentication mechanism does not support security layers. ...
nsIAuthPrompt2
it can be used to prompt users for authentication information, either synchronously or asynchronously. this interface is implemented by @mozilla.org/login-manager/prompter;1. ...
...usly or asynchronously. this interface is implemented by @mozilla.org/login-manager/prompter;1. to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be sent unencrypted. no security provided. level_pw_encrypted 1 password will be sent encrypted, but the co...
...t throw when the prompt could already be potentially shown to the user. in that case information about the failure has to come through the callback. this way we prevent multiple dialogs shown to the user because consumer may fall back to synchronous prompt on synchronous failure of this method. nsicancelable asyncpromptauth( in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthinformation authinfo ); parameters achannel the channel that requires authentication. acallback acontext level one of the level constants. authinfo authentication information object. the implementation should fill in this object with the information entered by the user before returning. return value promptauth() requests a us...
nsIBadCertListener2
security/manager/ssl/public/nsibadcertlistener2.idlscriptable this interface is used to is report a broken ssl status. it can also be used to obtain the ssl handshake status of a connection that will be canceled because of improper certificate status. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) replaces the obsolete nsibadcertlistener interface. method overview boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status. boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communicati...
...info, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status. boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection. ...
...rmation about the active connection. this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces. status the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message related to the bad cert (the connection will still get canceled). see also nsisockettransport ...
nsIBrowserSearchService
netwerk/base/public/nsibrowsersearchservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/browser/search-service;1. to access this service, use: var browsersearchservice = components.classes["@mozilla.org/browser/search-service;1"] .getservice(components.interfaces.nsibrowsersearchservice); attempting to use any method or attribute of this interface before init() has completed will force the service to fall back to a slower, synchronous, initialization. this is not an issue if your code is executed in reaction to a user interaction, as initialization is complete b...
...e is hidden. may be null if there are no visible search engines. read only. originaldefaultengine nsisearchengine the original default engine. this differs from the "defaultengine" attribute in that it always returns a given build's default engine, regardless of whether it is hidden. read only. methods addengine() adds a new search engine from the file at the supplied uri, optionally asking the user for confirmation first. if a confirmation dialog is shown, it will offer the option to begin using the newly added engine right away; if no confirmation dialog is shown, the new engine will be used right away automatically. void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallca...
...og is shown, the new engine will be used right away automatically. void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's description file. datatype an integer representing the plugin file format. must be one of the supported search engine data types defined above. iconurl a url string to an icon file to be used as the search engine's icon. this value may be overridden by an icon specified in the engine description file. confirm a boolean value indicating whether the user should be asked for confirmation before this engine is added to the list. if this value is false, the engine will ...
nsIController
void docommand( in string command ); parameters command the name of the command to execute. ...
...void docommand( in string command ); parameters command the name of the command to execute. ...
... in string command ); parameters command the name of the command whose availability is to be checked. return value return true if the specified command is currently available to be used; otherwise, it should return false. onevent() implement this method to process the event with the specified name. void onevent( in string eventname ); parameters eventname the name of the event to process. supportscommand() implement this method to report whether or not the command with the specified name is supported. boolean supportscommand( in string command ); parameters command the name of the command to determine whether or not it is supported. return value true if the specified command is supported; otherwise false. see also nsicommandcontroller nsicontrollers xul tutorial/commands ...
nsICookieService
this separation of interface is mainly historical. ...
...e provided to ensure that the cookie privacy preferences are honored. return value returns the resulting cookie string. getcookiestringfromhttp() get the complete cookie string associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. getcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, so getcookiestring() can be used in place of this method. string getcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirsturi the uri that the user originally typed in or clicked on to initiate the load of the document referenced by auri. achannel the chan...
...t is strongly recommended that a non-null value be provided to ensure that the cookie privacy preferences are honored. setcookiestringfromhttp() set the cookie string and expires associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. setcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, and setcookiestring() could also query the date header from the channel if achannel supports nsihttpchannel. void setcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string acookie, in string aservertime, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirsturi the uri th...
nsIDOMOfflineResourceList
ces to be cached locally for use while offline. it includes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource list. dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article. ...
...er an event listener to be called when resources are being downloaded into the cache. onprogress nsidomeventlistener an event listener to be called periodically throughout the download process. onupdateready nsidomeventlistener an event listener to be called when a resource update is ready; this event is not currently used since versioned application caches aren't supported yet. oncached nsidomeventlistener an event listener to be called when caching is complete. status unsigned short one of the application cache state constants indicating the status of the application cache. constants application cache state constants constant value description uncached 0 the object isn't associated with an ...
... cache, the cache entry is removed. void mozremove( in domstring uri ); parameters uri the uri of the item to remove from the list. swapcache() swaps in the newest version of the application cache. the newest version of resources are updated on first refresh. this means already loaded resources should only update after a page refresh. note: versioned application caches are not yet supported; this method will throw an exception. void swapcache(); parameters none. update() begins the application cache update process. this will check for a new cache manifest but will not tell the browser to use the updated cache. void update(); parameters none. see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheservice nsi...
getFile
grecomsd" platform-specific locations some symbolic names represent platform-specific locations. the following sections cover these. available on both mac and unix these locations are available on both mac os x and unix implementations of gecko. c constant string value notes ns_os_system_dir "sysd" available on mac os x only these locations are supported only on mac os x versions of gecko. c constant string value notes ns_mac_desktop_dir ns_os_desktop_dir ns_mac_trash_dir "trsh" ns_mac_startup_dir "strt" ns_mac_shutdown_dir "shdwn" ns_mac_apple_menu_dir "applmenu" ns_mac_control_panels_dir "cntlpnl" ns_mac_extens...
... c constant string value notes ns_win_windows_dir "wind" ns_win_program_files_dir "progf" ns_win_home_dir ns_os_home_dir ns_win_desktop_dir "deskv" virtual folder at the root of the namespace ns_win_programs_dir "progs" user start menu programs direct...
... c constant string value notes ns_unix_local_dir "locl" ns_unix_lib_dir "libd" ns_unix_home_dir ns_os_home_dir the following locations are provided only on os/2 builds of gecko. deprecated these locations have been deprecated and should no longer be used. c constant stri...
nsIEditor
« xpcom api reference editor/nsieditor.idlscriptable provides methods and attributes used when editing page content. ...
... inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers); document info and file methods void rese...
... returns true if the document is modifed and needs saving. flags unsigned long edit flags for this editor. may be set at any time. isdocumenteditable prbool read only. returns true if we have a document that is not marked read-only. isselectioneditable boolean read only. true if the current selection anchor is editable; otherwise false. this helps to support cases where only parts of the document are editable, by letting you see if the current selection is in an editable section. rootelement nsidomelement read only. the root editable element, which for a document is its body. selection nsiselection read only. the selection/caret for this editor. in the case of a design mode document, this is the same as the window's...
nsIFrameScriptLoader
methods void loadframescript(in astring aurl, in boolean aallowdelayedload, [optional] in boolean aruninglobalscope) void removedelayedframescript(in astring aurl); jsval getdelayedframescripts(); loadframescript() load a script in the remote frame. frame scripts are loaded as soon as loadframescript() is called. ...
... well. frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. if you want a frame script to do something whenever a new document is loaded, you can listen for the document-element-inserted notification. parameters name type description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadframescript() call, until removedelayedframescript() is called for that script. aruninglobalscope boolean optional, defaults to false. by default, frame scripts each have their own scope, so...
...rame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag. removedelayedframescript() removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to remove. get...
nsIHapticFeedback
xpcom/system/nsihapticfeedback.idlscriptable implemented to provide support for haptic feedback (that is, vibration support). ...
... xpcom/system/nsihapticfeedback.idlscriptable implemented to provide support for haptic feedback (that is, vibration support). ...
... longpress 1 ...
nsIHttpChannel
ns_error_failure if set after the channel has been opened. redirectionlimit unsigned long this attribute specifies the number of redirects this channel is allowed to make. if zero, the channel will fail to redirect and will generate a ns_error_redirect_loop failure status. note: an http redirect results in a new channel being created. if the new channel supports nsihttpchannel, then it will be assigned a value to its redirectionlimit attribute one less than the value of the redirected channel's redirectionlimit attribute. the initial value for this attribute may be a configurable preference (depending on the implementation). referrer nsiuri get or set the uri of the http referer: header. this is the address (uri) of the ...
...der( in acstring aheader, in acstring avalue, in boolean amerge ); parameters aheader the case-insensitive name of the request header to query (for example "cookie"). avalue the request header value to set (for example "x=1"). amerge if true, the new header value will be merged with any existing values for the specified header. this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value). the list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of avalue. exceptions thrown ns_error_in_progress if called after the channel has been opened. ns_error_failure if called during visitrequestheaders(). ...
... in acstring header, in acstring value, in boolean merge ); parameters header the case-insensitive name of the response header to set(for example "cache-cookie"). value the response header value to set (for example "no-cache"). merge if true, the new header value will be merged with any existing values for the specified header. this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value). the list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of value. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). ns_error_illegal_value if ch...
nsILoadGroup
netwerk/base/public/nsiloadgroup.idlscriptable a load group maintains a collection of nsirequest objects. inherits from: nsirequest last changed in gecko 1.7 method overview void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set). read only. defaultloadrequest nsirequest accesses the default load request for the group. each time a number of requests are added to a group, the defaultloadrequest ...
...request() adds a new request to the group. this will cause the default load flags to be applied to the request. if this is a foreground request then the groupobserver's onstartrequest will be called. if the request is the default load request or if the default load request is null, then the load group will inherit its load flags from the request. void addrequest( in nsirequest arequest, in nsisupports acontext ); parameters arequest the request to be added to the load group. acontext the context to be passed to the onstartrequest notification. removerequest() removes a request from the group. if this is a foreground request then the groupobserver's onstoprequest will be called. by the time this call ends, arequest will have been removed from the loadgroup, e...
... acontext the context to be passed to the onstartrequest notification. removerequest() removes a request from the group. if this is a foreground request then the groupobserver's onstoprequest will be called. by the time this call ends, arequest will have been removed from the loadgroup, even if this function throws an exception. void removerequest( in nsirequest arequest, in nsisupports acontext, in nsresult astatus ); parameters arequest the request to be removed from the load group. acontext the context to be passed to the onstoprequest notification. astatus the status to be passed to the onstoprequest notification. ...
nsILocalFile
read only. followlinks prbool determines whether or not the nsilocalfile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. persistentdescriptor acstring on some platforms, the value of nsif...
...excl with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. delete_on_close file will be deleted when closed. mode a unix-style file permissions value. for example, the octal value 0600 may be used to limit read and write access to the current user of the system. this parameter may be ignored on systems that do not support file permissions. return value if the file is successfully opened, returns a pointer to the prfiledesc created for the newly opened file. returns a null pointer if the open failed. example #include "prio.h" #include "nserror.h" #include "nsilocalfile.h" // read the contents of a nsilocalfile... nsresult readlocalfile(nsilocalfile *alocalfile) { prfiledesc *fd; nsresult rv = alocalf...
...d); if (ns_failed(rv)) return rv; char buf[512]; print32 n; while ((n = pr_read(fd, buf, sizeof(buf))) > 0) { // do something with n-byte block of data from file... } if (n < 0) rv = ns_error_unexpected; pr_close(fd); return rv; } reveal() ask the operating system to open the folder which contains this file or folder. this routine only works on platforms which support the ability to open a folder. see the note in the remarks below. void reveal(); parameters none. setrelativedescriptor() initializes the file to the location relative to fromfile using a string returned by getrelativedescriptor(). void setrelativedescriptor( in nsilocalfile fromfile, in acstring relativedesc ); parameters fromfile the file to which the descriptor is relative.
nsILocalFileMac
stant value description current_process_creator 0x8000000 use with setfiletype() to specify the signature of current process. obsolete since gecko 2.0 methods native code only!getcfurl note: observes the state of the followlinks attribute. if the file object is an alias and followlinks is true, returns the target of the alias. if followlinks is false, returns the unresolved alias file. note: supported only for xp_macosx. cfurlref getcfurl(); parameters none. return value the cfurlref of the file object. the caller is responsible for calling cfrelease() on it. native code only!getfsref note: observes the state of the followlinks attribute. if the file object is an alias and followlinks is true, returns the target of the alias. if followlinks is false, returns the unresolved alias file. n...
...d only for xp_macosx. cfurlref getcfurl(); parameters none. return value the cfurlref of the file object. the caller is responsible for calling cfrelease() on it. native code only!getfsref note: observes the state of the followlinks attribute. if the file object is an alias and followlinks is true, returns the target of the alias. if followlinks is false, returns the unresolved alias file. note: supported only for xp_macosx. fsref getfsref(); parameters none. return value the fsref of the file object. native code only!getfsspec note: observes the state of the followlinks attribute. if the file object is an alias and followlinks is true, returns the target of the alias. if followlinks is false, returns the unresolved alias file. fsspec getfsspec(); parameters none. return value the fsspec o...
... at any time. try to avoid using it. init this object to point to an application having the given creator code. if this app is missing, this will fail. it will first look for running application with the given creator. void inittoappwithcreatorcode( in ostype aappcreator ); parameters aappcreator the signature of the app. native code only!initwithcfurl init this object with a cfurlref. note: supported only for xp_macosx. note: if the path of the cfurl is /a/b/c, at least a/b must exist beforehand. void initwithcfurl( in cfurlref acfurl ); parameters acfurl the corefoundation url. native code only!initwithfsref init this object with an fsref. note: supported only for xp_macosx. void initwithfsref( [const] in fsrefptr afsref ); parameters afsref the native fsref. native code only...
nsILoginManagerStorage
toolkit/components/passwordmgr/public/nsiloginmanagerstorage.idlscriptable this interface is implemented by modules that wish to provide storage mechanisms for the login manager. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for example, if you wish to provide operating system integration with a native password manager system, implementing and registering a storage module for the login manager is how you do it. see creating a login manager storage module for details. note: extensions that simply want to access/store logins should use the login manager service and nsiloginmanager interface instead. the login manager will handle selecting and using the correct nsiloginmanange...
...ogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void init(); void initwithfile(in nsifile ainputfile, in nsifile aoutputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type description uibusy boolean true when a master password prompt is being s...
...odify an existing login in the login store. if newlogindata is specified as an nsilogininfo object, all of the old login's properties are changed to the values from the newlogindata parameter. if newlogindata is a nsipropertybag, only the properties specified in the nsipropertybag are changed in oldlogin and its corresponding nsiloginmetainfo. void modifylogin( in nsilogininfo oldlogin, in nsisupports newlogindata ); parameters oldlogin the login to be modified. newlogindata the login information to replace the oldlogin with. this may be specified as either an nsilogininfo or an nsipropertybag2 object. removealllogins() implement this method to remove all logins from the login store. this is called by the browser sanitization feature when the user asks to clear all stored passwords. th...
nsIMemoryMultiReporterCallback
xpcom/base/nsimemoryreporter.idlscriptable 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 description, in nsisupports closure); methods callback() called to provide information from a multi-reporter. ...
...in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure); methods callback() called to provide information from a multi-reporter. implement this method to handle the report information. void callback( in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter. path the value of the path attribute. kind the value of the kind attribute. units the value of the units attribute. amount the value of the amount attribute. ...
...it will be null if no additional data was provided. ...
nsIMicrosummaryService
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for managing installed microsummaries, and the bookmarks they apply to. ...
... toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for managing installed microsummaries, and the bookmarks they apply to. ...
...callable by content via nsisidebar.addmicrosummarygenerator(). void addgenerator( in nsiuri generatoruri ); parameters generatoruri the uri of the resource providing the generator. createmicrosummary() create a microsummary for a given page uri and generator uri. nsimicrosummary createmicrosummary( in nsiuri pageuri, in nsiuri generatoruri ); parameters pageuri ...
nsIMsgSearchSession
cope, and then call search(). ...
...script] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); [noscript] void addresultelement(in nsmsgresultelement element); boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); void addsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); attributes attribute type description searchterms nsisupportsarray readonly: numsearchterms unsigned long readonly: runningadapter nsimsgsearchadapter readonly: searchparam voidptr not scriptable and readonly: searchtype nsmsgsearchtype readonly: numresults long readonly: window nsimsgwindow constants name value description ...
.... void addscopeterm(in nsmsgsearchscopevalue scope, in nsimsgfolder folder); parameters scope folder adddirectoryscopeterm() void adddirectoryscopeterm(in nsmsgsearchscopevalue scope); parameters scope clearscopes() void clearscopes(); scopeusescustomheaders() call this function everytime the scope changes! it informs the fe if the current scope support custom header use. fes should not display the custom header dialog if custom headers are not supported. [noscript] boolean scopeusescustomheaders(in nsmsgsearchscopevalue scope, in voidptr selection, in boolean forfilters); parameters scope selection could be a folder or server based on scope forfilters isstringattribute() use thi...
nsINavBookmarkObserver
toolkit/components/places/nsinavbookmarksservice.idlscriptable this interface is an observer for bookmark changes. ...
...de its parent. onseparatorremoved() obsolete since gecko 1.9 (firefox 3) notify this observer that a separator has been removed. void onseparatorremoved( in print64 parent, in print32 index ); parameters parent the id of the separator's parent. index the separator's old index in its parent. using onbeforeitemremoved() in gecko 1.9.1 if you wish to support onbeforeitemremoved() in applications based on gecko 1.9.1, you must implement your observer's queryinterface() method to match on both nsinavbookmarkobserver and nsinavbookmarkobserver_mozilla_1_9_1_additions, as shown below. queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsinavbookmarkobserver_mozilla_1_9_1_additions) || iid.equals(c...
...onbeforeitemremoved() in applications based on gecko 1.9.1, you must implement your observer's queryinterface() method to match on both nsinavbookmarkobserver and nsinavbookmarkobserver_mozilla_1_9_1_additions, as shown below. queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsinavbookmarkobserver_mozilla_1_9_1_additions) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_error_no_interface; } see also places manipulating bookmarks using places nsinavbookmarksservice ...
nsINavHistoryBatchCallback
toolkit/components/places/public/nsinavhistoryservice.idlscriptable please add a summary to this article. ...
... toolkit/components/places/public/nsinavhistoryservice.idlscriptable please add a summary to this article. ...
... toolkit/components/places/public/nsinavhistoryservice.idlscriptable please add a summary to this article. ...
nsINavHistoryQuery
this was designed so that most queries can be done in only one sql query. ...
...this was designed so that most queries can be done in only one sql query. ...
...gintime prtime read only: retrieves the begin time value that the currently loaded reference points + offset resolve to. absoluteendtime prtime read only: retrieves the end time value that the currently loaded reference points + offset resolve to. annotation autf8string the annotation name. annotationisnot boolean test for existance or non-existance of a given annotation. we don't currently support >1 annotation name per query. if annotationisnot is true, we test for the non-existance of the specified annotation. testing for not annotation will do the same thing as a normal query and remove everything that doesn't have that annotation. asking for things that do have a given annotation is a little different. it also includes things that have never been visited. this allows place queries ...
nsINavHistoryResult
result objects represent the model in which the data is stored. external components provide the view and controller pieces of the puzzle; they define how the data looks and how the data is interacted with. ...
...is value before setting the sortingmode attribute. sortingmode unsigned short specifies the sorting mode for the result. this value must be one of nsinavhistoryqueryoptions.sort_by_*. changing this value updates the corresponding options for the result so that reusing the current options and queries will always return results based on the current view. suppressnotifications boolean if true, notifications are suppressed. this is used to prevent rapid flickering of changes when performing batch or temporary operations on the result structure. viewer nsinavhistoryresultviewer the viewer for this result. the viewer is responsible for actually updating the view object itself, as well as for handling events on the...
... parameters aobserver an object that implements the nsinavhistoryresultobserver interface, which will receive notifications of changes on the result. aownsweak if false, the result will keep an owning reference to the observer, which must be removed by calling removeobserver(). if true, the result will keep a weak reference to the observer, which must implement the nsisupportsweakreference interface. removeobserver() removes an observer that was added by a previous call to addobserver(). void removeobserver( in nsinavhistoryresultobserver aobserver ); parameters aobserver the observer to remove. see also nsinavhistoryresultobserver nsinavhistorycontainerresultnode ...
nsIObserver
xpcom/ds/nsiobserver.idlscriptable this interface is implemented by an object that wishes to observe notifications. these notifications are often, though not always, broadcast via the nsiobserverservice. inherits from: nsisupports last changed in gecko 0.9.6 method overview void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for. ...
... asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for. if you expect multiple topics/subjects, the implementor is responsible for filtering. you should not modify, add, remove, or enumerate notifications in the implementation of this method. void observe( in nsisupports asubject, in string atopic, in wstring adata ); parameters asubject in general reflects the object whose change or action is being observed. atopic indicates the specific change or action. adata an optional parameter or other auxiliary data further describing the change or action. remarks the specific values and meanings of the parameters provided varies widely, though, acco...
...hey can handle being called with unknown values for atopic. the most common implementation of nsiobserverservice is the xpcom observer service. with this implementation, it's safe (and common practice) for an implementation of nsiobserver to remove itself as an observer during the observe callback, or to add or remove other observers. be careful, though, because other uses of nsiobserver may not support these operations correctly within observe. example the following code is an implementation of nsiobserver that is registered to receive notifications for the "mytopicid" topic. see observer notifications for a list of built-in topics possible. observing preferences works slightly differently. see code snippets:preferences - using preference observers for an example. function myobserver()...
nsIProcessScriptLoader
the scripts run only once per process. the global object for process scripts is a contentprocessmessagemanager. methods void loadprocessscript(in astring aurl, in boolean aallowdelayedload) void removedelayedprocessscript(in astring aurl); jsval getdelayedprocessscripts(); loadprocessscript() load a script in the child process. process scripts are loaded as soon as loadprocessscript() is called. ...
...ilable at the time of the loadprocessscript() call, and if you pass false in this situation, your process script won't be loaded. for example: let ppmm = services.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if this flag is false, the process script will only be loaded into child processes that are already running at the time of the call. if this flag is true, the process script will be loaded into any new child processes created after the loadprocessscript() call, until removedelayedprocessscript() is called f...
...e of the call. if this flag is true, the process script will be loaded into any new child processes created after the loadprocessscript() call, until removedelayedprocessscript() is called for that script. if you are calling loadprocessscript() on a chromemessagesender, you should always pass true here. removedelayedprocessscript() removes aurl from the list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to remove. ...
nsIProperties
xpcom/ds/nsiproperties.idlscriptable this interface provides methods to access a map of named xpcom object values. inherits from: nsisupports last changed in gecko 1.2 implemented by: @mozilla.org/file/directory_service;1. to get an instance, use: var properties = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties); method overview void get(in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); void getkeys(out pruint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsisupports value); void undefine(in string prop); methods get() gets the xpcom object associated with a particular name. void get( in ...
... methods get() gets the xpcom object associated with a particular name. void get( in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result ); parameters prop the property name. iid the desired interface. result the resulting object instance. exceptions thrown ns_error_failure if the property does not exist. ns_error_no_interface if the property exists, but does not support the requested interface. getkeys() returns an array of property names. nsmemory.h defines the macro ns_free_xpcom_allocated_pointer_array, which can be used to free akeys when it is no longer needed. void getkeys( out pruint32 count, [array, size_is(count), retval] out string keys ); parameters count the length of the result array. keys the resulting array of keys. has() tests if a pr...
...), retval] out string keys ); parameters count the length of the result array. keys the resulting array of keys. has() tests if a property exists. boolean has( in string prop ); parameters prop the property name. return value true if the property exists, false if the property does not exist. set() sets the xpcom object associated with a particular name. void set( in string prop, in nsisupports value ); parameters prop the property name. value the xpcom object value to associate with prop. undefine() undefines a property. void undefine( in string prop ); parameters prop the property name. remarks this interface was frozen for gecko 1.2. see bug 162114 for details. from gecko 2.0 interfaces are no longer frozen. ...
nsIProtocolProxyService
netwerk/base/public/nsiprotocolproxyservice.idlscriptable this interface provides methods to access information about various network proxies. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/network/protocol-proxy-service;1. to access the service use: var pps = components.classes["@mozilla.org/network/protocol-proxy-service;1"] .getservice(components.interfaces.nsiprotocolproxyservice); method overview deprecated since gecko 18 nsiproxyinfo resolve(in nsiuri auri, in unsigned long aflags); nsicancelable asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags,...
... use resolveasync instead previous doc this method returns a nsiproxyinfo instance that identifies a proxy to be used for loading the given uri. otherwise, this method returns null indicating that a direct connection should be used. if this proxy is unavailable, getfailoverforproxy() may be called to determine the correct secondary proxy to be used. ...
... nsiproxyinfo resolve( in nsiuri auri, in unsigned long aflags ); parameters auri the uri to test. aflags a bit-wise combination of the resolve_ flags defined above. pass 0 to specify the default behavior. any additional bits that do not correspond to a resolve_ flag are reserved for future use. ...
nsIResumableChannel
netwerk/base/public/nsiresumablechannel.idlscriptable this interface is meant to be implemented by the channels that support resuming broken downloads (for example necko's html and ftp channels). inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() ...
... exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset. the request given to the nsistreamlistener will be qiable to nsiresumableinfo. void asyncopenat( in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download. entityid information about the file, to match before obtaining the file. pass an empty string to use anything. resumeat() prepare this channel for resuming. the request will not start until asyncop...
...obtaining the file. pass an empty string to use anything. resumeat() prepare this channel for resuming. the request will not start until asyncopen or open is called. calling resumeat after open or asyncopen has been called has undefined behaviour. during onstartrequest, this channel will have a status of ns_error_not_resumable if the file cannot be resumed, for example because the server doesn't support this. this error may occur even if startpos is 0, so that the front end can warn the user. similarly, the status of this channel during onstartrequest may be ns_error_entity_changed, which indicates that the entity has changed, as indicated by a changed entityid. in both of these cases, no ondataavailable will be called, and onstoprequest will immediately follow with the same status code. voi...
nsISelectionPrivate
this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date information. ...
...this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date information. ...
...in rangearray results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection. allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it. results returns the ranges that overlap (or touch) the input range. gettableselectiontype() test if supplied range points to a single table element. long gettableselectiontype( in nsidomrange range ); parameters range return value one of tableselection_* constants. "none" means a table element is not selected. removeselectionlistener() void removeselectionlistener( in nsiselectionlistener listenertoremove ); parameters listenertoremove scrollintoview() scrolls a regio...
nsISmsService
dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsservice;1. ...
...ms/smsservice;1"] .createinstance(components.interfaces.nsismsservice); method overview [implicit_jscontext] nsidommozsmsmessage createsmsmessage(in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long requestid, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); parameters id a n...
...ate object with the timestamp of the message. read a boolean indicating whether a message is marked as read or unread. return value a smsmessage getnumberofmessagesfortext() unsigned short getnumberofmessagesfortext( in domstring text ); parameters text a domstring text to check. return value the number of multi-part sms needed for a given text (160 characters for one sms). hassupport() checks if the current platform has sms support. boolean hassupport(); return value boolean. send() void send( in domstring number, in domstring message, in long requestid, in unsigned long long processid optional ); parameters number a domstring with a telephone number to send to. message a domstring with the text message. requestid missing description processid op...
nsISocketTransportService
netwerk/base/public/nsisockettransportservice.idlscriptable this interface provides a mapping between a socket type and its associated socket provider instance. one could also use the service manager directly. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/socket-transport-service;1. to create an instance, use: var sockettransportservice = components.classes["@mozilla.org/network/socket-transport-service;1"] .getservice(components.interfaces.nsisockettransportservice); method overview void attachsocket(in prfiledescptr afd, in nsasockethandlerptr ahandler); native code only! nsisockettransport createtransport(in array<acstring> asockettypes, in autf8string ahost, in long apor...
...socket is ready or detached. createtransport() creates a transport for a specified host and port. note: this function can be called from any thread. nsisockettransport createtransport( in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo ); parameters asockettypes array of socket type strings. currently "starttls", "ssl" and "udp" are supported. pass an empty array [] if the default socket type should be used. you do not need to specify the strings "socks" or "socks4", use the aproxyinfo instead. ahost specifies the target hostname or ip address literal of the peer for this socket. aport specifies the target port of the peer for this socket. aproxyinfo specifies the transport-layer proxy type to use. set to null if no proxy ...
... 1.5 / seamonkey 1.0) void shutdown(); parameters none. example // at first, we need a nsisockettransportservice .... ...
nsIStringBundle
it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. ...
...you may also use other formatting codes. you can only pass unicode strings in. the id should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf. wstring formatstringfromid( in long aid, [...
...unsigned long length ); parameters aid the id of the string to retrieve. params parameters to pass in to the string. length the length of the parameter list. return value returns the formatted string. formatstringfromname() returns a formatted string with the given key name from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. you may also use other formatting codes, but can only pass unicode strings in. the name should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf to do the dirty work. wstring formatstringfro...
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscriptable a service to gather performance data that can be tracked over time to allow generating histograms. ...
... .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); ...
...egisterevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data). this is true if the fhr data reporting service or the self-support service is enabled. canrecordextended boolean a flag indicating if telemetry is allowed to record extended data. returns false if the user has not opted into "extended telemetry" on the release channel, when the user has explicitly opted out of telemetry on nightly/aurora/beta or if manually set to false during tests. canrecordreleasedata readonly boolean a fla...
nsITransport
netwerk/base/public/nsitransport.idlscriptable this interface provides a common way of accessing i/o streams connected to some resource. this interface does not in any way specify the resource. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) this interface provides methods to open blocking or non-blocking, buffered or unbuffered streams to the resource. the name "transport" is meant to connote the inherent data transfer implied by this interface (that is, data is being transfered in some fashion via the streams exposed by this interface). a transport can have an event sink associated with it. the event sink receives transport-specific events as the transfer is occurring. for a socket transport, these events can include status...
...nd is not closed, then reading from it will block the calling thread until at least one byte is available or until the stream is closed. if this flag is not specified, then the stream has non-blocking stream semantics. this means that if the stream has no data and is not closed, then reading from it returns ns_base_stream_would_block. in addition, in non-blocking mode, the stream is guaranteed to support nsiasyncinputstream. this interface allows the consumer of the stream to be notified when the stream can again be read. open_unbuffered if specified, the resulting stream may not support readsegments. readsegments is only guaranteed to be implemented when this flag is not specified. asegmentsize if open_unbuffered is not set, then this parameter specifies the size of each buffer segment (pas...
... full and is not closed, then writing to it will block the calling thread until all of the data can be written or until the stream is closed. if this flag is not specified, then the stream has non-blocking stream semantics. this means that if the stream is full and is not closed, then writing to it returns ns_base_stream_would_block. in addition, in non- blocking mode, the stream is guaranteed to support nsiasyncoutputstream. this interface allows the consumer of the stream to be notified when the stream can again accept more data. open_unbuffered if specified, the resulting stream may not support writesegments and writefrom. writesegments and writefrom are only guaranteed to be implemented when this flag is not specified. asegmentsize if open_unbuffered is not set, then this parameter speci...
nsIUploadChannel
read only. methods setuploadstream() sets a stream to be uploaded by this channel. ...
...read only. methods setuploadstream() sets a stream to be uploaded by this channel. ...
...ute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel. read only. methods setuploadstream() sets a stream to be uploaded by this channel. most implementations of this interface require that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek(). history here is that we need to support both streams that already have headers (for example, content-type and content-length) information prepended to the stream (by plugins) as well as clients (composer, uploading application) that want to upload data streams without any knowledge of protocol specifications. for this reason, we have a special meaning for the acontenttype parameter. void setuploadstream( in nsiinputstream astream...
nsIVariant
xpcom/ds/nsivariant.idlscriptable xpconnect has magic to transparently convert between nsivariant and js types. we mark the interface [scriptable] so that js can use methods that refer to this interface. but we mark all the methods and attributes [noscript] since any nsivariant object will be automatically converted to a js type anyway. ...
... violates the xpcom interface guidelines print16 getasint16(); native code only! print32 getasint32(); native code only! print64 getasint64(); native code only! pruint8 getasint8(); native code only! void getasinterface(out nsiidptr iid, [iid_is(iid), retval] out nsqiresult iface); native code only! nsisupports getasisupports(); native code only! jsval getasjsval(); native code only! string getasstring(); native code only! void getasstringwithsize(out pruint32 size, [size_is(size), retval] out string str); native code only! pruint16 getasuint16(); native code only! pruint32 getasuint32(); native code only! ...
... pruint8 getasint8(); parameters none. return value if the internal value is a string, it is first converted to a double, if possible. if it within the numeric limits of a print8 then the value is returned. native code only!getasinterface void getasinterface( out nsiidptr iid, [iid_is(iid), retval] out nsqiresult iface ); parameters iid the iid of the interface pointer, or nsisupports if no iid was provided. iface the interface pointer. (the reference count of the object is incremented.) native code only!getasisupports nsisupports getasisupports(); parameters none. return value the interface pointer. (the reference count of the object is incremented.) native code only!getasjsval jsval getasjsval(); parameters none. return value returns the underlying js ...
nsIWebBrowser
embedding/browser/webbrowser/nsiwebbrowser.idlscriptable this interface is implemented by web browser objects. embedders use this interface during initialization to associate the new web browser instance with the embedders chrome and to register any listeners. the interface may also be used at runtime to obtain the content dom window and from that the rest of the dom. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) warning: this interface was frozen for a very long time, but was unfrozen for gecko 2.0. method overview void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute ...
...itooltiplistener to receive additional notifications from the browser object. the chrome object may optionally implement nsiwebprogresslistener instead of explicitly calling addwebbrowserlistener() and removewebbrowserlistener() to register a progress listener object. if the implementation does this, it must also implement nsiweakreference. note: the implementation should not refcount the supplied chrome object; it should assume that a non nsnull value is always valid. the embedder must explicitly set this value back to nsnull if the chrome object is destroyed before the browser object. note: nsiinterfacerequestor and nsiweakreference might also need to be implemented by the chrome object. contentdomwindow nsidomwindow the top-level dom window. the embedder may walk the...
...visible tab. defaults to true. for optimal performance, set it to false when appropriate. parenturicontentlistener nsiuricontentlistener uri content listener parent. the embedder may set this property to their own implementation if they intend to override or prevent how certain kinds of content are loaded. note: if this attribute is set to an object that implements nsisupportsweakreference, the implementation should get the nsiweakreference and hold that. otherwise, the implementation should not refcount this interface; it should assume that a non null value is always valid. in that case, the embedder should explicitly set this value back to null if the parent content listener is destroyed before the browser object. methods addwebbrowserlistener() registers ...
nsIWebProgressListener
uriloader/base/nsiwebprogresslistener.idlscriptable this interface is implemented by clients wishing to listen in on the progress associated with the loading of asynchronous requests in the context of a nsiwebprogress instance as well as any child nsiwebprogress instances. inherits from: nsisupports last changed in gecko 15 (firefox 15 / thunderbird 15 / seamonkey 2.12) nsiwebprogress describes the parent-child relationship of nsiwebprogress instances. method overview void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, [optional] in unsigned long aflags); void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in l...
...ited to document requests. (see below for a description of document requests.) other types of requests, such as requests for inline content (for example images and stylesheets) are considered normal requests. state_is_document 0x00020000 this flag indicates that the state transition is for a document request. this flag is set in addition to state_is_request. a document request supports the nsichannel interface and its loadflags attribute includes the nsichannel::load_document_uri flag. a document request does not complete until all requests associated with the loading of its corresponding document have completed. this includes other document requests (for example corresponding to html <iframe> elements). the document corresponding to a document request is available via...
...ow. ...
nsIXPCScriptable
ust guarantee that they set the *_retval of the various methods that return a boolean to pr_true before making the call. implementations may skip writing to *_retval unless they want to return pr_false. js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article. ...
...arious methods that return a boolean to pr_true before making the call. implementations may skip writing to *_retval unless they want to return pr_false. js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article. ...
...prop_mods_to_prototype 1 << 25 dont_share_prototype 1 << 26 dont_reflect_interface_names 1 << 27 want_equality 1 << 28 want_outer_object 1 << 29 want_inner_object 1 << 30 reserved 1 << 31 the high order bit is reserved for consumers of these flags. no implementor of this interface should ever return flags with this bit set. ...
nsIXULWindow
when the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer service. this signals the application in case it needs to quit. ...
...or this window. read only. intrinsicallysized boolean indicates if this window is instrinsically sized. primarycontentshell nsidocshelltreeitem the primary content shell. note: that this is a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. read only. xulbrowserwindow nsixulbrowserwindow provides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the enclosing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel ...
...ters achromeflags see nsiwebbrowserchrome. aappshell the app shell passed to nsiappshellservice's createtoplevelwindow method. return value the newly minted window. in the case of a content window, the function creates a browser window and waits for it to load. you can then load a document into the window's primary content shell. getcontentshellbyid() the content shell specified by the supplied id. note: that this is a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which ...
XPCOM tasks
12755, and bug 12755. p1 we would like to move to a scheme where no one writes queryinterface, and we save code-space with a table driven implementation. a first step is moving all qi implementations to the table-like macros already in place (and some slight modifications to those macros). see bug 23737 work is progressing on this. see in particular, the new ns_interface_map_... macros in "nsisupportsutils.h". p1 we need to use ns_get_iid instead of ns_define_iid. see bug 25886. work is progressing on this. p2 classes that parallel standard library classes should have compatible apis, i.e., nsdeque bug 18505 nsstring nsavltree nshashtable our various array classes in some cases, this might initially be provided by additional interfaces. in all cases, we want to transition the pr...
...plore the idea of using a separate registry. 5.1 if the build hierarchy were fixed, the registry could exploit expat and dbm. it could avoid implementing its own file format and io; and in many cases, possibly avoid calling into components for registration. in any case, the process of registration can, i think, be simplified. 5.1 should we provide type-safe templatized containers, e.g., over nsisupportsarray? 5.1 we want to provide some mechanism for user-specific components in a multi-user environment. 5.1 fix the shutdown issues that complicate life for embedding applications. things we need to evangelize we need to keep up-to-date documentation, samples, and have brown-bags to keep people informed. we've been doing this, but it should be in the plan. general xpcom guidelines. see,...
...ld be in the plan. general xpcom guidelines. see, e.g., xpcom code faq, idl author's guide, and implementing queryinterface. writing and using components and modules. building ownership models that work (see xpcom ownership guidelines), using raw pointers, nscomptr (see the nscomptr user's manual), nsiweakreference (see nsiweakreference), nscweakreference, and (across threads) proxies (see nsisupports proxies). original document information author(s): unknown last updated date: may 8, 2003 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla technologies
mozilla has several technologies used as components of its projects. these are documented here. accessibility api implementation detailsthese pages contain documentation on mozilla specific implementation details of assistive technology apis.animated png graphicsapng is an extension of the portable network graphics (png) format, adding support for animated images. apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell. at the moment, the transition from webshell to docshell is not fully completed, but the long-term goal is to remove webshell and switch over entirely to docshell.embedded dialog apifeed content access apifirefox ...
... with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file format invented by david mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source. starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and history management system introduced in firefox 3. it offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. it also includes new features including favicon storage and the ability to annotate pages with arbitrary information. it also introduces new user interfaces for managing all...
...microsoft com. it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.xpidlxpidl is an interface description language used to specify xpcom interface classes.xray visiongecko runs javascript 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 (javascript) to perform xslt 2.0.xtfthe extensible tag framework (xtf) allows adding support for new namespaces using xpcom components to mozilla (written in javascript or c++). for example, the mozilla xforms project uses xtf to add support for the xforms namespace. ...
Address Book examples
ork with remote address books (e.g. ldap). hence the additional !ab.isremote check how do i add/edit/delete contacts? note: not all address books can be written to. ...
...ardstodelete); how do i add and use my own properties? use the setproperty/getproperty functions on nsiabcard to set your property in the same way as you would do with normal properties: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ... my value = card.getproperty("random1"); note: local (mork) address books are currently the only built-in type of address book that supports saving of non-built-in properties. however, outlook directories are the only other built-in write capable directories. how do i add/edit/delete mailing lists? adding a mailing list first create a mailing list object and initialize it: var maillist = components.classes["@mozilla.org/addressbook/directoryproperty;1"] .createinstance(components.interfaces.nsiabdirec...
...} registerloadlistener(foo); save listeners are functions that take the same parameters, and can be registered with: registersavelistener(foo); load and save listeners can be unregistered using unregisterloadlistener(foo) and unregistersavelistener(foo), respectively. photo handlers photo handlers allow developers to customize the behavior of the contact editor when loading or saving...
Autoconfiguration in Thunderbird
account setup without having to set up a configuration server. this method is not practical for other use cases, because it is difficult to update the configuration file. guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5). manual configuration if guessing fails, the user must manually enter the configuration information. users may also choose to manually modify the account settings, even if configuration information is successfully obtained by the methods described above. all the lookup mechanisms use the email address domain as base for the lookup. for ex...
...e, for the email address fred@example.com , the lookup is performed as (in this order): tb-install-dir/isp/example.com.xml on the harddisk check for autoconfig.example.com look up of "example.com" in the ispdb look up "mx example.com" in dns, and for mx1.mail.hoster.com, look up "hoster.com" in the ispdb try to guess (imap.example.com, smtp.example.com etc.) we may add dns srv records as supported mechanism in the future, but we currently do not. how to add support for your domain classification if you are a big isp (> 100,000 users) providing email addresses solely under a few domains like "example.com" and "example.de", you may either submit the configuration to the ispdb or set up a configuration server. if you support email aliases and the user's login name is not part of t...
... return 301 http://autoconfig.hoster.com$request_uri; } or serve them directly from a common directory: server { listen 10.2.3.4:80; #again, use your server's public ip here! server_name autoconfig.*; location / { root /var/www/autoconfig; } } ssl https was added in june 2019 to the spec. please use https whenever possible. former versions of this spec defined http only. http is still supported for existing hosts and in order to support domain hosters. http is deprecated now, but will need to be supported until at least end of 2023 for both of these reasons. configuration file this is described at how to create a configuration file and defined on the sub-pages. ...
Using the Mozilla source server
our path (the cvs.exe from mozillabuild has problems, use this one instead) note: do not use the cvs from mozillabuild, it will not work! set up symbols follow the instructions for using the mozilla symbol server. once the symbol path is set you must now enable source server. using the source server in windbg in the windbg command line, type .srcfix and hit enter. ...
...also, disable (uncheck) the box that says "require source files to exactly match the original version". ...
...also, disable (uncheck) the box that says "require source files to exactly match the original version". start debugging your program. ...
Working with windows in chrome code
ample 3: using nsiwindowmediator when opener is not enough the window.opener property is very easy to use, but it's only useful when you're sure that your window was opened from one of a few well-known places. in more complicated cases you need to use the nsiwindowmediator interface, introduced above. one case in which you might want to use nsiwindowmediator is in an extension's options window. suppose you're developing a browser extension that consists of a browser.xul overlay and an options window. suppose the overlay contains a button to open the extension's options window which needs to read some data from the browser window. as you may remember, firefox's extension manager can also be used to open your options dialog. this means the value of window.opener in your options dialog is not...
...r = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); watcher.openwindow(null, url, windowname, features, args); // in the window code var args = window.arguments[0].wrappedjsobject; this uses the wrappedjsobject trick. by passing args to openwindow xpconnect will automatically wrap it as a generic nsisupports. the opened window can then just get at the underlying javascript object using wrappedjsobject. advanced data sharing the above code is useful when you need to pass data from one window to another or to a set of windows, but sometimes you just want to share a javascript variable in common between different windows. you could declare a local variable in each window along with corresponding ...
... course, this doesn't matter if you just store data in the component. learning to create xpcom components takes time. there are several articles and books about creating xpcom components online. using fuel application object the fuel library has been deprecated as of firefox 41 the fuel javascript library has a simple method for sharing data between windows. the application object supports a storage property which can be used to store data globally. this method is a simplified form of the xpcom singleton method. application.storage.set(keyname, data); var data = application.storage.get(keyname, default); where: keyname is a string used to identify the data data is the data default is the data value to return if keyname does not exists pros: its the "...
DOM Inspector internals - Firefox Developer Tools
there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey). initially, we will begin by focusing on inspector.xul and its entry point, and then expand our focus later to explain how these other inspectors differ. dom inspector from a high-level perspective the dom inspector primary ui consists of some toolbars and a panelset. the panelse...
...kit host application. in order for dom inspector to be useful with its host application, though, there should be a way to launch dom inspector within it, e.g., by a menu item and an optional keyboard shortcut such as ctrl+shift+i (or cmd+shift+i). either the host applications must provide these themselves (usually bundling dom inspector with the application, too), or dom inspector must explicitly support them by providing its own menu items and keyboard shortcuts with host-integration overlays. dom inspector explicitly supports several mozilla project applications by providing its own host-integration overlays. these overlays are: browseroverlay.xul tasksoverlay-cz.xul tasksoverlay-ff.xul tasksoverlay-mobile.xul tasksoverlay-sb.xul tasksoverlay-tb.xul tasksoverlay.xul venkmanoverla...
...ect viewer" menus from the view menu. the preference menuitems in the view menu that affect only the dom nodes viewer ("blink selected element", et cetera) are added by that viewer's popup overlay (resources/content/viewers/dom/popupoverlay.xul). the same is true for the find menuitems and the "select element by click" menuitem in the edit menu, since no other viewers besides the dom nodes viewer support these features. the other edit menu items are also used in several viewers' context menus. for that reason, only those menuitems' ids are referenced here, and the complete definitions are imported from editingoverlay.xul. viewers which include one or more of these menuitems in their context menus follow the same practice. the tooltip used for the inspect menus—the one used to show a doc...
Debugger.Script - Firefox Developer Tools
webassembly module is instantiated and via the findscripts method on debugger instances. spidermonkey constructs exactly one debugger.script for each underlying webassembly module per debugger instance. a debugger.script instance is a strong reference to the underlying webassembly module; it protects the module it refers to from being garbage collected. please note at the time of this writing, support for webassembly is very preliminary. many properties and methods below throw. convention for descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to a jsscript or to a block of webassembly code, the text will be split into two sections, headed by “if the instance refers to a jsscript” and “if the instance refers...
...refers to a jsscript, return an arrayl describing the relationship between bytecode instruction offsets and source code positions in this script.l is sparse, and indexed by source line number. if a source line numberline has no code, thenl has noline property. if there is code forline, then l[line] is an array of offsets of byte code instructions that are entry points to that line. for example, suppose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square. a[i] = i*i; calling getalloffsets() on that code might yield an array like this: [[0], [5, 20], , [10]] this array indicates that: the first line’s code starts at offset 0 in the script; the for statement head has two entry points at offsets 5 and 20 (for t...
... points for each (line, column) pair. the elements of the array are objects, each of which describes a single entry point, and contains the following properties: linenumber: the line number for which offset is an entry point columnnumber: the column number for which offset is an entry point offset: the bytecode instruction offset of the entry point for example, suppose we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square. a[i] = i*i; calling getallcolumnoffsets() on that code might yield an array like this: [{ linenumber: 0, columnnumber: 0, offset: 0 }, { linenumber: 1, columnnumber: 5, offset: 5 }, { linenumber: 1, columnnumber: 10, offset: 20 }, { linenumber: 3, columnnumber: 4, offset: 10 ...
DevTools API - Firefox Developer Tools
ol has been selected. the parameter is a toolpanel object. {toolid}-destroy(panel) a tool is about to be destroyed. the parameter is a toolpanel object. destroy the toolbox is about to be destroyed. destroyed the toolbox has been destroyed. tooldefinition a tooldefinition object contains all the required information for a tool to be shown in the toolbox. methods istargetsupported(target) a method that is called during toolbox construction to check if the tool supports debugging the given target. parameters: target {target} - the target to check. return value: a boolean indicating if the tool supports the given target. build(window, toolbox) a method that builds the toolpanel for this tool. parameters: window {window} - the window object for fram...
...he developer menu. default: false menulabel string, optional. a label for the developer menu item. default: {label} accesskey string, optional. accesskey for the developer menu <xul:menuitem>. example here's a minimal definition for a tool. let def = { id: "my-tool", label: "my tool", icon: "chrome://browser/skin/devtools/tool-webconsole.svg", url: "about:blank", istargetsupported: target => true, build: (window, toolbox) => new mytoolpanel(window, toolbox) }; // register it. gdevtools.registertool(def); targettype fixme: hosttype fixme toolpanel the toolpanel is an interface the toolbox uses to manage the panel of a tool. the object that tooldefinition.build() returns should implement the methods described below. methods open() optional. a method ...
...gistertool({ // fixme: missing key related properties. ...
Responsive Design Mode - Firefox Developer Tools
responsive design is the practice of designing a website so it looks and works properly on a range of different devices — particularly mobile phones and tablets as well as desktops and laptops. the most obvious factor here is screen size, but there are other factors as well, including the pixel density of the display and whether it supports touch. responsive design mode gives you a simple way to simulate these factors, to test how your website will look and behave on different devices. toggling responsive design mode there are three ways to toggle responsive design mode: from the firefox menu: select responsive design mode from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on macos). from the developer tools toolbox: press the respon...
... h...
...eload when touch simulation is toggled: when this option is enabled, the page is reloaded whenever you toggle touch support. reload when user agent is changed: when this option is enabled, the page isreloaded whenever the user agent is changed. reloading on these changes can be helpful because certain page behaviors would otherwise not be applied. for example, many pages check for touch support on load and only add event handlers if it is supported, or only enable certain features on certain browsers. however, if you are not interested in examining such features (maybe you are just checking the overall layout at different sizes), these reloads can waste time and possibly result in the loss of productive work, so it is useful to be able to control these reloads. now when you change...
Style Editor - Firefox Developer Tools
for you to read and edit. any changes you make are immediately applied to the page. this makes it easy to experiment with, revise, and test changes. once you're satisfied with your changes, you can save a copy locally by clicking the save button on the sheet's entry in the style sheet pane. the editor provides line numbers and syntax highlighting to help make it easier to read your css. it also supports a number of keyboard shortcuts. the style editor automatically de-minimizes style sheets that it detects, without affecting the original. this makes it much easier to work on pages that have been optimized. the style editor supports autocomplete. just start typing, and it will offer you a list of suggestions. you can switch autocomplete off in the style editor settings. the media sidebar...
... the responsive design view: creating and importing style sheets you can create a new style sheet by clicking the new button in the toolbar. then you can just start entering css into the new editor and watch as the new styles are applied in real time just like changes to the other sheets. you can load a style sheet from disk and apply it to the page by clicking the import button. source map support web developers often create css files using a preprocessor like sass, less, or stylus. these tools generate css files from a richer and more expressive syntax. if you do this, being able to see and edit the generated css is not so useful, because the code you maintain is the preprocessor syntax, not the generated css. so you'd need to edit the generated css, then manually work out how to r...
... this means that if you use, for example, sass, then the style editor will show you, and allow you to edit, sass files, rather than the css that is generated from them: for this to work, you must: use a css preprocessor that understands the source map revision 3 proposal. currently this means sass 3.3.0 or above or the 1.5.0 version of less. other preprocessors are actively working on adding support, or considering it. actually instruct the preprocessor to generate a source map, for example by passing the --source-map argument to the lass command-line tool, but in some preprocessors like sass, source maps are generated by default and you don't need to do anything. viewing original sources now, if you check "show original sources" in the style editor settings, the links next to css ru...
Web Console Helpers - Firefox Developer Tools
arting in firefox 80) followed by an unquoted string, blocks requests where the url contains that string. in the network monitor, the string now appears and is selected in the request blocking sidebar. unblock with :unblock. cd() switches javascript evaluation context to a different iframe in the page. this helper accepts multiple different ways of identifying the frame to switch to. you can supply any of the following: a selector string to be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes. clear() clears the console output area. clearhistory() just like a normal command line, the console command line remembers the commands you've typed. use this function to clear the...
...e output area, you can use the arrow keys to navigate the object. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. pprint() obsolete since gecko 74 formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. :screenshot creates a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named with the following format: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type description --clipboard boolean when present, this parameter will cause the screenshot to be copied to the clipboard. --delay nu...
...a ".png" extension. --fullpage boolean if included, the full webpage will be saved. with this parameter, even the parts of the webpage which are outside the current bounds of the window will be included in the screenshot. when used, "-fullpage" will be appended to the file name. --selector string the css query selector for a single element on the page. when supplied, only this element will be included in the screenshot. :unblock (starting in firefox 80) followed by an unquoted string, removes blocking for urls containing that string. in the network monitor, the string is removed from the request blocking sidebar. no error is given if the string was not previously blocked. values() given an object, returns a list of the values on that obje...
about:debugging (before Firefox 68) - Firefox Developer Tools
opening the about:debugging page there are several different ways to open about:debugging: type "about:debugging" in the firefox url bar. in the tools > web developer menu, click "service workers". select the web developer menu under the hamburger menu (), then select "service workers". ...
...ebar enabling you to switch between the two main views: one for add-ons and one for workers. whether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebugging.showsystemaddons preference. if you need to see system add-ons, navigate to about:config and make sure that this value is set to true. add-ons the add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, add-on sdk add-ons, and webextensions. this page enables you to do two things: load an add-on temporarily from disk connect the add-on debugger to any restartless add-ons connecting the add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may...
... firefox instance. each tab entry has a debug button next to it — when clicked, this will open up a toolbox specific to that tab, allowing you to debug that tab's contents. note that this feature isn't that immediately useful to debugging desktop tabs — you can open up a toolbox to debug a tab easily enough already — but this will become far more useful when about:debugging starts to support remote debugging, and this page can begin to list tabs available for debugging on mobile device browsers, simulators, etc. see bug 1212802 for the latest on this work. workers the workers page shows your workers, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the devel...
about:debugging - Firefox Developer Tools
opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar. in the tools > web developer menu, click remote debugging. when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: setup use the setup tab to configure the connection to your remote device. ...
...ation about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true. setup tab connecting to a remote device firefox supports debugging over usb with android devices, using the about:debugging page. before you connect: enable developer settings on your android device. enable usb debugging in the android developer settings. enable remote debugging via usb in the advanced settings in firefox on the android device. connect the android device to your computer using a usb cable. if your device doesn't appear in...
... note that about:debugging is not enabled by default in firefox esr. to enable it, open the configuration editor (about:config) and set devtools.aboutdebugging.new-enabled to true. if you used a higher version of firefox prior to installing firefox esr, you will be prompted to create a new user profile, in order to protect your user data. fo...
AudioConfiguration - Web APIs
properties the audioconfiguration dictionary is made up of four audio properties, including: contenttype: a valid audio mime type, for information on possible values and what they mean, see the web audio codec guide. channels: the number of channels used by the audio track. ...
...on to be tested const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. ...
.../ valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') + 'smooth, and ' + (result.powerefficient ? '' : 'not ') + 'power efficient.' }); specifications specification status comment media capabilitiesthe definition of 'audioconfiguration' in that specification. draft initial definition ...
AudioNode.connect() - Web APIs
Web › API › AudioNode › connect
input of the destination you want to connect the current audionode to; the default is 0. the index numbers are defined according to the number of input channels (see audio channels). it is possible to connect an audionode to another audionode, which in turn connects back to the first audionode, creating a cycle. this is allowed only if there is at least one delaynode in the cycle. otherwise, a notsupportederror exception is thrown. this parameter is not allowed if the destination is an audioparam. return value if the destination is a node, connect() returns a reference to the destination audionode object, allowing you to chain multiple connect() calls. in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefin...
...iple connect() calls. in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefined. exceptions indexsizeerror the value specified as outputindex or inputindex doesn't correspond to an existing input or output. invalidaccesserror the destination node is not part of the same audio context as the source node. notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting waveform from getting stuck constructing the same audio frame indefinitely. examples connecting to an audio input the most obvious use of the connect() method is to direct the audio output from one node in...
...ound gain.connect(audioctx.destination); // start the oscillator that will produce audio oscillator.start(); // start the oscillator that will modify the gain value lfo.start(); audioparam notes it is possible to connect an audionode output to more than one audioparam, and more than one audionode output to a single audioparam, with multiple calls to connect(). fan-in and fan-out are therefore supported. an audioparam will take the rendered audio data from any audionode output connected to it and convert it to mono by down-mixing (if it is not already mono). next, it will mix it together with any other such outputs, and the intrinsic parameter value (the value the audioparam would normally have without any audio connections), including any timeline changes scheduled for the parameter. th...
AudioWorkletProcessor - Web APIs
the audioworkletprocessor interface of the web audio api represents an audio processing code behind a custom audioworkletnode. it lives in the audioworkletglobalscope and runs on the web audio rendering thread. in turn, an audioworkletnode based on it runs on the main thread. constructor the audioworkletprocessor and classes that derive from it cannot be instantiated directly from a user-supplied code. instead, they are created only internally by the creation of an associated audioworkletnodes. the constructor of the deriving class is getting called with an options object, so you can perform a custom initialization procedures — see constructor page for details. audioworkletprocessor() creates a new instance of an audioworkletprocessor object. properties port read only returns ...
...ace, the deriving class must have the process method. this method gets called for each block of 128 sample-frames and takes input and output arrays and calculated values of custom audioparams (if they are defined) as parameters. you can use inputs and audio parameter values to fill the outputs array, which by default holds silence. optionally, if you want custom audioparams on your node, you can supply a parameterdescriptors property as a static getter on the processor. the array of audioparamdescriptor-based objects returned is used internally to create the audioparams during the instantiation of the audioworkletnode. the resulting audioparams reside in the parameters property of the node and can be automated using standard methods such as linearramptovalueattime. their calculated values w...
... using standard methods such as linearramptovalueattime. their calculated values will be passed into the process() method of the processor for you to shape the node output accordingly. processing audio an example algorithm of creating a custom audio processing mechanism is: create a separate file; in the file: extend the audioworkletprocessor class (see "deriving classes" section) and supply your own process() method in it; register the processor using audioworkletglobalscope.registerprocessor() method; load the file using addmodule() method on your audio context's audioworklet property; create an audioworkletnode based on the processor. the processor will be instantiated internally by the audioworkletnode constructor. connect the node to the other nodes. examples in...
Background Tasks API - Web APIs
need to. using timeouts can ensure that your code runs in a timely manner, but it can also allow you to cause lag or animation stutters by mandating that the browser call you when there's not enough time left for you to run without disrupting performance. falling back to settimeout because the background tasks api is fairly new, your code may need to be able to work on browsers that don't yet support it. you can do so with a simple shim that uses settimeout() as a fallback option. this isn't a polyfill, since it's not functionally identical; settimeout() doesn't let you make use of idle periods, but instead runs your code when possible, leaving us to do the best we can to avoid causing the user to experience performance lag. window.requestidlecallback = window.requestidlecallback || func...
...more than 50 milliseconds of run time per pass. the implementation of our shim for cancelidlecallback() is much simpler: window.cancelidlecallback = window.cancelidlecallback || function(id) { cleartimeout(id); } if cancelidlecallback() isn't defined, this creates one which simply passes the specified callback id through to cleartimeout(). now your code will work even on browsers that don't support the background tasks api, albeit not as efficiently. interfaces the background tasks api adds only one new interface: idledeadline an object of this type is passed to the idle callback to provide an estimate of how long the idle period is expected to last, as well as whether or not the callback is running because its timeout period has expired. the window interface is also augmented b...
...ent will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered. statusrefreshscheduled is used to track whether or not we've already scheduled an update of the status display box for the upcoming frame, so that we only do it once per frame the shim to function even if idle callbacks aren't supported. already discussed above, so it's hidden here to save space in the article. window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return settimeout(function() { handler({ didtimeout: false, timeremaining: function() { return math.max(0, 50.0 - (date.now() - starttime)); } }); }, 1); }; window.can...
A basic ray-caster - Web APIs
this article provides an interesting real-world example of using the <canvas> element to do software rendering of a 3d environment using ray-casting. open in new window why? after realizing, to my delight, that the nifty <canvas> element i'd been reading about was not only soon to be supported in firefox, but was already supported in the current version of safari, i had to try a little experiment. the canvas overview and tutorial i found here at mdn are great, but nobody had written about animation yet, so i thought i'd try a port of a basic raycaster i'd worked on a while ago, and see what sort of performance we can expect from a javascript-controlled pixel buffer. how? the basic idea is to use setinterval() at some arbitrary delay that corresponds to a desired frame rate. after e...
..., using array look-ups of pre-computed values, but i'm no optimization guru, so things could probably be written faster. also, it leaves a lot to be desired in terms of trying to be any sort of game engine—there are no wall textures, no sprites, no doors, not even any teleporters to get to another level. but i'm pretty confident all those things could be added given enough time. the canvas api supports pixel copying of images, so textures seem feasible. i'll leave that for another article, probably from another person. =) the ray-caster the nice people here have manually copied my files up so you can take a look, and for your hacking enjoyment i've posted the individual file contents as code listings (see below). so there you are, fire up safari 1.3+ or firefox 1.5+ or some other browse...
...ixel copying of images, so textures seem feasible. i'll leave that for another article, probably from another person. ...
console - Web APIs
Web › API › Console
s a dodge charger . the object is: ({str:"some text", id:5}) using string substitutions when passing a string to one of the console object's methods that accepts a string (such as log()), you may use these substitution strings: %o or %o outputs a javascript object. clicking the object name opens more information about it in the inspector. %d or %i outputs an integer. ...
... these substitution strings: %o or %o outputs a javascript object. clicking the object name opens more information about it in the inspector. %d or %i outputs an integer. number formatting is supported, for example console.log("foo %.2d", 1.1) will output the number as two significant figures with a leading 0: foo 01 %s outputs a string. %f outputs a floating-point value. formatting is supported, for example console.log("foo %.2f", 1.1) will output the number to 2 decimal places: foo 1.10 note: precision formatting doesn't work in chrome each of these pulls the next argument after the format string off the parameter list. for example: for (var i=0; i<5; i++) { console.log("hello, %s. you've called me %d times.", "bob", i+1); } the output looks like this: [13:14:13.481] ...
... you're using this to log the timing for network traffic, the timer will report the total time for the transaction, while the time listed in the network panel is just the amount of time required for the header. if you have response body logging enabled, the time listed for the response header and body combined should match what you see in the console output. stack traces the console object also supports outputting a stack trace; this will show you the call path taken to reach the point at which you call console.trace(). given code like this: function foo() { function bar() { console.trace(); } bar(); } foo(); the output in the console looks something like this: specifications specification status comment console api living standard initial...
DOMParser - Web APIs
Web › API › DOMParser
ion /* * domparser html extension * 2012-09-04 * * by eli grey, http://eligrey.com * public domain. * no warranty expressed or implied. use at your own risk. ...
... * by eli grey, http://eligrey.com * public domain. * no warranty expressed or implied. use at your own risk. ...
... */ /*! ...
Document.getElementById() - Web APIs
ot are expected to return null. specification specification status comment document object model (dom) level 1 specificationthe definition of 'getelementbyid' in that specification. ...
...onthe definition of 'getelementbyid' in that specification. obsolete initial definition for the interface document object model (dom) level 2 core specificationthe definition of 'getelementbyid' in that specification. ...
... document object model (dom) level 2 core specificationthe definition of 'getelementbyid' in that specification. obsolete supersede dom 1 document object model (dom) level 3 core specificationthe definition of 'getelementbyid' in that specification. ...
Element.attachShadow() - Web APIs
element issues around focusability. when a non-focusable part of the shadow dom is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling. return value returns a shadowroot object. exceptions exception explanation invalidstateerror the element you are trying to attach to is already a shadow host. notsupportederror you are trying to attach a shadow root to an element outside the html namespace, or the element cannot have a shadow attached to it (see above). examples the following example is taken from our word-count-web-component demo (see it live also). you can see that we use attachshadow() in the middle of the code to create a shadow root, which we then attach our custom element's c...
... attached to it (see above). examples the following example is taken from our word-count-web-component demo (see it live also). you can see that we use attachshadow() in the middle of the code to create a shadow root, which we then attach our custom element's contents to. ...
... examples the following example is taken from our word-count-web-component demo (see it live also). you can see that we use attachshadow() in the middle of the code to create a shadow root, which we then attach our custom element's contents to. ...
Element.closest() - Web APIs
Web › API › Element › closest
r2 = el.closest("div div"); // returns the closest ancestor which is a div in div, here it is the div-03 itself var r3 = el.closest("article > div"); // returns the closest ancestor which is a div and has a parent article, here it is the div-01 var r4 = el.closest(":not(div)"); // returns the closest ancestor which is not a div, here it is the outmost article polyfill for browsers that do not support element.closest(), but carry support for element.matches() (or a prefixed equivalent, meaning ie9+), a polyfill exists: if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } if (!element.prototype.closest) { element.prototype.closest = function(s) { var el = this; do { if (el...
... if (window.element && !element.prototype.closest) { element.prototype.closest = function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i, el = this; ...
...t) { element.prototype.closest = function(s) { var el = this; do { if (element.prototype.matches.call(el, s)) return el; el = el.parentelement || el.parentnode; } while (el !== null && el.nodetype === 1); return null; }; } however, if you really do require ie 8 support, then the following polyfill will do the job very slowly, but eventually. however, it will only support css 2.1 selectors in ie 8, and it can cause severe lag spikes in production websites. if (window.element && !element.prototype.closest) { element.prototype.closest = function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {}; } while ((i <...
Element.getAttributeNS() - Web APIs
<!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:test="http://www.example.com/2014/test" width="40" height="40"> <circle id="target" cx="12" cy="12" r="10" stroke="#444" stroke-width="2" fill="none" test:foo="foo value"/> </svg> <script type="text/javascript"> var ns = 'http://www.example.com/2014/test'; var circle = document.getelementbyid( 't...
...html5 documents have to use getattribute() instead. getattributens() differs from getattribute() in that it allows you to further specify the requested attribute as being part of a particular namespace, as in the example above, where the attribute is part of the fictional "specialspace" namespace on mozilla. prior to the dom4 specification, this method was specified to r...
...oveattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element.getattributens()' in that specification. living standard document object model (dom) level 3 core specificationthe definition of 'element.getattributens()' in that specification. obsolete specifies that a not_supported_err exception is thrown if the ua does not support the "xml" feature. also specifies that null must be passed to have no namespace. document object model (dom) level 2 core specificationthe definition of 'element.getattributens()' in that specification. obsolete initial definition ...
Using Fetch - Web APIs
the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more. fetch requests are controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving. supplying request options the fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings: see fetch() for the full options available, and more details. // example post method implementation: async function postdata(url = '', data = {}) { // default options are marked with * const response = await fetch(url, { method: 'p...
...a value of true. ...
... set by passing body parameters: const form = new formdata(document.getelementbyid('login-form')); fetch('/login', { method: 'post', body: form }); both request and response (and by extension the fetch() function), will try to intelligently determine the content type. a request will also automatically set a content-type header if none is set in the dictionary. feature detection fetch api support can be detected by checking for the existence of headers, request, response or fetch() on the window or worker scope. for example: if (window.fetch) { // run my fetch request here } else { // do something with xmlhttprequest? } polyfill to use fetch in unsupported browsers, there is a fetch polyfill available that recreates the functionality for non-supporting browsers. specification...
FileSystemEntrySync - Web APIs
arent the directory to which to move the entry. newname the new name of the entry. if you do not specify a name, the browser preserves the entry's current name. returns filesystementrysync an object that represents an entry in the file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal. examples include a backslash (\), dot (.), and two dots (..). not_found_err the target directory does not exist. invalid_modification_err you tried one of the following disallowed operations: moving an entry into its parent without changing its name moving a parent dir...
...ere you want the entry to move to. newname the new name of the entry. if you do not specify a name, the browser preserves the filesystementrysync's current name. returns filesystementrysync an object that represents an entry in the file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal. examples include a backslash (\), dot (.), and two dots (..). not_found_err the target directory does not exist. invalid_modification_err you tried one of the following disallowed operations: moving an entry into its parent without changing its name moving a parent dir...
...u wanted to display an image and have its fileentry, calling tourl() gives you the image file's file system url. you get something like: filesystem:http://example.com/temporary/lolcat.png. the file system url does not expire. because the method describes a location on disk, the url is valid for as long as that location exists. you can delete the file and recreate it, and it's all good. you can supply the mimetype to simulate the optional mime type header associated with http downloads. domstring tourl (); parameter none. returns domstring exceptions none remove() deletes a file or directory. you cannot delete an empty directory or the root directory of a file system. if you want to remove an empty directory, use removerecursively() instead. void remove ( ) raises (fileexcep...
Using the Gamepad API - Web APIs
the gamepad api is a way for developers and designers to access and use gamepads and other game controllers. the gamepad api introduces new events on the window object for reading gamepad and controller (hereby referred to as gamepad) state. ...
...eful feedback to the user. index: an integer that is unique for each gamepad currently connected to the system. this can be used to distinguish multiple controllers. note that disconnecting a device and then connecting a new device may reuse the previous index. mapping: a string indicating whether the browser has remapped the controls on the device to a known layout. currently there is only one supported known layout — the standard gamepad. if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard. connected: a boolean indicating whether the gamepad is still connected to the system. if this is so the value is true; if not, it is false. buttons: an array of gamepadbutton objects representing the buttons present on the devi...
...opers to determine if the axes and button data have been updated from the hardware. the value must be relative to the navigationstart attribute of the performancetiming interface. values are monotonically increasing, meaning that they can be compared to determine the ordering of updates, as newer values will always be greater than or equal to older values. note that this property is not currently supported in firefox. note: the gamepad object is available on the gamepadconnected event rather than the window object itself, for security reasons. once we have a reference to it, we can query its properties for information about the current state of the gamepad. behind the scenes, this object will be updated every time the gamepad's state changes. using button information let's look at a sim...
HTMLMediaElement - Web APIs
the htmlvideoelement and htmlaudioelement elements both inherit this interface. ...
...indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). event handlers htmlmediaelement.onencrypted sets the eventhandler called when the media is encrypted. htmlmediaelement.onwaitingforkey sets the eventhandler called when playback is blocked while waiting for an encryption key. obsolete attributes these attributes are obsolete and should not be used, even if a browser still supports them. htmlmediaelement.initialtime read only returns a double that indicates the initial playback position in seconds. htmlmediaelement.mozchannels read only returns a double representing the number of channels in the audio resource (e.g., 2 for stereo). obsolete event handlers htmlmediaelement.onmozinterruptbegin sets the eventhandler called when the media element ...
...lmediaelement.setmediakeys() returns promise. sets the mediakeys keys to use when decrypting media during playback. htmlmediaelement.setsinkid() sets the id of the audio device to use for output and returns a promise. this only works when the application is authorized to use the specified device. obsolete methods these methods are obsolete and should not be used, even if a browser still supports them. htmlmediaelement.mozloadfrom() this method, available only in mozilla's implementation, loads data from another media element. this works similarly to load() except that instead of running the normal resource selection algorithm, the source is simply set to the other element's currentsrc. this is optimized so this element gets access to all of the other element's cached and buf...
Ajax navigation example - Web APIs
(spage) { opageinfo.url = filterurl(spage, null); } oreq.open("get", filterurl(opageinfo.url, "json"), true); oreq.send(); oloadingbox.parentnode || document.body.appendchild(oloadingbox); } function requestpage (surl) { if (history.pushstate) { bupdateurl = true; getpage(surl); } else { /* ajax navigation is not supported */ location.assign(surl); } } function processlink () { if (this.classname === sajaxclass) { requestpage(this.href); return false; } return true; } function init () { opageinfo.title = document.title; history.replacestate(opageinfo, opageinfo.title, opageinfo.url); for (var olink, n...
...d", 405: "method not allowed", 406: "not acceptable", 407: "proxy authentication required", 408: "request timeout", 409: "conflict", 410: "gone", 411: "length required", 412: "precondition failed", 413: "request entity too large", 414: "request-uri too long", 415: "unsupported media type", 416: "requested range not satisfiable", 417: "expectation failed", 422: "unprocessable entity", 423: "locked", 424: "failed dependency", 425: "unassigned", 426: "upgrade required", 427: "unassigned", 428: "precondition required", 429: "too many requests", ...
...: "unassigned", 428: "precondition required", 429: "too many requests", 430: "unassigned", 431: "request header fields too large", 500: "internal server error", 501: "not implemented", 502: "bad gateway", 503: "service unavailable", 504: "gateway timeout", 505: "http version not supported", 506: "variant also negotiates (experimental)", 507: "insufficient storage", 508: "loop detected", 509: "unassigned", 510: "not extended", 511: "network authentication required" }; var oreq, bisloading = false, bupdateurl = false; oloadingbox.id = "ajax-loader"; ocover.onclick = abortreq;...
Working with the History API - Web APIs
ectively. these methods work in conjunction with the onpopstate event. adding and modifying history entries using pushstate() changes the referrer that gets used in the http header for xmlhttprequest objects created after you change the state. the referrer will be the url of the document whose window is this at the time of creation of the xmlhttprequest object. example of pushstate() method suppose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar", } history.pushstate(stateobj, "page 2", "bar.html") this will cause the url bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists. suppose now that the user navigates to http://google.com, then clicks the back button. at thi...
... in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) through gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), the passed object is serialized using json. starting in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), the object is serialized using the structured clone algorithm. this allows a wider variety of objects to be safely passed. ...
...e structured clone algorithm. this allows a wider variety of objects to be safely passed. example of replacestate() method suppose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar" } history.pushstate(stateobj, "page 2", "bar.html") the explanation of these two lines above can be found at the above section example of pushstate() method section. next, suppose http://mozilla.org/bar.html executes the following javascript: history.replacestate(stateobj, "page 3", "bar2.html") this will cause the url bar to display http://mozilla.org/bar2.html, but won't cause the browser to load bar2.html or even check that bar2.html exists. suppose now that the user navigates to http://www.microsoft.com, then clicks the back button. at this point, the url bar w...
KeyboardEvent - Web APIs
s generated. methods this interface also inherits methods of its parents, uievent and event. keyboardevent.getmodifierstate() returns a boolean indicating if a modifier key such as alt, shift, ctrl, or meta, was pressed when the event was created. obsolete methods keyboardevent.initkeyevent() initializes a keyboardevent object. this was implemented only by firefox, and is no longer supported even there; instead, you should use the keyboardevent() constructor. keyboardevent.initkeyboardevent() initializes a keyboardevent object. this is now deprecated. you should instead use the keyboardevent() constructor. obsolete properties keyboardevent.char read only returns a domstring representing the character value of the key. if the key corresponds to a printable character...
...cases some keys toggle the state of an indicator light; these include keys such as caps lock, num lock, and scroll lock. on windows and linux, these keys dispatch only the keydown and keyup events. on linux, firefox 12 and earlier also dispatched the keypress event for these keys. however, a limitation of the macos event model causes caps lock to dispatch only the keydown event. num lock was supported on some older laptop models (2007 models and older), but since then, macos hasn't supported num lock even on external keyboards. on older macbooks with a num lock key, that key doesn't generate any key events. gecko does support the scroll lock key if an external keyboard which has an f14 key is connected. in certain older versions of firefox, this key generated a keypress event; this incon...
... ...
MediaRecorder - Web APIs
argument with a value in milliseconds. if this is specified, the media will be captured in separate chunks of that duration, rather than the default behavior of recording the media in a single large chunk. mediarecorder.stop() stops recording, at which point a dataavailable event containing the final blob of saved data is fired. no more recording occurs. static methods mediarecorder.istypesupported() a static method which returns a boolean value indicating if the given mime media type is supported by the current user agent. event handlers mediarecorder.ondataavailable called to handle the dataavailable event, which is periodically triggered each time timeslice milliseconds of media have been recorded (or when the entire media has been recorded, if timeslice wasn't specified). ...
...ndle the stop event, which occurs when media recording ends, either when the mediastream ends — or after the mediarecorder.stop() method is called. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. ...
...p() method is called. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. error fired when an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec. also available via the onerror property. ...
Media Session action types - Web APIs
the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. ...
...nhandler() method to establish a handler for that action. the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type. syntax a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the medi...
...iasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon. audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); }); navigator.mediasession.setactionhandler('seekbackward', evt => { // user clicked "seek backward" media notification icon. ...
MediaSource.addSourceBuffer() - Web APIs
specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. ...
...to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list. quotaexceedederror the user agent can't handle any more sourcebuffer objects, or creating a new sourcebuffer using the given mimetype would result in an unsupported configuration of sourcebuffers. example the following snippet is ...
... example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuf...
Using the MediaStream Recording API - Web APIs
wer here, but it's a bit overkill for such a simple layout. instead, the problem was solved by making the third container's height equal to 100% of the parent height, minus the heights and padding of the other two: .sound-clips { box-shadow: inset 0 3px 4px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9. checkbox hack for showing/hiding this is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the information screen, which is shown/hidden by clicking the ...
...buttons, and the <article> that will contain the generated audio players: const record = document.queryselector('.record'); const stop = document.queryselector('.stop'); const soundclips = document.queryselector('.sound-clips'); finally for this section, we set up the basic getusermedia structure: if (navigator.mediadevices && navigator.mediadevices.getusermedia) { console.log('getusermedia supported.'); navigator.mediadevices.getusermedia ( // constraints - only audio needed for this app { audio: true }) // success callback .then(function(stream) { }) // error callback .catch(function(err) { console.log('the following getusermedia error occured: ' + err); } ); } else { console.log('getusermedia not sup...
...pp { audio: true }) // success callback .then(function(stream) { }) // error callback .catch(function(err) { console.log('the following getusermedia error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } the whole thing is wrapped in a test that checks whether getusermedia is supported before running anything else. next, we call getusermedia() and inside it define: the constraints: only audio is to be captured for our dictaphone. the success callback: this code is run once the getusermedia call has been completed successfully. the error/failure callback: the code is run if the getusermedia call fails for whatever reason. note: all of the code below is placed insid...
MediaTrackConstraints.aspectRatio - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.autoGainControl - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.channelCount - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.deviceId - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.facingMode - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.frameRate - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.groupId - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.height - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.latency - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.sampleRate - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.sampleSize - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.width - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
Media Source API - Web APIs
h as when buffers are evicted. it lays the groundwork for adaptive bitrate streaming clients (such as those using dash or hls) to be built on its extensible api. creating assets that work with mse in modern browsers is a laborious process, taking significant time, computing power, and energy. the usage of external utilities to massage the content into a suitable format is required. while browser support for the various media containers with mse is spotty, usage of the h.264 video codec, aac audio codec, and mp4 container format is a common baseline. mse also provides an api for runtime detection of container and codec support. if you do not require explicit control of video quality over time, the rate at which content is fetched, or the rate at which memory is evicted, then the <video> and ...
...then the <video> and <source> tags may well be a simple and adequate solution. dash dynamic adaptive streaming over http (dash) is a protocol for specifying how adaptive content should be fetched. it is effectively a layer built on top of mse for building adaptive bitrate streaming clients. while there are other protocols available (such as http live streaming (hls)), dash has the most platform support. dash moves lots of logic out of the network protocol and into the client side application logic, using the simpler http protocol to fetch files. indeed, one can support dash with a simple static file server, which is also great for cdns. this is in direct contrast with previous streaming solutions that required expensive licenses for proprietary non-standard client/server protocol impleme...
... implementations. the two most common use cases for dash involve watching content “on demand” or “live.” on demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality. live profile content can introduce latency due to its transcoding and broadcasting, so dash is not suitable for real time communication like webrtc is. it can however support significantly more client connections than webrtc. there are numerous available free and open source tools for transcoding content and preparing it for use with dash, dash file servers, and dash client libraries written in javascript. interfaces mediasource represents a media source to be played via an htmlmediaelement object. sourcebuffer represents a chunk of media to be passed into...
Media Capture and Streams API (Media Stream) - Web APIs
it provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process. concepts and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or video-related data. see an example in get the video. ...
... you'll find the fundamental information you'll need to know about each of the interfaces that make up the media capture and streams api. blobevent canvascapturemediastreamtrack inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types. these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. events addtrack ended mu...
...ls the articles below provide additional guidance and how-to information that will help you learn to use the api, and how to perform specific tasks that you may wish to handle. capabilities, constraints, and settingsthe twin concepts of constraints and capabilities let the browser and web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one. this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser. ...
MutationEvent - Web APIs
ication, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. ...
...nts are performance issues and cross-browser support. performance adding dom mutation listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event listeners. cross-browser support these events are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributena...
... are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument d...
Web-based protocol handlers - Web APIs
e handler. the "%s" is replaced with the href of the link and a get is executed on the resultant url. the user friendly name for the protocol handler. when a browser executes this code, it should display a prompt to the user, asking permission to allow the web application to register as a handler for the protocol. firefox displays a prompt in the notification bar area: note:the url template supplied when registering must be of the same domain as the webpage attempting to perform the registration or the registration will fail. for example, http://example.com/homepage.html can register a protocol handler for http://example.com/handle_mailto/%s, but not for http://example.org/handle_mailto/%s. registering the same protocol handler more than once will pop up a different notification, indic...
...firefox will, by default, prompt the user before handing off the action. example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling...
...f the action. example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - test</title> </head> <body> <p>hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> handling the next phase is handling the action. the browser extracts the href from the activated link, combines it with the url template supplied during handler registration and performs an http get on the url. so, using the above examples, the browser would perform a get on this url: http://www.google.co.uk/?uri=web+burger:cheeseburger server side code can extract the query string parameters and perform the desired action. note:the server side code is passed the entire contents of the href. this means the server side code will ha...
Navigator.registerProtocolHandler() - Web APIs
the navigator method registerprotocolhandler() lets web sites register their ability to open or handle particular url schemes (aka protocols). for example, this api lets webmail sites open mailto: urls, or voip sites open tel: urls. syntax navigator.registerprotocolhandler(scheme, url, title); note: recently updated to navigator.registerprotocolhandler(scheme, url), but no browsers currently support this version. parameters scheme a string containing the protocol the site wishes to handle. for example, you can register to handle sms text message links by passing the "sms" scheme. url a string containing the url of the handler. this url must include %s, as a placeholder that will be replaced with the escaped url to be handled. note: the handler url must us the https scheme. older ...
...ion. parameters scheme a string containing the protocol the site wishes to handle. for example, you can register to handle sms text message links by passing the "sms" scheme. url a string containing the url of the handler. this url must include %s, as a placeholder that will be replaced with the escaped url to be handled. note: the handler url must us the https scheme. older browsers also supported http. title a human-readable title string for the handler. this will be displayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings. note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it. it is recommended to always set the title, since ...
... title a human-readable title string for the handler. this will be displayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings. note: the title has been removed from the spec due to spoofing concerns, but all current browsers still require it. it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it). exceptions securityerror the user agent blocked the registration. this might happen if: the registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, etc.) the handler url’s origin does not match the origin of the page calling this ...
Navigator - Web APIs
Web › API › Navigator
ct which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities. navigator.maxtouchpoints read only returns the maximum number of simultaneous touch contact points are supported by the current device. navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser. navigator.online read only returns a boolean indicating whether the browser is working online. navigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions ap...
...mber by 1024. navigator.donottrack reports the value of the user's do-not-track preference. when this value is "yes", your web site or application should not track the user. navigator.mediadevices returns a reference to a mediadevices object which can then be used to get information about available media devices (mediadevices.enumeratedevices()), find out what constrainable properties are supported for media on the user's computer and user agent (mediadevices.getsupportedconstraints()), and to request access to media using mediadevices.getusermedia(). navigator.mediasession returns mediasession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls ui. navi...
... to asynchronously transfer a small amount of data using http from the user agent to a web server. navigator.share() invokes the native sharing mechanism of the current platform. navigatorid.taintenabled() deprecated since gecko 1.7.8 obsolete since gecko 9.0 returns false. javascript taint/untaint functions removed in javascript 1.2. navigator.vibrate() causes vibration on devices with support for it. does nothing if vibration support isn't available. non-standard navigator.mozislocallyavailable() lets code check to see if the document at a given uri is available without using the network. specifications specification status comment html living standardthe definition of 'the navigator object' in that specification. living standard ...
Notification.permission - Web APIs
licitly granted permission for the current origin to display system notifications. denied: the user has explicitly denied permission for the current origin to display system notifications. default: the user decision is unknown; in this case the application will act as if permission was denied. ...
...n; in this case the application will act as if permission was denied. examples the following snippet could be used if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
...ppet could be used if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
Notification.requestPermission() - Web APIs
that resolves to a domstring with the permission picked by the user. ...
...ossible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
...et of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
Notification - Web APIs
cation object also inherits from the eventtarget interface. notification.close() programmatically closes a notification instance. ...
...ossible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
...et of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification. ...
OVR_multiview2 - Web APIs
the ovr_multiview2 extension is part of the webgl api and adds support for rendering into multiple views simultaneously. this especially useful for virtual reality (vr) and webxr. for more information, see also: multiview on webxr three.js multiview demo multiview in babylon.js optimizing virtual reality: understanding multiview multiview webgl rendering for oculus browser 6.0+ webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver (windows+angle and android are supported; windows+gl, mac, linux are not supported). this extension is only available to webgl 2 contexts as it needs glsl 3.00 and texture arrays. currentl...
...see also this webgl issue. constants this extension exposes 4 constants that can be used in getparameter() or getframebufferattachmentparameter(). framebuffer_attachment_texture_num_views_ovr number of views of the framebuffer object attachment. ...
...amebuffer_attachment_texture_num_views_ovr number of views of the framebuffer object attachment. framebuffer_attachment_texture_base_view_index_ovr base view index of the framebuffer object attachment. max_views_ovr the maximum number of views. most vr headsets have two views, but there are prototypes of headset with ultra-wide fov using 4 views which is currently the maximum number of views supported by multiview. framebuffer_incomplete_view_targets_ovr if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete. calling checkframebufferstatus for a framebuffer in this state returns framebuffer_incomplete_view_targets_ovr. methods framebuffertexturemultiviewovr()...
Page Visibility API - Web APIs
timeouts. example view live example (video with sound). ...
...= "undefined") { hidden = "webkithidden"; visibilitychange = "webkitvisibilitychange"; } var videoelement = document.getelementbyid("videoelement"); // if the page is hidden, pause the video; // if the page is shown, play the video function handlevisibilitychange() { if (document[hidden]) { videoelement.pause(); } else { videoelement.play(); } } // warn if the browser doesn't support addeventlistener or the page visibility api if (typeof document.addeventlistener === "undefined" || hidden === undefined) { console.log("this demo requires a browser, such as google chrome or firefox, that supports the page visibility api."); } else { // handle page visibility change document.addeventlistener(visibilitychange, handlevisibilitychange, false); // when the video pauses,...
...he user, either due to the document's tab being in the background or part of a window that is minimized, or because the device's screen is off. prerender the page's content is being prerendered and is not visible to the user. a document may start in the prerender state, but will never switch to this state from any other state, since a document can only prerender once. note: not all browsers support prerendering. unloaded the page is in the process of being unloaded from memory. note: not all browsers support the unloaded value. document.onvisibilitychange an eventlistener providing the code to be called when the visibilitychange event is fired. //startsimulation and pausesimulation defined elsewhere function handlevisibilitychange() { if (document.hidden) { pau...
PaymentRequest: paymentmethodchange event - Web APIs
event handler property onpaymentmethodchange examples let's take a look at an example. this code creates a new paymentrequest, adds a handler for the paymentmethodchange event by calling the request's addeventlistener(), then calls show() to present the payment interface to the user. the code assumes the existence of a method detailsforshipping(), which returns a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the form found in the paymentshippingoption dictionary. by doing so, the payment form defaults to the ground shipping method. const options = { requestshipping: true }; const paymentrequest = new paymentrequest(paymentmethods, detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmet...
...s, detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmethodchange", handlepaymentchange, false); paymentrequest.show() .then(response => response.complete("success")) .catch(err => console.log("error handling payment request: " + err)); the event handler function itself, handlepaymentchange(), looks like this: handlepaymentchange = event => { const detailsupdate = {}; if (event.methodname === "https://apple.com/apple-pay") { const servicefeeinfo = calculateservicefee(event.methoddetails); object.assign(detailsupdate, servicefeeinfo); } event.updatewith(detailsupdate); }, false); this begins by looking at the event's methodname property; if that indicates that the user is trying to use apple pay, we pass the methoddetails into a func...
... before the event handler returns, it calls the event's paymentmethodchangeevent.updatewith.updatewith() method to integrate the changes into the request. related events merchantvalidation, shippingaddresschange, shippingoptionchange, and payerdetailcha...
PaymentResponse - Web APIs
le, if the basic card payment method is used, this object must conform to the structure defined in the basiccardresponse dictionary. paymentresponse.methodname read only secure context returns the payment method identifier for the payment method that the user selected, for example, visa, mastercard, paypal, etc.. paymentresponse.payeremail read only secure context returns the email address supplied by the user. this option is only present when the requestpayeremail option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.payername read only secure context returns the name supplied by the user. this option is only present when the requestpayername option is set to true in the options parameter of the paymentrequest() constructor. paymentres...
...mail option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.payername read only secure context returns the name supplied by the user. this option is only present when the requestpayername option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.payerphone read only secure context returns the phone number supplied by the user. this option is only present when the requestpayerphone option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.requestid read only secure context returns the identifier of the paymentrequest that produced the current response. this is the same value supplied in the paymentrequest() constructor by details.id. paymentresponse.shippin...
...yerphone option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.requestid read only secure context returns the identifier of the paymentrequest that produced the current response. this is the same value supplied in the paymentrequest() constructor by details.id. paymentresponse.shippingaddress read only secure context returns the shipping address supplied by the user. this option is only present when the requestshipping option is set to true in the options parameter of the paymentrequest() constructor. paymentresponse.shippingoption read only secure context returns the id attribute of the shipping option selected by the user. this option is only present when the requestshipping option is set to true in the options parameter of the paymentr...
performance.setResourceTimingBufferSize() - Web APIs
web workers. syntax performance.setresourcetimingbuffersize(maxsize); arguments maxsize a number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer. return value none this method has no return value. ...
...ngbuffersize(maxsize); arguments maxsize a number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer. return value none this method has no return value. ...
... number of performance entry objects the browser should hold in its performance entry buffer. return value none this method has no return value. example function setresourcetimingbuffersize(maxsize) { if (performance === undefined) { log("browser does not support web performance"); return; } var supported = typeof performance.setresourcetimingbuffersize == "function"; if (supported) { log("... performance.setresourcetimingbuffersize() = yes"); performance.setresourcetimingbuffersize(maxsize); } else { log("... performance.setresourcetimingbuffersize() = not supported"); } } specifications specification status comment resource timing level 1the definition of 'setresourcetimingbuffersize()' in that specification. candidate r...
PerformanceResourceTiming.connectEnd - Web APIs
...
... candidate recommendation initial definition.
... "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'connectend' in that specification. candidate recommendation initial definition. ...
PerformanceResourceTiming.fetchStart - Web APIs
...
... candidate recommendation initial definition.
... "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'fetchstart' in that specification. candidate recommendation initial definition. ...
PerformanceResourceTiming.redirectEnd - Web APIs
...
... candidate recommendation initial definition...
... "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'redirectend' in that specification. candidate recommendation initial definition. ...
PerformanceResourceTiming.responseEnd - Web APIs
...
... candidate recommendation initial definition...
... "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'responseend' in that specification. candidate recommendation initial definition. ...
PerformanceResourceTiming.workerStart - Web APIs
...
... working draft initial definition. ...
...responsestart", "responseend", "secureconnectionstart", "workerstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 2the definition of 'workerstart' in that specification. working draft initial definition. ...
Performance Timeline - Web APIs
the extensions provide interfaces to retrieve performance entry metrics based on specific filter criteria. the standard also includes interfaces that allow an application to define performance observer callbacks that are notified when specific performance events are added to the browser's performance timeline. this document provides an overview of the standard's interfaces. for more details about the interfaces, see the reference pages and using performance timeline. ...
... the level 2 version of the standard and were not widely implemented. implementation status a summary of the interfaces' implementation status is provided below, including a link to more detailed information. performance interface extensions: as shown in the performance interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers and have less support on mobile devices. performanceentry: as shown in the performanceentry interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers and have less support on mobile devices. performance observers : as shown in the performanceobserver interface's browser compatibility table, this interface has no shipping implementations. to test your browser...
...t on mobile devices. performanceentry: as shown in the performanceentry interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers and have less support on mobile devices. performance observers : as shown in the performanceobserver interface's browser compatibility table, this interface has no shipping implementations. to test your browser's support for these interfaces, run the perf-api-support application. see also a primer for web performance timing apis ...
PublicKeyCredentialCreationOptions.extensions - Web APIs
publickeycredentialrequestoptions.extensions. syntax extensions = publickeycredentialcreationoptions.extensions value an object with various keys and values. here is the current (as of march 2019) list of potential extensions which may be used during the registration operation. warning! as of june 2020, only appid (used during creation with publickeycredentialrequestoptions.extensions) is supported by chrome and edge. firefox does not seem to support any extension. also chrome doesn't plan to support any other extension in future extension identifier type description authnsel array of buffersource authenticator selection. restricts the list of authenticator models which may be used. if no matching authenticator is available, the credential is still ...
... uvi boolean user verification index. if true, the client outputs an arraybuffer which contains a value uniquely identifying a user verification data record. ...
... uvi boolean user verification index. ...
RTCRtpCodecCapability - Web APIs
clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. ...
... clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. ...
...ecs used by webrtc for details about potential codecs that might be referenced here. sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists. if there is no parameters field, this property is left out. description rtcrtpcodeccapabilities describes the basic parameters for a single codec supported by the user's device. an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities(). examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsers...
RTCRtpReceiver.getCapabilities() static function - Web APIs
the static function rtcrtpreceiver.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device. you can, similarly, obtain the capabilities of rtcrtpsenders by calling the static function rtcrtpsender.getcapabilities(). syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. ...
...iver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as a static function, this is always called using the form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may fail to work when you actually try to use them. calling rtcrtpreceiver.g...
...codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user. for that reason, in privacy-sensitive contexts, the browser may choose to obscure the capabilities; this might be done, for example, by leaving out rarely-used codec configurations. example the function below returns a boolean indicating whether or not the device supports receiving h.264 video on a webrtc connection. since rtcrtpreceiver.getcapabilities() actually only indicates probable support, attempting to receive h.264 video might still fail even after getting a positive response from this function. function canreceiveh264() { let capabilities = rtcrtpreceiver.getcapabilities("video"); capabilities.codecs.foreach((codec) => { if (codec.mimet...
SVGURIReference - Web APIs
methods this interface does not provide any specific methods. specifications specification status comment ...
... methods this interface does not provide any specific methods. ...
... methods this interface does not provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgurireference' in that specification. candidate recommendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgurireference' in that specification. recommendation initial definition ...
ServiceWorkerContainer.register() - Web APIs
igator) { // register a service worker hosted at the root of the // site using the default scope. navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/index.html, at the root of a site, would apply to exactly the same pages as the example above. remember the scope, when included, uses the page's location as its base. alternatively, if this code were included in a page at example.com/product/description.html, with the javascript file residing at example.com/product/sw.js, then the serv...
...xample.com/product. if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: './'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } there is frequent confusion surrounding the meaning and use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. the following code, if included in example.com/index.html, at the root of a site, would only apply to resources under example.com/product. if ('serviceworker...
...com/product. if ('serviceworker' in navigator) { // declaring scope manually navigator.serviceworker.register('/sw.js', {scope: '/product/'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } however, servers can remove this restriction by setting a service-worker-allowed header on the service worker script, and then you can specify a max scope for that service worker above the service worker's location. specifications specification status comment service workersthe definition of 'serviceworkercontainer: register' in that specification. workin...
SubtleCrypto.deriveBits() - Web APIs
the derivation algorithm to use, and the length of the bit string to derive. it returns a promise which will be fulfilled with an arraybuffer containing the derived bits. this method is very similar to subtlecrypto.derivekey(), except that derivekey() returns a cryptokey object rather than an arraybuffer. essentially derivekey() is composed of derivebits() followed by importkey(). this function supports the same derivation algorithms as derivekey(): ecdh, hkdf, and pbkdf2. see supported algorithms for some more detail on these algorithms. syntax const result = crypto.subtle.derivebits( algorithm, basekey, length ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdhkeyderiveparams object. to use hkdf, pass an hkd...
... the number of bits to derive. return value result is a promise that fulfills with an arraybuffer containing the derived bits. exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the base key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm requested for the derived key doesn't define a key length. supported algorithms see the supported algorithms section of the derivekey() documentation. examples note: you can try the working examples on github. ecdh in this example alice and bob each generate an ecdh ...
...generate the same secret using his private key and alice's public key. derivesharedsecret(aliceskeypair.privatekey, bobskeypair.publickey); }); }); pbkdf2 in this example we ask the user for a password, then use it to derive some bits using pbkdf2. see the complete code on github. let salt; /* get some key material to use as input to the derivebits method. the key material is a password supplied by the user. */ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* derive some bits from a password supplied by the user. */ async function getderivedbits() { const keymat...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
s of the size of the data type. a gl.invalid_operation error is thrown if no webglbuffer is bound to the array_buffer target. when using a webgl 2 context, a gl.invalid_operation error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g. uvec4 or ivec4, instead of vec4). description let's assume we want to render some 3d geometry, and for that we will need to supply our vertices to the vertex shader. each vertex has a few attributes, like position, normal vector, or texture coordinate, that are defined in an arraybuffer and will be supplied to the vertex buffer object (vbo). first, we need to bind the webglbuffer we want to use to gl.array_buffer, then, with this method, gl.vertexattribpointer(), we specify in what order the attributes are stored, and wha...
...hen they are sent to the vertex shader. if you need to use integers in your vertex shader code, you can either cast the float back to an integer in the vertex shader (e.g. (int) floatnumber), or use gl.vertexattribipointer() from webgl2. default attribute values the vertex shader code may include a number of attributes, but we don't need to specify the values for each attribute. instead, we can supply a default value that will be identical for all vertices. we can call gl.disablevertexattribarray() to tell webgl to use the default value, while calling gl.enablevertexattribarray() will read the values from the array buffer as specified with gl.vertexattribpointer(). similarily, if our vertex shader expects e.g. a 4-component attribute with vec4 but in our gl.vertexattribpointer() call we se...
...ffff, true); } for higher performance, we could also do the previous json to arraybuffer conversion on the server-side, e.g. with node.js. then we could load the binary file and interpret it as an array buffer: const response = await fetch('assets/geometry.bin'); const buffer = await response.arraybuffer(); consume array buffer with webgl first, we create a new vertex buffer object (vbo) and supply it with our array buffer: //bind array buffer to a vertex buffer object const vbo = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, vbo); gl.bufferdata(gl.array_buffer, buffer, gl.static_draw); then, we specify the memory layout of the array buffer, either by setting the index ourselves: //describe the layout of the buffer: //1. position, not normalized gl.vertexattribpointer(0, 3, gl.fl...
Canvas size and WebGL - Web APIs
ual size of the canvas element in the browser window. the effect is clearly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. ...
...rly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. in the first canvas, we get the desired result. in the second, the square has the wrong shape, size, and position. ...
..."canvas")[1]; firstcanvas.width = firstcanvas.clientwidth; firstcanvas.height = firstcanvas.clientheight; [firstcanvas, secondcanvas].foreach(function(canvas) { var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.enable(gl.scissor_test); gl.scissor(30, 10, 60, 60); gl.clearcolor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); }); }, false); the source code of this example is also available on github. « previousnext » ...
Clearing with colors - Web APIs
r command) translates into output (in this case, all pixels are set to green). finally, we note that color in webgl is usually in rgba format, that is four numerical components for red, green, blue and alpha (opacity). therefore, clearcolor() takes four arguments. ...
...pixels are set to green). finally, we note that color in webgl is usually in rgba format, that is four numerical components for red, green, blue and alpha (opacity). therefore, clearcolor() takes four arguments. <p>a very simple webgl program that shows some color.</p> <!-- text within a canvas element is displayed only if canvas is not supported. --> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it, // and to not mess up the global scope. we are giving the e...
..."canvas"); // getting the webgl rendering context. var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); // if failed, inform user of failure. otherwise, initialize // the drawing buffer (the viewport) and clear the context // with a solid color. if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } paragraph.innerhtml = "congratulations! your browser supports webgl. "; gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // set the clear color to darkish green. gl.clearcolor(0.0, 0.5, 0.0, 1.0); // clear the context with the newly set color. this is // the function call that actually does the drawing. gl.clear(gl.color_buffer_b...
Getting started with WebGL - Web APIs
webgl programs consist of control code written in javascript and shader code (glsl) that is executed on a computer's graphics processing unit (gpu). webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this article will introduce you to the basics of using webgl. ...
...cript is loaded. its purpose is to set up the webgl context and start rendering content. // // start here // function main() { const canvas = document.queryselector("#glcanvas"); // initialize the gl context const gl = canvas.getcontext("webgl"); // only continue if webgl is available and working if (gl === null) { alert("unable to initialize webgl. your browser or machine may not support it."); return; } // set clear color to black, fully opaque gl.clearcolor(0.0, 0.0, 0.0, 1.0); // clear the color buffer with specified clear color gl.clear(gl.color_buffer_bit); } window.onload = main; the first thing we do here is obtain a reference to the canvas, assigning it to a variable named canvas. once we have the canvas, we try to get a webglrenderingcontext for i...
...lor(0.0, 0.0, 0.0, 1.0); // clear the color buffer with specified clear color gl.clear(gl.color_buffer_bit); } window.onload = main; the first thing we do here is obtain a reference to the canvas, assigning it to a variable named canvas. once we have the canvas, we try to get a webglrenderingcontext for it by calling getcontext() and passing it the string "webgl". if the browser does not support webgl, getcontext() will return null in which case we display a message to the user and exit. if the context is successfully initialized, the variable gl is our reference to it. in this case, we set the clear color to black, and clear the context to that color (redrawing the canvas with the background color). at this point, you have enough code that the webgl context should successfully in...
Improving compatibility using WebRTC adapter.js - Web APIs
prefixes on some or all webrtc apis. while you can manually code around these issues, there is an easier way. the webrtc organization provides on github the webrtc adapter to work around compatibility issues in different browsers' webrtc implementations. ...
...compatibility issues in different browsers' webrtc implementations. the adapter is a javascript shim which lets your code to be written to the specification so that it will "just work" in all browsers with webrtc support. there's no need to conditionally use prefixed apis or implement other workarounds. note: since there is ongoing fluidity in functionality and naming of api terms in webrtc and supporting browsers, use of this adapter is generally recommended. the adapter is provided under a bsd-style license. what adapter.js does for each version of each browser that supports webrtc, adapter.js implements the needed polyfills, establishes the non-prefixed names of apis, and applies any other changes needed to make the browser run code written to the webrtc specification. for example, ...
...e. what adapter.js does for each version of each browser that supports webrtc, adapter.js implements the needed polyfills, establishes the non-prefixed names of apis, and applies any other changes needed to make the browser run code written to the webrtc specification. for example, on firefox versions older than 38, the adapter adds the rtcpeerconnection.urls property; firefox doesn't natively support this property until firefox 38, while on chrome, the adapter adds support for the promise based api is added if it's not present. these are just a couple of examples; there are of course other adjustments made for you by the shim. the webrtc adapter currently supports mozilla firefox, google chrome, apple safari, and microsoft edge. using adapter.js in order to use adapter.js, you need to ...
Writing WebSocket servers - Web APIs
ritten in any server-side programming language that is capable of berkeley sockets, such as c(++), python, php, or server-side javascript. this is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. this article assumes you're already familiar with how http works, and that you have a moderate level of programming experience. depending on language support, knowledge of tcp sockets may be required. the scope of this guide is to present the minimum knowledge you need to write a websocket server. note: read the latest official websockets specification, rfc 6455. sections 1 and 4-7 are especially interesting to server implementors. section 10 discusses security and you should definitely peruse it before exposing your server. a websocket server...
...must derive it from the sec-websocket-key that the client sent to it. to get it, concatenate the client's sec-websocket-key and the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" together (it's a "magic string"), take the sha-1 hash of the result, and return the base64 encoding of that hash. note: this seemingly overcomplicated process exists so that it's obvious to the client whether the server supports websockets. this is important because security issues might arise if the server accepts a websockets connection but interprets the data as a http request. so if the key was "dghlihnhbxbszsbub25jzq==", the sec-websocket-accept header's value is "s3pplmbitxaq9kygzzhzrbk+xoo=". once the server sends these headers, the handshake is complete and you can start swapping data! note: the server c...
...ctions 1.9, 4.2, 11.3.4, and 11.5 of the spec. a client has to ask for a specific subprotocol. to do so, it will send something like this as part of the original handshake: get /chat http/1.1 ... sec-websocket-protocol: soap, wamp or, equivalently: ... sec-websocket-protocol: soap sec-websocket-protocol: wamp now the server must pick one of the protocols that the client suggested and it supports. if there is more than one, send the first one the client sent. imagine our server can use both soap and wamp. then, in the response handshake, it sends: sec-websocket-protocol: soap the server can't send more than one sec-websocket-protocol header. if the server doesn't want to use any subprotocol, it shouldn't send any sec-websocket-protocol header. sending a blank header is incorrec...
Web Video Text Tracks Format (WebVTT) - Web APIs
al, we can define it as follows using css. where it must be noted that the css uses escape sequences the way they are used in html pages: webvtt 1 00:00.000 --> 00:02.000 that’s an, an, that’s an l! crédit de transcription 00:04.000 --> 00:05.000 transcrit par célestes™ ::cue(#\31) { color: lime; } ::cue(#crédit\ de\ transcription) { color: red; } positioning of text tracks is also supported, by including positioning information after the timings in a cue, as seen below (see cue settings for more information): webvtt 00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35% where did he go? 00:00:03.000 --> 00:00:06.500 position:90% align:right size:35% i think he went down this lane. 00:00:04.000 --> 00:00:06.500 position:45%,line-right align:center size:35%...
...ruby>www<rt>world wide web</rt>oui<rt>yes</rt></ruby> voice tag (<v></v>) similar to class tag, also used to style the contained text using css. example 20 - voice tag <v bob>text</v> interfaces there are two interfaces or apis used in webvtt which are: vttcue interface it is used for providing an interface in document object model api, where different attributes supported by it can be used to prepare and alter the cues in number of ways. constructor is the first point for starting the cue which is defined using the default constructor vttcue(starttime, endtime, text) where starting time, ending time and text for cue can be adjusted. after that we can set the region for that particular cue to which this cue belongs using cue.region. vertical, horizontal, lin...
...ich will run from 1st second to the 5th second, inclusive. following the similar steps, a complete webvtt file for specific video or audio file can be made. css pseudo-classes css pseudo classes allow us to classify the type of object which we want to differentiate from other types of objects. it works in similar manner in webvtt files as it works in html file. ...
Web Audio API best practices - Web APIs
ou are looking at either the grabbing the file from an htmlmediaelement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. both are legitimate ways of working, however, it's more common to use the former when you are working with full-length tracks, and the latter when working with shorter, more sample-like tracks. media elements have streaming support out of the box. the audio will start playing when the browser determines it can load the rest of the file before playing finishes. you can see an example of how to use this with the web audio api in the using the web audio api tutorial. you will, however, have more control if you use a buffer node. you have to request the file and wait for it to load (this section of our advanced article sho...
...is is good for webrtc and situations where you might want to record or possibly analyse audio. the last way is to generate your own sound, which can be done with either an oscillatornode or by creating a buffer and populating it with your own data. check out the tutorial here for creating your own instrument for information on creating sounds with oscillators and buffers. cross browser & legacy support the web audio api specification is constantly evolving and like most things on the web, there are some issues with it working consistently across browsers. here we'll look at options for getting around cross-browser problems. there's the standardised-audio-context npm package, which creates api functionality consistently across browsers, full holes as they are found. it's constantly in deve...
... there's the standardised-audio-context npm package, which creates api functionality consistently across browsers, full holes as they are found. it's constantly in development and endeavours to keep up with the current specification. there is also the option of libraries, of which there are a few depending on your use case. for a good all-rounder, howler.js is a good choice. it has cross-browser support and, provides a useful subset of functionality. although it doesn't harness the full gamut of filters and other effects the web audio api comes with, you can do most of what you'd want to do. if you are looking for sound creation or a more instrument-based option, tone.js is a great library. it provides advanced scheduling capabilities, synths, and effects, and intuitive musical abstractions...
Window: beforeunload event - Web APIs
onbeforeunload this event enables a web page to trigger a confirmation dialog asking the user if they really want to leave the page. if the user confirms, the browser navigates to the new page, otherwise it cancels the navigation. according to the specification, to show the confirmation dialog an event handler should call preventdefault() on the event. ...
... to combat unwanted pop-ups, browsers may not display prompts created in beforeunload event handlers unless the page has been interacted with, or may even not display them at all. ...
...like firefox's back-forward cache or webkit's page cache. the html specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. see the html specification for more details. examples the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue. however, this is not supported by all browsers. window.addeventlistener('beforeunload', (event) => { // cancel the event as stated by the standard. event.preventdefault(); // chrome requires returnvalue to be set. event.returnvalue = ''; }); specifications specification status comment html living standardthe definition of 'beforeunload' in that specification. living standard ...
XRSessionMode - Web APIs
e if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. ...
...rd html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. ...
...sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes the xrsessionmode type indicates the values that can be specified when calling xr.issessionsupported() to determine whether or not the specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr session. the immersive-ar mode supports all the same features and reference spaces that immersive-vr does, since both are immersive sessions. browsers may support either or both of these modes, but if webxr is available, the inline mode is always supported. specifications specification status ...
XRWebGLLayer.antialias - Web APIs
otherwise, this property is false. ...
...otherwise, this property is false. ...
...otherwise, this property is false. when the webxr compositor is enabled, this value corresponds to the value of the antialias property on the object returned by the webgl context's getcontentattributes() method. ...
XRWebGLLayer.framebuffer - Web APIs
being rendered, or null if the xr compositor is disabled for the session. usage notes how opaque framebuffers are special the framebuffer represented by the framebuffer property is opaque. as such, its behavior is different in several ways from a standard webgl context. these differences cause the opaque framebuffer to behave more like the default webgl framebuffer: opaque framebuffers may support anti-aliasing, even under webgl 1.0, which don't normally do so. opaque framebuffers' attachments (buffers and the like) can't be inspected or changed. calling functions such as framebuffertexture2d(), framebufferrenderbuffer(), deleteframebuffer(), or getframebufferattachmentparameter() on an opaque framebuffer results in the webgl error invalid_operation (0x0502). opaque framebuffers are ...
... opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback. attempting to clear, draw to, or read from the framebuffer results in a webgl invalid_framebuffer_operation error (0x0506). calling checkframebufferstatus() on the webgl context from outside the animation frame callback causes the webgl framebuffer_unsupported error (0x8cdd) to be reported. opaque framebuffers initialized with the depth property set to false will not have a depth buffer and will rely on the coordinates alone to determine distance. opaque framebuffers initialized without specifying a stencil will not have a stencil buffer. opaque framebuffers will not have an alpha channel available unless the alpha property is true when creati...
...ll not have a stencil buffer. opaque framebuffers will not have an alpha channel available unless the alpha property is true when creating the layer. the xr compositor assumes that opaque framebuffers use colors with premultiplied allpha, regardless of whether or not the webgl context's premultipliedalpha context attribute is set. note: the depth and stencil properties are not required to be supported in order for a browser to be construed as having full webgl support. the default configuration of a new framebuffer upon creating a new xrwebgllayer, its new framebuffer is initialized just like the default framebuffer for any webgl interface: the color buffer is configured with its clear value set to the color (0, 0, 0, 0) (meaning transparent black). the depth buffer's clear value ...
XSL Transformations in Mozilla FAQ - Web APIs
ing instruction instead of the non-standard xml:stylesheet. the most common cause is the mime type handling. to find out which mime type your server sends, look at page info, use extensions like livehttpheaders or a download manager like wget. mozilla won't load xslt stylesheets from a different domain for security reasons. note: starting in gecko 7.0, both text/xsl and application/xslt+xml are supported mime types for xslt media stylesheets. note that firefox will override your xslt stylesheet if your xml is detected as an rss or atom feed. a known workaround is to add a sufficiently long xml comment to the beginning of your xml file in order to "push" the <feed> or <rss> tag out of the first 512 bytes, which is analyzed by firefox to determine if it's a feed or not. see the discussion o...
... disable-output-escaping? this is actually pretty close to the question above. and in short, no. disabling output escaping requires us to add a parsing step to our output generation, which we don't. in most cases, there are pretty easy workarounds. the only use cases we have seen are bad xml or bad xslt. and rss feeds. the latter is pretty much the only issue to us, and we're sorry that we can't support it. but mixing parsing with xslt is brittle and we rather not support d-o-e than either crash or be even slower. what about document.write? just like for xhtml, document.write is not supported during xslt transformations. sadly, current builds don't error, but just give unexpected results, like crashes (bug 202765). in most cases, there is no need to actually use it, though. if you need pla...
..., see using the mozilla javascript interface to xsl transformations. why does internet explorer require a different xslt namespace than mozilla? ie up to version 6 required a deprecated namespace of a xslt working draft, please update to mozilla ;-), ie6+ or msxml3+, as it is fixed there. as the differences between xslt1.0 and the ie implementation of that wd are significant, we offer no legacy support. how do i build the standalone version of transformiix? see the building transformiix standalone page. original document information author(s): axel hecht last updated date: february 2, 2005 copyright information: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative commons license ...
Web APIs
Web › API
atasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent...
...der mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechannel messageevent messageport metadata mimetype mimetypearray mouseevent mousescrollevent mousewheelevent mutationevent mutationobserver mutationobserverinit mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid n...
...texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multiview2 offlineaudiocompletionevent offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitionevent paintworklet pannernode parentnode passwordcredential path2d payererrors paymentaddress paymentcurrencyamount paymentdetailsbase paymentdetailsupdate paymentitem paymentmethodchangeevent paymentrequest paymentrequestevent paymentrequestupdateevent paymentresponse paymentvalidationerrors pbkdf2params performance performanceentry performanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist p...
Using the status role - Accessibility
a braille display to render the status. possible effects on user agents and assistive technology when the status role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a status role in the operating system's accessibility api. fire an accessible status event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers may provide a special key to announce the current status, and this should present the contents of any status live region. these should be announced when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen ma...
...w shows how the status role is added directly into the html source code. ...
...e html source code. ...
ARIA annotations - Accessibility
" and role="deletion" above). role="comment" — semantically denotes a comment/reaction to some content on the page, or to a previous comment. to provide a semantic association between the document content being annotated and the annotation, an aria-details attribute can be set on the annotated content that contains the id of the annotated element. aria-details has been updated so that it can support multiple ids — this makes sense, for example you can easily envisage having multiple comments relating to the same bit of text. aria annotation roles and objects are currently exposed in: firefox from version 75 onwards, on windows and linux (on macos, we are first waiting for apple to define what safari will expose as apple-dialect attributes to voiceover, and will then follow suit.) ...
... associating annotated elements with their details there are a number of different ways in which you can associate ui features with text labels or descriptions for accessibility purposes. i...
...ion 81 onwards, currently behind the #enable-accessibility-expose-aria-annotations flag (go to chrome://flags to enable this.) unfortunately, you won’t be able to use any of these yet, as screenreader support is currently not there. for the moment, you can see the annotations data being exposed with tools like firefox accessibility inspector. the annotations should just work once screenreader support is added. associating annotated elements with their details there are a number of different ways in which you can associate ui features with text labels or descriptions for accessibility purposes. it is useful to know when to use each. you’ll see examples of most of these later on in the article, but briefly: aria-label="" can be set on an element to provide a brief descriptive label w...
ARIA: gridcell role - Accessibility
e creates a table-style grouping of information: <h3 id="table-title">jovian gas giant planets</h3> <div role="grid" aria-describedby="table-title"> <div role="rowgroup"> <div role="row"> <div role="columnheader">name</div> <div role="columnheader">diameter (km)</div> <div role="columnheader">length of day (hours)</div> <div role="columnheader">distance from sun (10<sup>6</sup>km)</div> <div role="columnheader">number of moons</div> </div> </div> <div role="rowgroup"> <div role="row"> <div role="gridcell">jupiter</div> <div role="gridcell">142,984</div> <div role="gridcell">9.9</div> <div role="gridcell">778.6</div> <div role="gridcell">67</div> </div> </div> <div role="rowgroup"> <div role="row"> ...
...if at all possible, utilize native html table markup in their place. best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an aria role, state or property ...
... </div> </div> <div role="rowgroup"> <div role="row"> <div role="gridcell">saturn</div> <div role="gridcell">120,536</div> <div role="gridcell">10.7</div> <div role="gridcell">1433.5</div> <div role="gridcell">62</div> </div> </div> </div> accessibility concerns support for gridcell and certain gridcell-related aria roles and properties have poor support with assistive technologies. if at all possible, utilize native html table markup in their place. best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an aria role, state or property to make it accessible. as such, it is recommended to use the utilize native html table...
Alerts - Accessibility
he event handler. we need to change the two inputs for e-mail and name for this: <input name="name" id="name" aria-required="true" onblur="checkvalidity('name', ' ', 'invalid name entered!');"/> <br /> <input name="email" id="email" aria-required="true" onblur="checkvalidity('email', '@', 'invalid e-mail address');"/> testing the example if you use firefox 3 and a currently-supported screen reader, try the following: enter only your first name as the name. when tabbing, you’ll hear an alert that tells you you’ve entered an invalid name. you can then shift-tab back and correct the error. enter an e-mail address without the “@” symbol. when tabbing out of this field, you should hear a warning that says you didn’t enter a valid e-mail address. in both cases...
...t that tells you you’ve entered an invalid name. you can then shift-tab back and correct the error. enter an e-mail address without the “@” symbol. when tabbing out of this field, you should hear a warning that says you didn’t enter a valid e-mail address. in both cases, when returning focus to the field in question, your screen reader should tell you that this field is invalid. ...
...error. enter an e-mail address without the “@” symbol. when tabbing out of this field, you should hear a warning that says you didn’t enter a valid e-mail address. in both cases, when returning focus to the field in question, your screen reader should tell you that this field is invalid. jaws 9 supports this, but jaws 8 does not, so this may not work in all versions of the screen readers supported. a few questions that you might have q. why did you put both “(required)” in the label text and the aria-required attribute on some of the inputs? a. if this were a real live form, and the site was being visited by a browser that does not yet support aria, we’d still want to give an indication that this is a required field. q. why don’t you set focus back to the invalid field ...
Accessibility: What users can do to browse more safely - Accessibility
taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions. personalization and accessibility settings from the article, "understanding success criterion 2.3.1: three flashes or below threshold" "flashing can be caused by the display, the computer rendering the image or by the content being rendered. the author has no control of the first two. ...
...ty settings can actually be a money-saving endeavor. one work station can be set up to acommodate both a low-vision individual (needs high-contrast) and to accomodate an individual with photosensitive susceptibilities, by simply, adjusting personalization and accessiblity settings. use modern browers. learn personalization and accessibility settings firefox 73 and above (dekstop) firefox added support for css prefers-reduced-motion in october 2018. chrome 74 and above (desktop) chrome 74 added support for reduced-motion-query, it has even added support to detect whether the user has requested a reduced motion experience. the user would access this through an accessibility interface, as seen below. css transition events are now supported. examples include: transitionrun transitions...
...ld access this through an accessibility interface, as seen below. css transition events are now supported. ...
Accessibility Information for Web Authors - Accessibility
roup (pfwg) to address the issue of accessible dhtml. dynamic web content is not accessible, because it uses vanilla <div>'s and <span>'s combined with javascript rather than declarative markup to describe the behavior of custom widgets such as menus and tree views. these widgets are usually not even keyboard focusable. furthermore, assistive technologies do not understand what these widgets are supposed to be, or what state they are in or what they are capable of. this document tackles such difficulties and shows several interactive desktop-style widgets such as tree views, menu bars and spreadsheets which are accessible both with the keyboard and assistive technologies such as screen readers, screen magnifiers and alternative input devices. join the mozilla accessibility community live ...
...is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Web accessibility for seizures and physical reactions - Accessibility
ond) and lower than 55 hz. the epilepsy foundation's article "take advantage of media queries with <style> in setting up media queries, you are enabling controls by the user; these controls are made available in the browser or in the os. see the mdn document, "accessibility: what users can to to browse more safely" to see more details of how a user accesses the controls. prefers-reduced-motion support for prefers-reduced-motion in modern browsers is growing. @media screen and (prefers-reduced-motion: reduce) { } @media screen and (prefers-reduced-motion) { } to see a great example of how to use the code prefers-reduced-motion, visit the mdn document, prefers-reduced-motion, or see the example below from the section on new in chrome 74. button { animation: vibrate 0.3s linear infinite ...
... great example of how to use the code prefers-reduced-motion, visit the mdn document, prefers-reduced-motion, or see the example below from the section on new in chrome 74. button { animation: vibrate 0.3s linear infinite both; } @media (prefers-reduced-motion: reduce) { button { animation: none; } } prefers-color-scheme this can be useful if the ambient light api is not available. support is emerging. @media (prefers-color-scheme: dark) { /* adust styles for dark mode */ } window​.match​media() there is a powerful tool available to developers via window.matchmedia(). a great resource is mdn's document on window.matchmedia() media update feature the more often the screen is refreshed, the more stable it appears to the human eye, and the less it "flickers". the vast...
...-reduced-transparency media feature is used to detect if the user has requested the system minimize the amount of transparent or translucent layer effects it uses. mediaquerylist interface section 4.2 from the csswg.org drafts integrates with the event loop defined in html. [html] for the mediaquerylist object. see the mdn document, mediaquerylist for more information. personalization help and support the requirement for the literal property is taken from section 23 non-literal text and images requirement: some users cannot understand non-literal text and icons such as metaphors, idioms etc. the literal property is intended to identify text or images as non-literal and allows the author to explain non-literal text and images to users. transitions (for css and svg) the following is from...
:focus-visible - CSS: Cascading Style Sheets
the :focus-visible pseudo-class applies while an element matches the :focus pseudo-class and the ua (user agent) determines via heuristics that the focus should be made evident on the element. (many browsers show a “focus ring” by default in this case.) this selector is useful to provide a different focus indicator based on the user’s input modality (mouse vs. keyboard). note that firefox supports similar functionality through an older, prefixed pseudo-class — :-moz-focusring. syntax :focus-visible examples basic example in this example, the :focus-visible selector uses the ua's behavior to determine when to match. compare what happens when you click on the different controls with a mouse, versus when you tab through them using a keyboard. note the difference in behavior from e...
...ol, such as a custom element button, can use :focus-visible to selectively apply a focus indicator only on keyboard-focus. this matches the native focus behavior for controls like <button>. ...
...n>. <custom-button tabindex="0" role="button">click me</custom-button> custom-button { display: inline-block; margin: 10px; } custom-button:focus { /* provide a fallback style for browsers that don't support :focus-visible */ outline: none; background: lightgrey; } custom-button:focus:not(:focus-visible) { /* remove the focus indicator on mouse-focus for browsers that do support :focus-visible */ background: transparent; } custom-button:focus-visible { /* draw a very noticeable focus style for keyboard-focus on browsers that do support :focus-visible */ outline: 4px dashed darkorange; background: transparent; } polyfill you can polyfill :focus-visible using focus-visible.js. accessibility concerns low vision make sure the visual focus indica...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
this article provides a set of mixins for those who want to mess around with flexbox using the native support of current browsers. this set uses: fallbacks using 2009 'box' syntax (ff and older webkit) and prefixed syntaxes (ie10, webkit browsers without flex wrapping) final standards syntax (ff, safari, chrome, ie11+, edge, opera) this was inspired by: http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/ with help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexyboxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ a complete guide to flexbox | css-tricks visual guide to css3 flexbox: flexbox playground | note: mixins are not currently supported natively in browsers. instead, you wil...
... is consulted instead of the main size property to determine the main size of the element. if an element is not a flex item, flex has no effect. values: see the flex reference for values and default spec: https://drafts.csswg.org/css-flexbox/#flex-property @mixin flex($fg: 1, $fs: 0, $fb: auto) { // set a variable to be used by box-flex properties $fg-boxflex: $fg; // box-flex only supports a flex-grow value so lets grab the // first item in the list and just return that. @if type-of($fg) == 'list' { $fg-boxflex: nth($fg, 1); } -webkit-box: $fg-boxflex; -moz-box: $fg-boxflex; -webkit-flex: $fg $fs $fb; -ms-flex: $fg $fs $fb; flex: $fg $fs $fb; } flexbox justify content the justify-content property aligns flex items along the main axis of the current line...
... current line of the flex container. this is done after any flexible lengths and any auto margins have been resolved. typically, it helps to distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. it also exerts some control over the alignment of items when they overflow the line. note: space-* values not supported in older syntaxes. values: flex-start (default) | flex-end | center | space-between | space-around spec: https://drafts.csswg.org/css-flexbox/#justify-content-property @mixin justify-content($value: flex-start) { @if $value == flex-start { -webkit-box-pack: start; -moz-box-pack: start; -ms-flex-pack: start; } @else if $value == flex-end { -webkit-box-pack: end; ...
Using CSS gradients - CSS: Cascading Style Sheets
uch as in backgrounds. because gradients are dynamically generated, they can negate the need for the raster image files that traditionally were used to achieve similar effects. in addition, because gradients are generated by the browser, they look better than raster images when zoomed in, and can be resized on the fly. we'll start by introducing linear gradients, then introduce features that are supported in all gradient types using linear gradients as the example, then move on to radial, conic and repeating gradients using linear gradients a linear gradient creates a band of colors that progress in a straight line. a basic linear gradient to create the most basic type of gradient, all you need is to specify two colors. these are called color stops. you must have at least two, but you c...
...the backgrounds are stacked from top to bottom, with the first specified being on top. <div class="layered-image"></div> div { width: 300px; height: 150px; } .layered-image { background: linear-gradient(to right, transparent, mistyrose), url("https://mdn.mozillademos.org/files/15525/cri...
...however, the repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() functions are available to offer this functionality. the size of the gradient line or arc that repeats is the length between the first color stop value and the last color stop length value. if the first color stop just has a color and no color stop length,...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
block dimension is the other dimension, and the direction in which blocks — such as paragraphs — display one after the other. in english and arabic these run vertically, whereas in any vertical writing mode these run horizontally. ...
...y one after the other. in english and arabic these run vertically, whereas in any vertical writing mode these run horizontally. the below diagram shows the inline and block directions in a horizontal writing mode: this diagram shows block and inline in a vertical writing mode: browser support logical properties and values can be thought of as a couple of groups in terms of current browser support. some of the properties are essentially mappings from the physical versions, for example inline-size for width or margin-inline-start rather than margin-left. these mapped properties are starting to see good browser support, and if you look at the individual pages for the properties in the reference here on mdn you will see that edge is the only modern browser currently missing these. there ...
...o decide what to do about the four-value shorthands for logical properties, for example the equivalents to setting four physical properties at once, like margins with the margin property. we would need some kind of modifier if we were to reuse margin for flow-relative properties. if you would like to read the suggestions or comment on them the relevant github issue is #1282. testing for browser support you can test for support of logical properties and values using feature queries. for example you could set a width, test for inline-size and, if it is supported, set the width to auto and the inline-size to the original width value. ...
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
will apply to the start of that dimension, the second to the end. if you only use one value it is applied to both. in a horizontal writing mode this css would apply a 5px margin to the top of the box and a 10px margin to the bottom. .box { margin-block: 5px 10px; } note: the shorthand properties margin-inline and margin-block shipped in firefox 66. as these are new properties check browser support before using. padding examples the mapped padding properties of padding-inline-start, padding-inline-end, padding-block-start, and padding-inline-end can be used instead of their physical counterparts. in the example below i have two boxes, one of which is using physical padding properties and the other logical padding properties. with a writing-mode of horizontal-tb, both boxes should ap...
...ding-block — which allow you to set the padding of the two inline, and two block dimensions, respectively. in a horizontal writing-mode this css would apply 5px of padding to the top of the box and 10px of padding to the bottom: .box { padding-block: 5px 10px; } note: the shorthand properties padding-inline and padding-block shipped in firefox 66. as these are new properties check browser support before using. border examples the border properties are the main reason that logical properties and values seems to have so many properties, as we have the longhands for the color, width, and style of the border on each side of a box, along with the shorthand to set all three at once for each side. as with margin and padding we have a mapped version of each physical property. the demo bel...
...ne dimension. the below code, in a horizontal writing mode, would give you a 2px green solid border on the top and bottom of the box, and a 4px dotted purple border on the left and right. .box { border-block: 2px solid green; border-inline-width: 4px; border-inline-style: dotted; border-inline-color: rebeccapurple; } note: these two value shorthands shipped in firefox 66, check browser support before using as other browsers may not have implemented them yet. flow relative border-radius properties the specification has fairly recently added flow-relative values for the border-radius longhands. these have not yet been implemented by any browser. the below example, in a horizontal writing-mode, would set the top-right border radius to 1em, the bottom-right to 0, the bottom-left to ...
Using media queries - CSS: Cascading Style Sheets
level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the output device deprecated in media queries level 4. device-height height of the rendering surface o...
...(all and (monochrome)) { ... } ... rather than like this: @media (not all) and (monochrome) { ... } as another example, the following media query: @media not screen and (color), print and (color) { ... } ... is evaluated like this: @media (not (screen and (color))), print and (color) { ... } improving compatibility with older browsers the only keyword prevents older browsers that do not support media queries with media features from applying the given styles. it has no effect on modern browsers. @media only screen and (color) { ... } syntax improvements in level 4 the media queries level 4 specification includes some syntax improvements to make media queries using features that have a "range" type, for example width or height, less verbose. level 4 adds a range context for writi...
...vements in level 4 the media queries level 4 specification includes some syntax improvements to make media queries using features that have a "range" type, for example width or height, less verbose. level 4 adds a range context for writing such queries. for example, using the max- functionality for width we might write the following: note: the media queries level 4 specification has reasonable support in modern browsers, but some media features are not well supported. see the @media browser compatibility table for more details. @media (max-width: 30em) { ... } in media queries level 4 this can be written as: @media (width <= 30em) { ... } using min- and max- we might test for a width between two values like so: @media (min-width: 30em) and (max-width: 50em) { ... } this would conver...
Selector list - CSS: Cascading Style Sheets
lectors in a single line using a comma-separated lists. h1, h2, h3, h4, h5, h6 { font-family: helvetica; } multi line grouping grouping selectors in a multiple lines using a comma-separated lists. #main, .content, article { font-size: 1.1em; } selector list invalidation a downside to using selector lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:maybe-unsupported, h3 { font-family: sans-serif } this is because a single unsupported selector in a selector list invalidates the whole rule. a way to remedy this us to use the :is() selector, which simply ignores invalid selectors in its arguments, but at the cost of all selectors having the same specificity, because of ...
... working draft renamed to "selector list" css level 1the definition of 'grouping' in that specification. ...
...ctor in a selector list invalidates the whole rule. a way to remedy this us to use the :is() selector, which simply ignores invalid selectors in its arguments, but at the cost of all selectors having the same specificity, because of how :is() calculates specificity. h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } :is(h1, h2:maybe-unsupported, h3) { font-family: sans-serif } specifications specification status comment selectors level 4the definition of 'selector lists' in that specification. working draft renamed to "selector list" css level 1the definition of 'grouping' in that specification. recommendation initial definition ...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ppearance css property is used to display an element using platform-native styling, based on the operating system's theme. the -moz-appearance and -webkit-appearance properties are non-standard versions of this propery, used (respectively) by gecko (firefox) and by webkit-based (e.g., safari) and blink-based (e.g., chrome, opera) browsers to achieve the same thing. note that firefox and edge also support -webkit-appearance, for compatibility reasons. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the -moz-appearance property was used in xul stylesheets to design custom widgets with platform-appropriate styling. it ...
...idgets with platform-appropriate styling. it was also used in the xbl implementations of the widgets that ship with the mozilla platform. starting with gecko/firefox 80, these uses were changed to -moz-default-appearance, which should never be used outside of internal stylesheets. compatibility note: if you wish to use this property on websites, you should test it very carefully. although it is supported in most modern browsers, its implementation varies widely. in older browsers, even the keyword none does not have the same effect on all form elements across different browsers, and some do not support it at all. the differences are smaller in the newest browsers. syntax /* css basic user interface module level 4 values */ appearance: none; appearance: auto; appearance: menulist-button; ...
...m</div> firefox use textarea instead. -apple-pay-button div{ color: black; -webkit-appearance: -apple-pay-button; } <div>lorem</div> safari ios and macos only. available on the web starting in ios 10.1 and macos 10.12.1 obsolete values the following values were at some point implemented for a prefixed property, but are no longer supported. value browser description 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 dualb...
attr() - CSS: Cascading Style Sheets
Web › CSS › attr
the attr() css function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. it can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned. ...
... editor's draft changed it...
...the validation of the attribute value is deferred to computed value time. css values and units module level 3the definition of 'attr()' in that specification. candidate recommendation added two optional parameters; can be used on all properties; may return values other than <string>. these changes are experimental and may be dropped during the cr phase if browser support is too small. css level 2 (revision 1)the definition of 'attr()' in that specification. recommendation limited to the content property; always returns a <string>. ...
background-image - CSS: Cascading Style Sheets
n if the images are opaque and the color won't be displayed in normal circumstances, web developers should always specify a background-color. if the images cannot be loaded—for instance, when the network is down—the background color will be used as a fallback. syntax each background image is specified either as the keyword none or as an <image> value. ...
... accessibility concerns browsers do not provide any special information on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. ...
.../startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-color: transparent; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-image' in that specification. candidate recommendation from css2 revision 1, the property has been extended to support multiple backgrounds and any <image> css data type. css level 2 (revision 1)the definition of 'background-image' in that specification. recommendation from css1, the way images with and without intrinsic dimensions are handled is now described. css level 1the definition of 'background-image' in that specification. recommendation initial definition. ...
<image> - CSS: Cascading Style Sheets
Web › CSS › image
ground positioning area list-style-image the size of a 1em character border-image-source the size of the element's border image area cursor the browser-defined size matching the usual cursor size on the client's system mask-image ? shape-outside ? mask-border-source ? symbols for @counter-style at risk feature. if supported, the browser-defined size matching the usual cursor size on the client's system content for a pseudo-element (::after/::before) a 300px × 150px rectangle the concrete object size is calculated using the following algorithm: if the specified size defines both the width and the height, these values are used as the concrete object size. if the specified size defines onl...
...the height, the concrete object size is calculated so that it matches the intrinsic aspect ratio of the image but without exceeding the default object size in any dimension. if the image has no intrinsic aspect ratio, the intrinsic aspect ratio of the object it applies to is used; if this object has none, the missing width or height are taken from the default object size. note: not all browsers support every type of image on every property. see the browser compatibility section for details. accessibility concerns browsers do not provide any special information on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critical to...
...if language is rtl, the image will be horizontally flipped. */ cross-fade(20% url(twenty.png), url(eighty.png)) /* cross faded images, with twenty being 20% opaque and eighty being 80% opaque. */ image-set('test.jpg' 1x, 'test-2x.jpg' 2x) ...
mask-border-outset - CSS: Cascading Style Sheets
responding border-width. ...
...lue0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet. ...
...ax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across the border, rather than the inside of it. mask-border-outset: 1rem; chromium-based browsers support an outdated version of this property — mask-box-image-outset — with a prefix: -webkit-mask-box-image-outset: 1rem; note: the mask-border page features a working example (using the out-of-date prefixed border mask properties supported in chromium), so you can get an idea of the effect. specifications specification status comment css masking module level 1t...
mask-border-repeat - CSS: Cascading Style Sheets
will be distributed in between tiles to achieve the proper fit. ...
...per fit. formal definition initial valuestretchapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet. ...
...ound | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define how the border mask slice will repeat around the border — i.e. will it just repeat, or be scaled slightly so a whole number of slices fits, or be stretched so one slice fits? mask-border-repeat: round; chromium-based browsers support an outdated version of this property — mask-box-image-repeat — with a prefix: -webkit-mask-box-image-repeat: round; note: the mask-border page features a working example (using the out-of-date prefixed border mask properties supported in chromium), so you can get an idea of the effect. specifications specification status comment css masking module level 1...
Mutation events - Developer guides
ication, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. ...
...nts are performance issues and cross-browser support. performance adding dom mutation listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event listeners. cross-browser support these events are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributena...
... are not implemented consistently across different browsers, for example: ie prior to version 9 didn't support the mutation events at all and does not implement some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument d...
Touch events (Mozilla experimental) - Developer guides
this api allowed you to track the movement of the user's finger on a touch screen, monitoring the raw touch events generated by the system. ...
...this api allowed you to track the movement of the user's finger on a touch screen, monitoring the raw touch events generated by the system. ...
...this api allowed you to track the movement of the user's finger on a touch screen, monitoring the raw touch events generated by the system. ...
Event developer guide - Developer guides
Web › Guide › Events
rovides several ways to get notified of dom events. two common styles are: the generalized addeventlistener() and a set of specific on-event handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks.mutation eventsmutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom. use mutation observers instead if possible. orientation and motion data ...
... ...
... ...
Introduction to HTML5 - Developer guides
html5 is the fifth revision and newest version of the html standard. it offers new features that provide not only rich media support but also enhance support for creating web applications that can interact with users, their local data, and servers more easily and effectively than was previously possible. some html5 features remain unsupported by some browsers. however, gecko, and by extension, firefox, has very good support for html5, and work continues toward supporting more of its features. gecko began supporting some html5 features in version 1.8.1. you can find a list of all of the html5 features that gecko currently supports on the main html5 page. for detailed information about multiple browsers' support of html5 features, refer to the caniuse website. declaring that the docum...
... this is much simpler than the former doctypes, and shorter, making it easier to remember and reducing the amount of bytes that must be downloaded. ...
... this is much simpler than the former doctypes, and shorter, making it easier to remember and reducing the amount of bytes that must be downloaded. ...
Using HTML sections and outlines - Developer guides
w you how. if a significant percentage of your particular target audience is using internet explorer 8 or older, then you can follow the below instructions to make them behave as expected. however, global usage of these browsers is now very small, so this is unlikely. html5 semantic elements don't need a special dom interface, but they will need a specific css styling in older browser that don't support them explicitly. unknown elements are styled as display: inline by default, so you'll want to set them to display: block: article, aside, footer, header, nav, section { display: block; } of course the web developer can style them differently, but keep in mind that in a non-html5 browser, the default styling is different from what is expected for such elements. also note that the <time> e...
...} of course the web developer can style them differently, but keep in mind that in a non-html5 browser, the default styling is different from what is expected for such elements. also note that the <time> element has not been included, because the default styling for it in a non-html5 browser is the same as the one in an html5-compatible one. next up, older ie versions do not allow styling of unsupported elements, unless you create an instance of them in the dom. you can add a specific script to allow this, as seen below: <!--[if lt ie 9]> <script> document.createelement("article"); document.createelement("aside"); document.createelement("footer"); document.createelement("header"); document.createelement("nav"); document.createelement("section"); document.crea...
...led that your page relies on javascript: <noscript> <p><strong>this web page requires javascript to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> this leads to the following code to allow the support of the html5 sections and headings elements in non-html5 browsers, even for internet explorer (8 and older), with a proper fallback for the case where this latter browser is configured not to use scripting: <!--[if lt ie 9]> <script> document.createelement("article"); document.createelement("aside"); document.createelement("footer"); document.createelement("header"); do...
Separate sites for mobile and desktop - Developer guides
.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 optimized for speed. conceptually simple, this is the easiest option to add to an existing site, especially if you are using a cms or web application that supports templates. since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best performance out of any of the other options presented here. finally, it also allows for completely different user experiences on desktop and mobile — they’re two different sites, after all! the bad unfortunately, this approach is not without its drawback...
...e positives are particularly scary — it could be embarrassing to serve desktop users your mobile site accidentally. when it is right to choose this option firstly, if your target audience includes users on older or low-end feature phones, it is worth noting that you may need to employ this strategy to some degree no matter what. this is because the default browsers on some feature-phones do not support the same markup that you would use to code a website targeted at the desktop, but instead understand formats like xhtml-mp or the older wml. this factor aside, there is one case where this strategy really shines over other methods. if the functionality you would like to provide to your users on mobile devices is extremely different from that on a desktop, then using separate sites is simply l...
...f you cannot, for whatever reason, modify your existing desktop site, and need to have a 100% separate mobile site. though it’s not ideal, at least you have this option. examples most of the major web applications you see in the wild have chosen this path, including facebook, youtube, digg, and flickr. in fact, mozilla picked this strategy for the mobile versions of addons.mozilla.org (amo) and support.mozilla.org (sumo). if you’d like to see the source code behind an example of this approach in action, feel free to check out the github repository for amo or sumo. approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms. what is mobile-friendliness? responsive design a hybrid approach original documen...
Writing forward-compatible websites - Developer guides
hese guidelines. sniffing sniff for specific features if you plan to use some feature, use object-detection to sniff for that exact feature, if possible. as a simple example, don't assume that any browser in which "filter" in body.style tests true must be microsoft internet explorer and therefore e.g. will have a window.event object available in event handlers. don't assume that browsers with support for a given dom feature must also have some other, especially nonstandard, dom feature. or, conversely, that they don't have support for some other feature (e.g., don't assume that a browser that supports onload on script elements will never support onreadystatechange on them). as browsers converge behavior, they both add features and remove them. they also fix bugs. all three of these have ...
...e-it-pretty property, with a behavior for the value "sometimes" that differs from the prefixed version: <style> .pretty-element { -vnd-make-it-pretty: sometimes; make-it-pretty: sometimes; } </style> the order of the declarations in the rule above is important: the unprefixed one needs to come last. don't use unprefixed versions of css properties or apis until at least one browser supports them until there's decently widespread support of the unprefixed version of something, its behavior can still change in unexpected ways. most especially, don't use the unprefixed version if no browser actually supports it. you can't assume that the syntax of the final version will be the same as the syntax of any of the prefixed versions. code hygiene avoid missing > passing a validator...
...way to ensure this, but even if your website doesn't validate entirely you should make sure all your > characters are present. missing those can lead to unexpected situations due to a following tag name being treated as an attribute on a previous tag. this can work for a bit, then break if a specification attaches a meaning to that attribute. here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <form action="http://www.example.com"> <input type="submit" value="submit the form" </form> due to the missing > on the input tag. don't leave experiments that didn't work in your code if you try using a css property to do something you want, but it has no effect, remove it. it might start doing something you don't expect in the future ...
disabled - HTML: Hypertext Markup Language
d with the form. the user can neither edit nor focus on the control, nor it's form control descendants. if the disabled attribute is specified on a form control, the element and its form control descendants do not participate in constraint validation. often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. this boolean disabled attribute indicates that the user cannot interact with the control or it's descendant controls. if this attribute is not specified, the control inherits its setting from the containing element, for example fieldset; if there is no containing element with the disabled ...
...bled attribute set, and the control itself does not have the attribute, then the control is enabled. if declared on an <optgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the option group are selectable. note: if a <fieldset> is disabled, the descendant form controls are all disabled, with the exception of form controls within the <legend>. when a supporting element has the disabled attribute applied, the :disabled pseudo-class also applies to it. conversely, elements that support the disabled attribute but don't have the attribute set match the :enabled pseudo-class. this boolean attribute prevents the user from interacting with the button. if this attribute isn't set, the button can still be disabled from a containing element, for example <...
... such as pattern, have no effect, until the control is enabled. note: the required attribute is not permitted on inputs with the disabled attribute specified. usability browsers display disabled form controls greyed as disabled form controls are immutable, won't receive focus or any browsing events, like mouse clicks or focus-related ones, and aren't submitted with the form. if present on a supporting elements, the :disabled pseudo class will match. if the attribute is not included, the :enabled pseudo class will match. if the element doesn't support the disabled attribute, the attribute will have no effect, including not leading to being matched by the :disabled and :enabled pseudo classes. constraint validation if the element is disabled, then the element's value can not receive foc...
HTML attribute: readonly - HTML: Hypertext Markup Language
the boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control. if the readonly attribute is specified on an input element, because the user can not edit the input, the element does not participate in constraint validation. the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number<input> types and the <textarea> form control elements. ...
...nstraint validation. the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, datetime-local, and number<input> types and the <textarea> form control elements. if present on any of these input types and elements, the :read-only pseudo class will match. if the attribute is not included, the :read-write pseudo class will match. the attribute is not supported or relevant to <select> or input types that are already not mutable, such as checkbox and radio or cannot, by definition, start with a value, such as the file input type. range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a form that is hidden. nor is it supported on any of the button types, including image. ...
... attribute interactions the difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled. ...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
rouped into a set in which only one radio button can be selected at a time, whereas checkboxes allow you to turn single values on and off. where multiple controls exist, radio buttons allow one to be selected out of them all, whereas checkboxes allow multiple values to be selected. value a domstring representing the value of the checkbox. events change and input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox. this is never seen on the client-side, but on the server this is the value given to the data submitted with the checkbox's name. take the following example: <form> <div> <input type="checkbox" id="subsc...
...checked state (e.g. value=unchecked); the value is not submitted to the server at all. if you wanted to submit a default value for the checkbox when it is unchecked, you could include an <input type="hidden"> inside the form with the same name and value, generated by javascript perhaps. ...
... if(checkedcount === ingredients.length) { overall.checked = true; overall.indeterminate = false; } else { overall.checked = false; overall.indeterminate = true; } } note: if you submit a form with an indeterminate checkbox, the same thing happens as if the checkbox were unchecked — no data is submitted to represent the checkbox. validation checkboxes do support validation (offered to all <input>s). however, most of the validitystates will always be false. if the checkbox has the required attribute, but is not checked, then validitystate.valuemissing will be true. examples the following example is an extended version of the "multiple checkboxes" example we saw above — it has more standard options, plus an "other" checkbox that when checked causes...
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
. submit buttons that take the form of an image rather than text. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input>...
..., src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. ...
...ctype or the form's enctype attribute. this url is then sent to the server using an http get request. this method works well for simple forms that contain only ascii characters and have no side effects. this is the default value. post the form's data is included in the body of the request that is sent to the url given by the formaction or action attribute using an http post request. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the input is associated, and does not transmit the form data at all. this attribute is also available on <input type="submit"> and <button> elements. formnovalidate a boolean attribute which, if present, specifies that the form should not be validated before sub...
<input type="submit"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › submit
<input> elements of type submit are rendered as buttons. when the click event occurs (typically because the user clicked the button), the user agent attempts to submit the form to the server. <input type="submit" value="send request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label. buttons do not have a true value otherwise. <input type="submit" value="send request"> if you don't specify a value, the button will have a default label, chosen by the user agent. this label is likely to be something along the line...
...equest"> if you don't specify a value, the button will have a default label, chosen by the user agent. this label is likely to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form. formnovalidate a boolean which, ...
...nctype or the form's enctype attribute. this url is then sent to the server using an http get request. this method works well for simple forms that contain only ascii characters and have no side effects. this is the default value. post the form's data is included in the body of the request that is sent to the url given by the formaction or action attribute using an http post method. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the input is associated, and does not transmit the form data at all. this attribute is also available on <input type="image"> and <button> elements. formnovalidate a boolean attribute which, if present, specifies that the form should not be validated before subm...
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
pe text create basic single-line text fields. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the text contained in the text field. events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange(). value the value attribute is a domstring that contains the current value of the text entered into the text field. you can retrieve this using the value property in...
...e of the text entered into the text field. you can retrieve this using the value property in javascript. let thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string (""). ...
... a safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. permitted values are: on enable automatic correction of typos, as well as processing of text substitutions if any are configured. off disable automatic correction and text substitutions. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing the field. this information is used to decide what kind of label to use on the enter key on the virtual keyboard. note: this has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. to see the status of the ch...
<isindex> - HTML: Hypertext Markup Language
Web › HTML › Element › isindex
<isindex> is removed html standard. it was deprecated in html 4.01. the same behaviour can be achieved with an html form. all major browsers have now removed <isindex>. ...
...or making queries is mentioned in reference to dynatext browser: "the browser displays toggle buttons, text fields etc. the user fills in the fields, clicks ok, and the query results come up in the table of contents window." a thread about isindex in november 1992, kevin hoadley questioned the need for an isindex element and proposed to drop it. he proposed to have instead an input element (idea supported by steve putz). tim berners-lee explains the purpose of isindex resulting in aggregated search results. kevin replies that he doesn't like the boolean nature of isindex and would prefer a system where everything is searchable and proposes to extend the current www framework with a specific httpd configuration and defined that some uris mapping create search queries. in 2016, after it was r...
... isindex and would prefer a system where everything is searchable and proposes to extend the current www framework with a specific httpd configuration and defined that some uris mapping create search queries. in 2016, after it was removed from edge and chrome, it was proposed to remove isindex from the standard; this removal was completed the next day, after which safari and firefox also removed support. html reference the html standard classifies it as a obsolete and non-conforming feature. isindex element deprecated in html 4.01 isindex in html 3.2 isindex in html 2.0 as well the description of the behavior in queries and indexes (html 2.0) isindex in html+ ...
Standard metadata names - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name
lbars. the primary use for <meta name="color-scheme"> is to indicate compatibility with—and order of preference for—light and dark color modes. the value of the content property for color-scheme may be one of the following: normal the document is unaware of color schemes and should simply be rendered using the default color palette. ...
...by specification, only dark is not valid, because forcing a document to render in dark mode when it isn't truly compatible with it can result in unreadable content; all major browsers default to light mode if not otherwise configured. ...
...use a robots.txt file. if you want to remove a page, noindex will work, but only after the robot visits the page again. ensure that the robots.txt file is not preventing revisits. some values are mutually exclusive, like index and noindex, or follow and nofollow. in these cases the robot's behaviour is undefined and may vary between them. some crawler robots, like google, yahoo and bing, support the same values for the http header x-robots-tag; this allows non-html documents like images to use these rules. specifications specification html living standardthe definition of 'standard metadata names' in that specification. css color adjustment module level 1the definition of 'the "color-scheme" metadata name' in that specification. css ...
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
Web › HTML › Element › rp
one <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. ...
...licit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes ruby annotations are for showing pronunciation of east asian characters, like using japanese furigana or taiwanese bopomofo characters. the <rp> element is used in the case of lack of <ruby> element support; the <rp> content provides what should be displayed in order to indicate the presence of a ruby annotation, usually parentheses. examples this example uses ruby annotations to display the romaji equivalents for each character. <ruby> ę¼¢ <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> css body { font-size: 22px; } the result looks like this in you...
...r to indicate the presence of a ruby annotation, usually parentheses. examples this example uses ruby annotations to display the romaji equivalents for each character. <ruby> ę¼¢ <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> css body { font-size: 22px; } the result looks like this in your browser: the html above rendered by a browser without ruby support might look like this: ę¼¢ (kan) 字 (ji) body { font-size: 22px; } see the article about the <ruby> element for further examples. specifications specification status comment html living standardthe definition of '<rp>' in that specification. living standard html5the definition of '<rp>' in that specification. recommendation ...
<template>: The Content Template element - HTML: Hypertext Markup Language
Web › HTML › Element › template
avascript. think of a template as a content fragment that is being stored for subsequent use in the document. while the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however. content categories metadata content, flow content, phrasing content, script-supporting element permitted content no restrictions tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts metadata content, phrasing content, or script-supporting elements. also allowed as a child of a <colgroup> element that does not have a span attribute. implicit aria role no corresponding role...
...rst, we have a table into which we will later insert content using javascript code. then comes the template, which describes the structure of an html fragment representing a single table row. now that the table has been created and the template defined, we use javascript to insert rows into the table, with each row being constructed using the template as its basis. // test to see if the browser supports the html template element by checking // for the presence of the template element's content attribute. if ('content' in document.createelement('template')) { // instantiate the table with the existing html tbody // and the row with the template var tbody = document.queryselector("tbody"); var template = document.queryselector('#productrow'); // clone the new row and ins...
...} the result is the original html table, with two new rows appended to it via javascript: table { background: #000; } table td { background: #fff; } avoiding documentfragment pitfall a documentfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it. consider the following html and javascript: html <div id...
accesskey - HTML: Hypertext Markup Language
s that can be generated by the keyboard). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: in the whatwg spec, it says you can specify multiple space-separated characters, and the browser will use the first one it supports. however, this does not work in most browsers. ie/edge uses the first one it supports without problems, provided there are no conflicts with other commands. the way to activate the accesskey depends on the browser and its platform: windows linux mac firefox alt + shift + key on firefox 57 or newer: control + option + key or control + alt + key on fire...
...what may work for one combination of operating system, assistive technology, and browser may not work with other combinations. certain accesskey values may not be present on certain keyboards, especially when internat...
...n of 'accesskey' in that specification. recommendation no change from html5. ...
Microdata - HTML: Hypertext Markup Language
tadata within existing content on web pages. search engines and web crawlers can extract and process microdata from a web page and use it to provide a richer browsing experience for users. search engines benefit greatly from direct access to this structured data because it allows search engines to understand the information on web pages and provide more relevant results to users. microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. microdata is an attempt to provide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic microformats. at a high level, microdata consists of a group of name-value pairs. the groups are called items, and each name-value pair is a prop...
...at a high level, microdata consists of a group of name-value pairs. the groups are called items, and each name-value pair is a property. items and properties are represented by regular elements. to create an item, the itemscope attribute is used. to add a property to an item, the itemprop attribute is used on one of the item's descendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert performance, with startdate and location properties to specify the concert's key details. in this case, schema.org music event would be the url used by itemtype and startdate and location would be itemprop's that schema...
...esults. for some purposes, an ad-hoc vocabulary is adequate. for others, a vocabulary will need to be designed. where possible, authors are encouraged to re-use existing vocabularies, as this makes content re-use easier. localization in some cases, search engines covering specific regions may provide locally-specific extensions of microdata. for example, yandex, a major search engine in russia, supports microformats such as hcard (company contact information), hrecipe (food recipe), hreview (market reviews) and hproduct (product data) and provides its own format for the definition of the terms and encyclopedic articles. this extension was made to solve transliteration problems between the cyrillic and latin alphabets. due to the implementation of additional marking parameters of schema's vo...
List of default Accept values - HTTP
the accept header (ieinternals' msdn blog) internet explorer 9 image/png,image/svg+xml,image/*;q=0.8, */*;q=0.5 see fiddler is better with internet explorer 9 (ieinternals' msdn blog) values for a video when a video is requested, via the <video> html element, most browsers use specific values. ...
...requested, via the <video> html element, most browsers use specific values. user agent value comment firefox earlier than 3.6 no support for <video> firefox 3.6 and later video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5 see bug 489071 source chrome */* source internet explorer 8 or earlier no support for <video> values for audio resources when an audio file is requested, like via the <audio> html element, most browsers use specific values. user agent value comment firefox 3.6 and later audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5 see bug 489071 source safari, chrome */* source ...
...r audio resources when an audio file is requested, like via the <audio> html element, most browsers use specific values. user agent value comment firefox 3.6 and later audio/webm,audio/ogg,audio/wav,audio/*;q=0.9,application/ogg;q=0.7,video/*;q=0.6,*/*;q=0.5 see bug 489071 source safari, chrome */* source internet explorer 8 or earlier no support for <audio> internet explorer 9 ? values for scripts when a script is requested, like via the <script> html element, some browsers use specific values. user agent value comment firefox */* see bug 170789 safari, chrome */* source internet explorer 8 or earlier */* see ie and the accept header (ieinternals...
CSP: script-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
...ty policy will allow inline <script> elements <script> var inline = 1; </script> you can use a nonce-source to only allow specific inline script blocks: content-security-policy: script-src 'nonce-2726c7f26c' you will have to set the same nonce on the <script> element: <script nonce="2726c7f26c"> var inline = 1; </script> alternatively, you can create hashes from your inline scripts. csp supports sha256, sha384 and sha512. content-security-policy: script-src 'sha256-b2yphkaxnvfwtrchibabymubfzdvfkkxhbwtwiddvf8=' when generating the hash, don't include the <script> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. <script>var inline = 1;</script> unsafe eval expressions the 'unsafe-eval' source expression controls several script exe...
...d by a nonce or loaded from a trusted script. script-src 'strict-dynamic' 'nonce-somenonce' or script-src 'strict-dynamic' 'sha256-base64encodedhash' it is possible to deploy strict-dynamic in a backwards compatible way, without requiring user-agent sniffing. the policy: script-src 'unsafe-inline' https: 'nonce-abcdefg' 'strict-dynamic' will act like 'unsafe-inline' https: in browsers that support csp1, https: 'nonce-abcdefg' in browsers that support csp2, and 'nonce-abcdefg' 'strict-dynamic' in browsers that support csp3. specifications specification status comment content security policy level 3the definition of 'script-src' in that specification. working draft no changes. content security policy level 2the definition of 'script-src' in th...
Expect-CT - HTTP
forcement of certificate transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed. ct requirements can be satisfied via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by individual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs. browsers ignore the expect-ct header over http; the header only has effect on https connections. the expect-ct will likely become o...
...providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs. browsers ignore the expect-ct header over http; the header only has effect on https connections. the expect-ct will likely become obsolete in june 2021. since may 2018 new certificates are expected to support scts by default. certificates before march 2018 were allowed to have a lifetime of 39 months, those will all be expired in june 2021. 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 reception of the expect-ct header f...
...ent both that compliance to the certificate transparency policy should be enforced and that violations should be reported. example the following example specifies enforcement of certificate transparency for 24 hours and reports violations to foo.example. expect-ct: max-age=86400, enforce, report-uri="https://foo.example/report" notes root cas manually added to the trust store override and suppress expect-ct reports/enforcement. browsers will not remember an expect-ct policy, unless the site has 'proven' it can serve a certificate satisfying the certificate transparency requirements. browsers implement their own trust model regarding which ct logs are considered trusted for the certificate to have been logged to. builds of chrome are designed to stop enforcing the expect-ct policy 10...
X-Frame-Options - HTTP
the x-frame-options http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites. the added security is provided only if the user accessing the document is using a browser that supports x-frame-options. note: the content-security-policy http header has a frame-ancestors directive which obsoletes this header for supporting browsers. header type response header forbidden header name no syntax there are two possible directives for x-frame-options: x-frame-options: deny x-frame-options: sameorigin directives if you specify deny, not only will attempts to ...
...empting to do so. sameorigin the page can only be displayed in a frame on the same origin as the page itself. the spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin (see bug 725490). also see browser compatibility for support details. allow-from uri this is an obsolete directive that no longer works in modern browsers. don't use it. in supporting legacy browsers, a page can be displayed in a frame only on the specified origin uri. note that in the legacy firefox implementation this still suffered from the same problem as sameorigin did — it doesn't check the frame ancestors to see if they are in the same ori...
...er or location configuration: add_header x-frame-options sameorigin always; configuring iis to configure iis to send the x-frame-options header, add this to your site's web.config file: <system.webserver> ... <httpprotocol> <customheaders> <add name="x-frame-options" value="sameorigin" /> </customheaders> </httpprotocol> ... </system.webserver> or see this microsoft support article on setting this configuration using the iis manager user interface. configuring haproxy to configure haproxy to send the x-frame-options header, add this to your front-end, listen, or backend configuration: rspadd x-frame-options:\ sameorigin alternatively, in newer versions: http-response set-header x-frame-options sameorigin configuring express to configure express to send ...
HTTP headers - HTTP
Web › HTTP › Headers
various effects anywhere along the request-response chain. used for backwards compatibility with http/1.0 caches where the cache-control header is not yet present. warning general warning information about possible problems. client hints http client hints are a work in progress. actual documentation can be found on the website of the http working group. accept-ch servers can advertise support for client hints using the accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]). accept-ch-lifetime servers can ask the client to remember the set of client hints that the server supports for a specified period of time, to enable delivery of client hints on subsequent requests to the server’s origin ([rfc6454]). early-data indicates that th...
...tion sent in the referer header should be included with requests made. user-agent contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent. see also the firefox user agent string reference. response context allow lists the set of http request methods supported by a resource. server contains information about the software used by the origin server to handle the request. range requests accept-ranges indicates if the server supports range requests, and if so in which unit the range can be expressed. range indicates the part of a document that the server should return. if-range creates a conditional range request that is only fulfilled if...
...... sec-websocket-protocol ... sec-websocket-version ... other accept-push-policy a client can express the desired push policy for a request by sending an accept-push-policy header field in the request. accept-signature a client can send the accept-signature header field to indicate intention to take advantage of any available signatures and to indicate what kinds of signatures it supports. alt-svc used to list alternate ways to reach this service. date contains the date and time at which the message was originated. large-allocation tells the browser that the page being loaded is going to want to perform a large allocation. link the link entity-header field provides a means for serialising one or more links in http headers. it is semantically equivalent to the html <li...
Link prefetching FAQ - HTTP
, the next document might contain several large images. some more examples follow: <link rel="prefetch alternate stylesheet" title="designed for mozilla" href="mozspecific.css"> <link rel="next" href="2.html"> are anchor (<a>) tags prefetched? no, only <link> tags with a relation type of next or prefetch are prefetched. however, if there is sufficient interest, we may expand link prefetching support to include prefetching <a> tags, which include a relation type of next or prefetch in the future. doing so would probably help content providers avoid the problem of stale prefetching links. is link prefetching standards compliant? yes, link prefetching as outlined in this document does not violate any existing web standards. in fact, the html 4.01 specification explicitly allows for the de...
... link prefetching in mozilla may compete for bandwidth with the other application. this is a problem that we hope to address in the future by leveraging operating system services to monitor network idle time. are there any restrictions on what is prefetched? yes, only http:// (and, starting in gecko 1.9.1 https://) urls can be prefetched. other protocols (such as ftp) do not provide rich enough support for client side caching. will mozilla prefetch documents from a different host? yes. there is no same-origin restriction for link prefetching. limiting prefetching to only urls from the the same server would not offer any increased browser security. do prefetched requests contain a referer: header? yes, prefetched requests include a http referer: header indicating the document from which ...
...ing various js/dom hacks. the <link> tag gives the browser the ability to know what sites are up to, and we can use this information to better prioritize document prefetching. the user preference to disable <link> tag prefetching may simply encourage websites to stick with js/dom hacks, and that would not be good for users. this is one reason why prefetching is enabled by default. which browsers support link prefetching? browsers based on mozilla 1.2 (or later) as well as browsers based on mozilla 1.0.2 (or later) support prefetching. this includes firefox and netscape 7.01+. camino builds as of march 2003 are based on mozilla 1.0.1, and therefore do not support prefetching. test your browser to see if it supports link prefetching. privacy implications along with the referral and url-foll...
Proxy Auto-Configuration (PAC) file - HTTP
in that ...
...la.org"); // 1 dnsdomainlevels("www.mozilla.org"); // 2 shexpmatch() syntax shexpmatch(str, shexp) parameters str is any string to compare (e.g. the url, or the hostname). shexp is a shell expression to compare against. returns true if the string matches the specified shell expression. note that the patterns are shell glob expressions, not regular expressions. * and ? are always supported, while [characters] and [^characters] are supported by some implmentations including firefox. this is mainly because the expression is translated to a regexp via subsitution of [.*?]. for a reliable way to use these regexp syntaxes, just use regexp instead. examples shexpmatch("http://home.netscape.com/people/ari/index.html" , "*/ari/*"); // returns true shexpmatch("http://home.netsca...
...e file into proxyautoconfig.cpp as a c++ string literal. to extract it into its own file, it suffices to copy the chunk into javascript with a console.log directive to print it. microsoft in general made its own implementation. there used to be some problems with their libraries, but most are resolved by now. they have defined some new "ex" suffixed functions around the address handling parts to support ipv6. the feature is supported by chromium, but not yet by firefox (bugzilla #558253). ...
HTTP response status codes - HTTP
Web › HTTP › Status
e server requires it. 412 precondition failed the client has indicated preconditions in its headers which the server does not meet. 413 payload too large request entity is larger than limits defined by server; the server might close the connection or return an retry-after header field. 414 uri too long the uri requested by the client is longer than the server is willing to interpret. 415 unsupported media type the media format of the requested data is not supported by the server, so the server is rejecting the request. 416 range not satisfiable the range specified by the range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target uri's data. 417 expectation failed this response code means the expectation indicated by the exp...
...est may be resubmitted after reducing the size of the request header fields. 451 unavailable for legal reasons the user-agent requested a resource that cannot legally be provided, such as a web page censored by a government. server error responses 500 internal server error the server has encountered a situation it doesn't know how to handle. 501 not implemented the request method is not supported by the server and cannot be handled. the only methods that servers are required to support (and therefore that must not return this code) are get and head. 502 bad gateway this error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response. 503 service unavailable the server is not ready to handle the request. com...
...if possible, contain the estimated time before the recovery of the service. the webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached. 504 gateway timeout this error response is given when the server is acting as a gateway and cannot get a response in time. 505 http version not supported the http version used in the request is not supported by the server. 506 variant also negotiates the server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. 507 insufficient storage (webdav) the method could not be performed on the resou...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
on-standard generic string methods are deprecated and have been removed in firefox 68 and later. string generics provide string instance methods on the string object allowing string methods to be applied to any object. ...
...eric string methods are deprecated and have been removed in firefox 68 and later. string generics provide string instance methods on the string object allowing string methods to be applied to any object. ...
... in firefox 68 and later. string generics provide string instance methods on the string object allowing string methods to be applied to any object. ...
Array.prototype.reduceRight() - JavaScript
eractive-examples and send us a pull request. see also array.prototype.reduce() for left-to-right. ...
...calling reduce or reduceright on an empty array without an initial value creates a typeerror. return value the value that results from the reduction. ...
...2, 3, 4] 20 the value returned by reduceright this time would be, of course, 20. polyfill reduceright was added to the ecma-262 standard in the 5th edition; as such it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of reduceright in implementations which do not natively support it. // production steps of ecma-262, edition 5, 15.4.4.22 // reference: http://es5.github.io/#x15.4.4.22 if ('function' !== typeof array.prototype.reduceright) { array.prototype.reduceright = function(callback /*, initialvalue*/) { 'use strict'; if (null === this || 'undefined' === typeof this) { throw new typeerror('array.prototype.reduce called on null or undefined'); }...
Array.prototype.map() - JavaScript
ay which map was called upon is sparse, resulting array will also be sparse keeping same indices blank. polyfill map was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of map in implementations which do not natively support it. this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, typeerror, and array have their original values and that callback.call evaluates to the original value of function.prototype.call. // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback/...
...t of calling the get internal // method of o with the argument "length". // 3. let len be touint32(lenvalue). var len = o.length >>> 0; // 4. if iscallable(callback) is false, throw a typeerror exception. // see: http://es5.github.com/#x9.11 if (typeof callback !== 'function') { throw new typeerror(callback + ' is not a function'); } // 5. if thisarg was supplied, let t be thisarg; else let t be undefined. if (arguments.length > 1) { t = arguments[1]; } // 6. let a be a new array created as if by the expression new array(len) // where array is the standard built-in constructor with that name and // len is the value of len. a = new array(len); // 7. let k be 0 k = 0; // 8. repeat, while k < len wh...
...nt // list containing kvalue, k, and o. mappedvalue = callback.call(t, kvalue, k, o); // iii. call the defineownproperty internal method of a with arguments // pk, property descriptor // { value: mappedvalue, // writable: true, // enumerable: true, // configurable: true }, // and false. // in browsers that support object.defineproperty, use the following: // object.defineproperty(a, k, { // value: mappedvalue, // writable: true, // enumerable: true, // configurable: true // }); // for best browser support, use the following: a[k] = mappedvalue; } // d. increase k by 1. k++; } // 9. return a return a;...
String.prototype.codePointAt() - JavaScript
oint value of the character at the given pos. if there is no element at pos, returns undefined. description if there is no element at the specified position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. ...
...d position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. polyfill the following extends strings to include the codepointat() function as specified in ecmascript 2015 for browsers without native support. ...
...urned. polyfill the following extends strings to include the codepointat() function as specified in ecmascript 2015 for browsers without native support. ...
String.fromCodePoint() - JavaScript
nicode code point is given (e.g. "rangeerror: nan is not a valid code point"). description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be supported in all web browsers or environments yet. use the code below for a polyfill: if (!string.fromcodepoint) (function(stringfromcharcode) { var fromcodepoint = function(_) { var codeunits = [], codelen = 0, result = ""; for (var index=0, len = arguments.length; index !== len; ++index) { var codepoint = +arguments[index]; // correctly handles all cases including ...
...en = codeunits.push( (codepoint >> 10) + 0xd800, // highsurrogate (codepoint % 0x400) + 0xdc00 // lowsurrogate ); } if (codelen >= 0x3fff) { result += stringfromcharcode.apply(null, codeunits); codeunits.length = 0; } } return result + stringfromcharcode.apply(null, codeunits); }; try { // ie 8 only supports `object.defineproperty` on dom elements object.defineproperty(string, "fromcodepoint", { "value": fromcodepoint, "configurable": true, "writable": true }); } catch(e) { string.fromcodepoint = fromcodepoint; } }(string.fromcharcode)); examples using fromcodepoint() valid input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az...
...x1d307); // "\ud834\udf06a\ud834\udf07" invalid input: string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeerror string.fromcodepoint(3e-2); // rangeerror string.fromcodepoint(nan); // rangeerror compared to fromcharcode() string.fromcharcode() cannot return supplementary characters (i.e. code points 0x010000 – 0x10ffff) by specifying their code point. instead, it requires the utf-16 surrogate pair in order to return a supplementary character: string.fromcharcode(0xd83c, 0xdf03); // code point u+1f303 "night with string.fromcharcode(55356, 57091); // stars" == "\ud83c\udf03" string.fromcodepoint(), on the other hand, can return 4-byte supplementar...
String.prototype.localeCompare() - JavaScript
equivalent yielding a neutral value of zero 'a'.localecompare('a'); // 0 sort an array localecompare() enables case-insensitive sorting for an array. ...
... sort an array localecompare() enables case-insensitive sorting for an array. let items = ['réservé', 'premier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. ...
...r an array. let items = ['réservé', 'premier', 'cliché', 'communiqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. to check whether an implementation supports them, use the "i" argument (a requirement that illegal language tags are rejected) and look for a rangeerror exception: function localecomparesupportslocales() { try { 'foo'.localecompare('bar', 'i'); } catch (e) { return e.name === 'rangeerror'; } return false; } using locales the results provided by localecompare() vary between languages. in order to get the sort order ...
String.prototype.replaceAll() - JavaScript
it will become available in chrome 85. the replaceall() method returns a new string with all matches of a pattern replaced by a replacement. the pattern can be a string or a regexp, and the replacement can be a string or a function to be called for each match. the original string is left unchanged. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...t the global ("g") flag will throw a typeerror: "replaceall must be called with a global regexp". substr a string that is to be replaced by newsubstr. it is treated as a literal string and is not interpreted as a regular expression. newsubstr (replacement) the string that replaces the substring specified by the specified regexp or substr parameter. a number of special replacement patterns are supported; see the "specifying a string as a parameter" section below. function (replacement) a function to be invoked to create the new substring to be used to replace the matches to the given regexp or substr. the arguments supplied to this function are described in the "specifying a function as a parameter" section below. return value a new string, with all matches of a pattern replaced by a ...
...een performed. the function's result (return value) will be used as the replacement string. (note: the above-mentioned special replacement patterns do not apply in this case.) note that the function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. the arguments to the function are as follows: possible name supplied value match the matched substring. (corresponds to $& above.) p1, p2, ... the nth string found by a parenthesized capture group, provided the first argument to replace() was a regexp object. (corresponds to $1, $2, etc. above.) for example, if /(\a+)(\b+)/, was given, p1 is the match for \a+, and p2 for \b+. offset the offset of the matched substring w...
import - JavaScript
hat you will need the code you are importing, or you will not need it until a later time. when importing statically significantly increases your program's memory usage and there is a low likelihood that you will need the code you are importing. when the module you are importing does not exist at load time when the import specifier string needs to be constructed dynamically. (static import only supports static specifiers.) when the module being imported has side effects, and you do not want those side effects unless some condition is true. (it is recommended not to have any side effects in a module, but you sometimes cannot control this in your module dependencies.) use dynamic import only when necessary. the static form is preferable for loading initial dependencies, and can benefit mor...
...rt only when necessary. the static form is preferable for loading initial dependencies, and can benefit more readily from static analysis tools and tree shaking. to dynamically import a module, the import keyword may be called as a function. when used this way, it returns a promise. import('/modules/my-module.js') .then((module) => { // do something with the module. }); this form also supports the await keyword. let module = await import('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json request. the module: file.js function getjson(url, callback) { let xhr = new xmlhttprequest(); xhr.onload = function () { callback(this.responsetext) }; xhr.open('get', url, true); ...
...import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module. this is not the only way to implement this functionality. the import() function also supports await. const main = document.queryselector("main"); for (const link of document.queryselectorall("nav > a")) { link.addeventlistener("click", e => { e.preventdefault(); import('/modules/my-module.js') .then(module => { module.loadpageinto(main); }) .catch(err => { main.textcontent = err.message; }); }); } specifications specifi...
JavaScript typed arrays - JavaScript
come more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data. this is where typed arrays come in. each entry in a javascript typed array is a raw binary value in one of a number of supported formats, from 8-bit integers to 64-bit floating-point numbers. however, typed arrays are not to be confused with normal arrays, as calling array.isarray() on a typed array returns false. moreover, not all methods available for normal arrays are supported by typed arrays (e.g. push and pop). buffers and views: typed array architecture to achieve maximum flexibility and efficiency, javascr...
...setter methods. web apis using typed arrays these are some examples of apis that make use of typed arrays; there are others, and more are being added all the time. filereader.prototype.readasarraybuffer() the filereader.prototype.readasarraybuffer() method starts reading the contents of the specified blob or file. xmlhttprequest.prototype.send() xmlhttprequest instances' send() method now supports typed arrays and arraybuffer objects as argument. imagedata.data is a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 inclusive. examples using views with buffers first of all, we will need to create a buffer, here with a fixed length of 16-bytes: let buffer = new arraybuffer(16); at this point, we h...
... note: the data structure alignment in a c structure is platform-dependent. take precautions and considerations for these padding differences. conversion to normal arrays after processing a typed array, it is sometimes useful to convert it back to a normal array in order to benefit from the array prototype. this can be done using array.from(), or using the following code where array.from() is unsupported. let typedarray = new uint8array([1, 2, 3, 4]), normalarray = array.prototype.slice.call(typedarray); normalarray.length === 4; normalarray.constructor === array; specifications specification ecmascript (ecma-262)the definition of 'typedarray objects' in that specification. ...
<semantics> - MathML
ror otherwise). the <annotation> element is the container element containing semantic information in a non-xml format, whereas the <annotation-xml> element contains content in an xml format, e.g. content mathml or openmath. the rules of determining the visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered, which is supposed to be presentation markup. if the first child is a presentation mathml element other than <annotation> or <annotation-xml>, render the first child. if no presentation mathml is found, render the first <annotation> or <annotation-xml> child element of <semantics>. beware that <annotation-xml> elements are only recognized, if the encoding attribute is set to one of the following: "ap...
...f the semantic information in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. ...
...mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. ...
MathML element reference - MathML
if you want to learn more about content markup you should consider chapter 4 in the mathml 3 specification. mathml elements implement the mathmlelement class. ...
...ng literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignment) <mstyle> (style change) <msub> (subscript) <msup> (superscript) <msubsup> (subscript-superscript 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> (underscript) <munderover> (underscript-overscript pair) other elements <semantics> (container for semantic annotations) <annotation> (data annotations) <annotation-xml> (xml annotations) mathml...
...notations) <annotation-xml> (xml annotations) mathml presentation elements by category top-level elements <math> token elements <mglyph> <mi> <mn> <mo> <ms> <mspace> <mtext> general layout <menclose> <merror> <mfenced> <mfrac> <mpadded> <mphantom> <mroot> <mrow> <msqrt> <mstyle> script and limit elements <mmultiscripts> <mover> <mprescripts> <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> ...
Autoplay guide for media and Web Audio APIs - Web media technologies
otherwise, the playback will likely be blocked. the exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good guidelines to go by. for details, see the auto-play policies for google chrome and webkit. note: put another way, playback of any media that includes audio is g...
...oplay and the user starting playback manually. the play() method the term "autoplay" also refers to scenarios in which a script tries to trigger the playback of media that includes audio, outside the context of handling a user input event. this is done by calling the media element's play() method. note: it is strongly recommended that you use the autoplay attribute whenever possible, because support for autoplay preferences are more widespread for the autoplay attribute than for other means of playing media automatically. it also lets the browser take responsibility for starting playback, letting it optimize the timing of that taking place. example: playing video this simple example plays the first <video> element found in the document. play() won't let the playback begin unless the d...
...ed to be automatically played. if this has been changed to false, media with an audio track will not be permitted to play even if muted. media.autoplay.block-webaudio a boolean preference which indicates whether or not to apply autoplay blocking to the web audio api. the default is true. media.autoplay.default an integer preference which specifies whether per-domain configuration for autoplay support by default is allowed (0), blocked (1), or prompt-on-use (2). the default value is 0. media.autoplay.enabled.user-gestures-needed (nightly builds only) a boolean preference which controls whether or not detection of user gestures is allowed to override the setting of media.autoplay.default. if media.autoplay.default is not set to 0 (autoplay allowed by default), this preference being true a...
Web media technologies
o to a destination such as an <audio> element, a media stream, or to disk. webrtc webrtc (web real-time communication) makes it possible to stream live audio and video, as well as transfer arbitrary data, between two peers over the internet, without requiring an intermediary. guides overview of media technology on the web a general look at the open web technologies and apis that provide support for audio and video playback, manipulation, and recording. if you're not sure which api you should use, this is the place to start. using audio and video in html a guide to using the html <audio> and <video> elements. accessibility guide for media in web design in this guide, we cover ways web designers and developers can create content that is accessible to people with different capabili...
...> elements to captions to tagging media for screen readers. guide to media types and formats on the web a guide to the file types and codecs available for images, audio, and video media on the web. this includes recommendations for what formats to use for what kinds of content, best practices including how to provide fallbacks and how to prioritize media types, and also includes general browser support information for each media container and codec. streaming audio and video a guide which covers how to stream audio and video, as well as techniques and technologies you can take advantage of to ensure the best possible quality and/or performance of your streams. autoplay guide for media and web audio apis unexpected automatic playback of media or audio can be an unwelcome surprise to user...
...on for video playback or camera capture so that you can capture and manipulate video frames. webgl webgl provides an opengl es compatible api on top of the existing canvas api, making it possible to do powerful 3d graphics on the web. through a canvas, this can be used to add 3d imagery to media content. webxr webxr, which has replaced the now-obsolete webvr api, is a technology that provides support for creating virtual reality (vr) and augmented reality (ar) content. the mixed reality content can then be displayed on the device's screen or using goggles or a headset. ...
Navigation and resource timings - Web Performance
main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. the general performance timings below have been deprecated in favor of the performance entry api, which provides for marking and measuring times along the navigation and resource loading process. while deprecated, they are supported in all browsers. performance timings the performancetiming api, a javascript api for measuring the loading performance of the requested page, is deprecated but supported in all browsers. it has been replaced with the performancenavigationtiming api. the performance timing api provided read only times, in milliseconds(ms), describing at what time each point in the page loading process was...
...defined if not available, 0 if https in not used, or a time stamp if available, and used. in other words, if a secure connection was used, secureconnectionstart will be truthy, and the time between secureconnectionstart and requeststart will greater than 0. ssl = time.requeststart - time.secureconnectionstart; performance entry api the general performance timings above are deprecated but fully supported. we now have the performance entry api, which provides for marking and measuring times along the navigation and resource loading process. you can also create marks: performance.getentriesbytype('navigation').foreach((navigation) => { console.dir(navigation); }); performance.getentriesbytype('resource').foreach((resource) => { console.dir(resource); }); performance.getentriesbytype('m...
...we use performance.getentriesbytype('navigation') and performance.getentriesbytype('resource') to query the navigation and resource timings respectively. navigation timing when a user requests a web site or application, to populate the browser the user agent goes ...
How to make PWAs installable - Progressive web apps (PWAs)
the installed web app can then be launched by users just as if it were any native app. this article explains how to achieve this using the web app's manifest. ...
...fest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen with an icon and name. this only works if the app meets all the necessary requirements, as described above. when the user visits the pwa with a supporting mobile browser, it should display a notification (such as a banner or dialog box) indicating that it's possible to install the app as a pwa. after the user indicates they wish to proceed with installation, the install banner is shown. that banner is automatically created by the browser, based on the information from the manifest file. for instance, the prompt includes the app's name and...
...loaded started up. the icon and the theme and background colors are used to create this screen. summary in this article, we learned about how we can make pwas installable with a properly-configured web manifest, and how the user can then install the pwa with the "add to home screen" feature of their browser. for more information on a2hs, be sure to read our add to home screen guide. browser support is currently limited to firefox for android 58+, mobile chrome and android webview 31+, and opera for android 32+, but this should improve in the near future. now let's move to the last piece of the pwa puzzle: using push notifications to share announcements with the user, and to help the user re-engage with your app. previous overview: progressive next ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
l as they can take control over network requests, modify them, serve custom responses retrieved from the cache, or synthesize responses completely. security because they are so powerful, service workers can only be executed in secure contexts (meaning https). if you want to experiment first before pushing your code to production, you can always test on a localhost or setup github pages — both support https. offline first the "offline first" — or "cache first" — pattern is the most popular strategy for serving content to the user. if a resource is cached and available offline, return it first before trying to download it from the server. if it isn’t in the cache already, download it and cache it for future usage. "progressive" in pwa when implemented properly as a progressive enh...
...attern is the most popular strategy for serving content to the user. if a resource is cached and available offline, return it first before trying to download it from the server. if it isn’t in the cache already, download it and cache it for future usage. "progressive" in pwa when implemented properly as a progressive enhancement, service workers can benefit users who have modern browsers that support the api by providing offline support, but won't break anything for those using legacy browsers. service workers in the js13kpwa app enough theory — let's see some source code! registering the service worker we'll start by looking at the code that registers a new service worker, in the app.js file: note : we're using the es6 arrow functions syntax in the service worker implementation i...
...its contents reside in the sw.js file, and can be executed after the registration is successful. it's the only piece of service worker code that sits inside the app.js file; everything else that is service worker-specific is written in the sw.js file itself. lifecycle of a service worker ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
fits of the app shell pattern this architecture allows a web site to benefit the most from all the pwa features — it caches the app shell and manages the dynamic content in a way that greatly improves the performance. in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement. the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web. being linkable, progressive, and responsive by design it's important to remember the pwa advantages and keep them in mind when designing the application. the app shell approach allows website...
...ws websites to be: linkable: even though it behaves like a native app, it is still a website — you can click on the links within the page and send a url to someone if you want to share it. progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available. for example, an offline mode with the help of service workers is just an extra trait that makes the website experience better, but it's still perfectly usable without it. responsive: responsive web design also applies to progressive web apps, as both are mainly for mobile devices. there are so many varied devices with browsers — it's important to prepare your website so i...
...video), you no longer need to wait for all of it to be downloaded and converted to a blob (or whatever). instead, you can start right away. it provides fine-grained control: the stream can be started, chained with another stream, canceled, checked for errors, and more. in theory, streaming is a better model than the app shell model, but it's also more complex, and the streams api isn't yet fully supported by any of the major browsers. once it's available, however, it will be the fastest way to serve your app's content. the performance benefits will be truly spectacular. for working examples and more information, see the streams api documentation. structure of a sample application the js13kpwa web site's structure is quite simple. it consists of a single html file (index.html), with basic ...
SVG and CSS - SVG: Scalable Vector Graphics
75; --segment-fill-fill: azure; --segment-fill-stroke: lightsteelblue; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: deepskyblue; --segment-edge-stroke-width: 3; --segment-fill-fill-hover: plum; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: slateblue; } /* non-standard way of styling elements referenced via <use> elements, supported by some older browsers */ #outer-petals .segment-fill { fill: azure; stroke: lightsteelblue; stroke-width: 1; } #outer-petals .segment-edge { fill: none; stroke: deepskyblue; stroke-width: 3; } #outer-petals .segment:hover > .segment-fill { fill: plum; stroke: none; } #outer-petals .segment:hover > .segment-edge { stroke: slateblue; } /* inner petals */ #inner-petals {...
...tals { --segment-fill-fill: yellow; --segment-fill-stroke: yellow; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: yellowgreen; --segment-edge-stroke-width: 9; --segment-fill-fill-hover: darkseagreen; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: green; } /* non-standard way of styling elements referenced via <use> elements, supported by some older browsers */ #inner-petals .segment-fill { fill: yellow; stroke: yellow; stroke-width: 1; } #inner-petals .segment-edge { fill: none; stroke: yellowgreen; stroke-width: 9; } #inner-petals .segment:hover > .segment-fill { fill: darkseagreen; stroke: none; } #inner-petals .segment:hover > .segment-edge { stroke: green; } open the document in your svg-enable...
...lesheet so that the inner petals all turn pink when the mouse pointer is over any one of them, without changing the way the outer petals work. see a solution to this challenge. simplified structure the svg structure shown above could be written much more concise by referencing the individual parts of the flower via <use> elements. this behavior is standardized, though only a few browsers support the :hover pseudo-class and other more complex css selectors on elements referenced via <use> elements, at the moment. there is some discussion about what rules apply to such referenced elements. see below how the structure then looks like. <svg width="600px" height="600px" viewbox="-300 -300 600 600" xmlns="http://www.w3.org/2000/svg"> <title>svg demonstration</title> <desc>mozill...
Transport Layer Security - Web security
cipher suites. for instance, the names used in openssl and gnutls differ from those in the tls standards. the cipher names correspondence table on the mozilla opsec team's article on tls configurations lists these names as well as information about compatibility and security levels. configuring your server correctly configuring your server is crucial. in general, you should try to limit cipher support to the newest ciphers possible which are compatible with the browsers you want to be able to connect to your site. the mozilla opsec guide to tls configurations provides more information on recommended configurations. to assist you in configuring your site, mozilla provides a helpful tls configuration generator that will generate configuration files for the following web servers: apache ...
... trip in most cases, reducing handshake latency. a server can enable a 0-rtt (zero round trip time) handshake. clients that reconnect to the server can send requests immediately, eliminating the latency of the tls handshake entirely. though the performance gains from 0-rtt can be significant, they come with some risk of replay attack, so some care is needed before enabling this feature. tls 1.3 supports forward-secure modes only, unless the connection is resumed or it uses a pre-shared key. tls 1.3 defines a new set of cipher suites that are exclusive to tls 1.3. these cipher suites all use modern authenticated encryption with associated data (aead) algorithms. the tls 1.3 handshake is encrypted, except for the messages that are necessary to establish a shared secret. in particular, this ...
...some web servers use renegotiation to either ensure that client certificates are encrypted, or to request client certificates only when certain resources are requested. for the privacy of client certificates, the encryption of the tls 1.3 handshake ensures that client certificates are encrypted; however this might require some software changes. reactive client authentication using certificates is supported by tls 1.3 but not widely implemented. alternative mechanisms are in the process of being developed, which will also support http/2. retiring old tls versions to help with working towards a more modern, more secure web, tls 1.0 and 1.1 support will be removed from all major browsers in q1 2020. you'll need to make sure your web server supports tls 1.2 or 1.3 going forward. from version 7...
Functions - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the following is an annotated list of core xpath functions and xslt-specific additions to xpath, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support. for further information on using xpath/xslt functions, please see the for further reading page. ...
...ommendation, and degree of present gecko support. for further information on using xpath/xslt functions, please see the for further reading page. ...
...-available() generate-id() xslt-specific id() (partially supported) key() xslt-specific lang() last() local-name() name() namespace-uri() normalize-space() not() number() position() round() starts-with() string() string-length() substring() substring-after() substring-before() sum() system-property() xslt-specific translate() true() unparsed-entity-url() xslt-specific (not supported) ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element
use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated. <xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for...
...:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> ...
...sl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
Using the WebAssembly JavaScript API - WebAssembly
estreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); the net result of this is that we call our exported webassembly function exported_func, which in turn calls our imported javascript function imported_func, which logs the value provided inside the webassembly instance (42) to the console. if you save your example code now and load it a browser that supports webassembly, you’ll see this in action! note: this is a convoluted, longwinded example that achieves very little, but it does serve to illustrate what is possible — using webassembly code alongside javascript in your web applications. as we’ve said elsewhere, webassembly doesn’t aim to replace javascript; the two instead can work together, drawing on each other’s strengths. loa...
...ing: new uint32array(memory.buffer)[0] try this now in your demo — save what you’ve added so far, load it in your browser, then try entering the above two lines in your javascript console. growing memory a memory instance can be grown by calls to memory.prototype.grow(), where again the argument is specified in units of webassembly pages: memory.grow(1); if a maximum value was supplied upon creation of the memory instance, attempts to grow past this maximum will throw a webassembly.rangeerror exception. the engine takes advantage of this supplied upper-bounds to reserve memory ahead of time, which can make resizing more efficient. note: since an arraybuffer’s bytelength is immutable, after a successful memory.prototype.grow() operation the buffer getter will return a ne...
... the raw address of the function’s code in the process’s virtual address space and so, for the safety reasons mentioned above, cannot be stored directly in linear memory. instead, function references are stored in a table and their indexes, which are integers and can be stored in linear memory, are passed around instead. when the time comes to call a function pointer, the webassembly caller supplies the index, which can then be safety bounds checked against the table before indexing and calling the indexed function reference. thus, tables are currently a rather low-level primitive used to compile low-level programming language features safely and portably. tables can be mutated via table.prototype.set(), which updates one of the values in a table, and table.prototype.grow(), which inc...
Communicating With Other Scripts - Archive of obsolete content
s using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.defaultview. see the section below on using postmessage() before firefox 31. you can communicate between the content script and page scripts using window.postmessage(). messaging from content script to page script suppose we have a page called "listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that page. in the main add-on code, we have a page-mod that attaches the content script "talk.js" to the right page: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/listen.html", ...
...ection. ...
Cross-domain Content Scripts - Archive of obsolete content
e.json": "permissions": { "cross-domain-content": ["http://en.m.wikipedia.org/"] } the add-on should successfully retrieve the iframe's content. cross-domain xmlhttprequest the following add-on creates a panel whose content is the summary weather forecast for shetland. if you want to try it out, you'll need to register and get an api key. ...
... ...
Loading Content Scripts - Archive of obsolete content
contentscriptwhen string contentscriptoptions object we have already seen the contentscript option, which enables you to pass in the text of the script itself as a string literal. this version of the api avoids the need to maintain a separate file for the content script. the contentscriptfile option enables you to pass in the local file url from which the content script will be loaded. to supply the file "my-content-script.js", located in the /data subdirectory under your add-on's root directory, use a line like: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... contentscriptfile: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly w...
...contentscriptfile: [data.url("jquery-1.4.2.min.js"), data.url("my-content-script.js")] scripts specified using contentscriptfile are loaded before those specified using contentscript. ...
Content Scripts - Archive of obsolete content
' "<h1>page matches ruleset</h1>";'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptvalue }); the contentscriptfile option treats the string as a resource:// url pointing to a script file stored in your add-on's data directory. jpm doesn't make a "data" directory by default, so you must add it and put your content scripts in there. ...
...ingle page-mod object might attach its scripts to multiple pages, each with its own context in which the content scripts are executing, so it needs a separate channel (worker) for each page. so page-mod does not integrate the worker api directly. instead, each time a content script is attached to a page, the page-mod emits an attach event, whose listener is passed the worker for that context. ...
notifications - Archive of obsolete content
here's a typical example. when the message is clicked, a string is logged to the console. var notifications = require("sdk/notifications"); notifications.notify({ title: "jabberwocky", text: "'twas brillig, and the slithy toves", data: "did gyre and gimble in the wabe", onclick: function (data) { console.log(data); // console.log(this.data) would produce the same result. } }); this one displays an icon that's stored in the add-on's data directory. ...
...}); from firefox 34, you can use "./myicon.png" as an alias for self.data.url("myicon.png"). so you can rewrite the above code like this: var notifications = require("sdk/notifications"); var myiconurl = "./myicon.png"; notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); this module depends on the underlying system's notification service. if the user's system does not support desktop notifications or if its notifications service is not running: if firefox was started normally, notifications are logged to firefox's error console if the user launched firefox from the command line, notifications are logged to the terminal. globals functions notify(options) displays a transient notification to the user. parameters options : object optional options: ...
page-worker - Archive of obsolete content
d to run. script defaults to true. include string, regexp, array of (string or regexp) this is useful when your page worker loads a page which will redirect to other pages. a match pattern string or an array of match pattern strings. these define the documents to which the page-worker's content worker applies. at least one match pattern must be supplied. see the match-pattern module for a detailed description of match pattern syntax. contentscriptfile string,array a local file url or an array of local file urls of content scripts to load. content scripts specified by this option are loaded before those specified by the contentscript option. see working with content scripts for help on setting this property. ...
... read-only value exposed to content scripts under self.options property. any kind of jsonable value (object, array, string, etc.) can be used here. optional. onmessage function use this to add a listener to the page worker's message event. page a page object loads the page specified by its contenturl option and executes any content scripts that have been supplied to it in the contentscript and contentscriptfile options. the page is not displayed to the user. the page worker is loaded as soon as the page object is created and stays loaded until its destroy method is called or the add-on is unloaded. methods destroy() unloads the page worker. after you destroy a page worker, its memory is freed and you must create a new instance if you need to loa...
tabs - Archive of obsolete content
tyle, tabs.activetab); } } }); private windows if your add-on has not opted into private browsing, then you won't see any tabs that are hosted by private browser windows. tabs hosted by private browser windows won't be seen if you enumerate the tabs module itself, and you won't receive any events for them. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. converting to xul tabs to convert from the high-level tab objects used in this api to the low-level xul tab objects used in the tabs/utils api and by traditional add-ons, use the viewfor() function exported by the viewfor module. to convert back the other way, from a xul tab to a high-level tab object, use the mo...
... // loading. } }); parameters options : object required options: name type url string string url to be opened in the new tab. this is a required property. optional options: name type isprivate boolean boolean which will determine whether the new tab should be private or not. if your add-on does not support private browsing this will have no effect. see the private-browsing documentation for more information. defaults to false. innewwindow boolean if present and true, a new browser window will be opened and the url will be opened in the first tab in that window. this is an optional property. inbackground boolean if present and true, the new tab wil...
windows - Archive of obsolete content
common window events such as open and close private windows if your add-on has not opted into private browsing, then you won't see any private browser windows. private browser windows won't appear in the browserwindows property, you won't receive any window events, and you won't be able to open private windows. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. converting to chrome windows to convert from the browserwindow objects used in this api to the chrome window objects used in the window/utils api, use the viewfor() function exported by the viewfor module. to convert back the other way, from a chrome window to a browserwindow object, use the modelfor() function, ...
...he action button api, which is only available from firefox 29 onwards. parameters options : object required options: name type url string string url to be opened in the new window. this is a required property. isprivate boolean boolean which will determine whether the new window should be private or not. if your add-on does not support private browsing this will have no effect. see the private-browsing documentation for more information. optional options: name type onopen function a callback function that is called when the window has opened. this does not mean that the url content has loaded, only that the window itself is fully functional and its properties can be acces...
ui/button/action - Archive of obsolete content
automatically choose the best-fit icon for your button, depending on the device screen resolution and where the button is in the ui. on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. ...
...splay), these are doubled to 36 x 36 and 64 x 64 pixels, respectively. so you can supply three icon files: icon: { "16": "./addon16.png", "32": "./addon32.png", "64": "./addon64.png" } this will look fine in both toolbar and menu panel, and for both screen resolutions. however, the icons in the toolbar will not quite fill the space available, so you can instead supply four icons: icon: { "18": "./addon18.png", // toolbar icon non hidpi "32": "./addon32.png", // menu panel icon non hidpi "36": "./addon36.png", // toolbar icon hidpi "64": "./addon64.png" // menu panel icon hidpi } optional options: name type disabled boolean determines whether the button is disabled. d...
window/utils - Archive of obsolete content
pted into private browsing, so you need to take care not to store any user data derived from private browser windows. the exception 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 opted into private browsing. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance. returns nsidomwindow: the topmost browser window. getinnerid(window) returns the id of the specified window's current inner window. this function wraps nsidomwindowutils.currentinnerwindowid. paramete...
...text/html,hello window', { name: 'jetpack window', features: { width: 200, height: 50, popup: true } }); args object extra argument(s) to be attached to the new window as the window.arguments property. returns nsidomwindow opendialog(options) opens a top level window and returns its nsidomwindow representation. this is the same as open, but you can supply more features. it wraps window.opendialog. parameters options : object options for the function, with the following properties: name type url string uri of the document to be loaded into the window. defaults to "chrome://browser/content/browser.xul". name string optional name that is assigned to the window. defaults to "_blank". f...
Customizing the download progress bar - Archive of obsolete content
this is the product of some tweaking and experimentation, so perhaps there is a different and/or better way to achieve the same thing. we are specifying the height of the progress meter on windows and a background image on mac. the background image (the first one in the file) should be a segment of whatever you wan...
...dif %endif } richlistitem .progress-bar { %ifdef xp_win -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_fd_win.png) !important; %else %ifdef xp_macosx background-image: url(chrome://myextension/skin/progress_fd_osx.gif) !important; %endif %endif } note: this file only supports windows and mac, but it would be straightforward to add support for linux. this is the product of some tweaking and experimentation, so perhaps there is a different and/or better way to achieve the same thing. we are specifying the height of the progress meter on windows and a background image on mac. the background image (the first one in the file) should be a segment of whatever you want the unfilled portion of the progress bar to look like. an image...
Forms related code snippets - Archive of obsolete content
rsor: pointer; } td.zdp-empty-cell { cursor: not-allowed; } </style> </head> <body> <form name="myform"> <p> from: <input type="text" readonly class="date-picker" name="date-from" /> to: <input type="text" readonly class="date-picker" name="date-to" /> </p> </form> </body> </html> note: the current implementation of const (constant statement) is not part of ecmascript 5. it is supported in firefox & chrome (v8) and partially supported in opera 9+ and safari. it is not supported in internet explorer 6-9, or in the preview of internet explorer 10. const is going to be defined by ecmascript 6, but with different semantics. similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. if you want...
... a typing. insert some custom text in a <textarea> this example shows how to insert some html tags or smiles or any custom text in a textarea. image preview before upload the filereader.prototype.readasdataurl() method can be useful, for example, to get a preview of an image before uploading it.[article] this example shows how to use it in this way. note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code you can see our crossbrowser possible solution for image preview. filter the digitation into a form field this example shows the use of the onkeypress event during a digitation into a form field in order to match some rules. ...
Examples and demos from articles - Archive of obsolete content
jects in order to standardize and simplify the instantiation of them. here is a possible and minimalist example of such abstraction, which for this reason we named minidaemon. [article] image preview before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a preview of an image before uploading it. [article] note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code, see also our crossbrowser possible solution for image preview. determine if an element has been totally scrolled [html] this example shows how to determine whether a user has completely scrolled an element or not. [article] css pure-css dropdown menu [html] with the :hover pseudo-class you can create compl...
...simulate an editable <select> through a fieldset of radioboxes and textboxes. [article] expandable elements [html] this example shows how it is possible to show/hide classes of elements in pure css. in this demo there is also an example of a "toggle button" rendered through a <label> element. [article] code snippets and tutorials javascript complete cookies reader/writer with full unicode support this little framework consists of a complete cookies reader/writer with unicode support. xml to json conversion snippets (jxon) jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml. there are no real standards for this conversion, but some conventions begin to appear on the web. autogrowing <textarea> this...
IsDefaultNamespace - Archive of obsolete content
this function is not necessary for gecko-based browsers (though the function will quickly return the standard value for mozilla browsers). ...
...this function is not necessary for gecko-based browsers (though the function will quickly return the standard value for mozilla browsers). ...
JS XPCOM - Archive of obsolete content
for dealing with xpcom components in javascript. contract ids a contract id is a unique name for an xpcom object. they are used to create or access well-known objects in xpcom. interfaces every xpcom object implements one or more interfaces. an interface is simply a list of constants and methods that can be called on the object, an example is nsifile. every xpcom object must implement the nsisupports interface. accessing xpcom components from javascript xpcom objects are either created as new instances (each creation gives you a completely new com object) or as services (each access gives you the same com object, often called a singleton). whether you must create a new instance or access as a service depends on the contract. in order to get an xpcom object you need to know the contract...
... all the interfaces available on a component, but in most cases you will have to explicitly check for an interface. with the preferences service from the previous example we can do the following: var preferences = preferences.queryinterface(components.interfaces.nsiprefbranch2); this allows you to use the methods in the nsiprefbranch2 interface. determining which interfaces an xpcom component supports to display a list of all interfaces that an xpcom component supports, do the following: // |c| is the xpcom component instance for each (i in components.interfaces) { if (c instanceof i) { alert(i); } } in this context, instanceof is the same as queryinterface except that it returns false instead of throwing an exception when |c| doesn't support interface |i|. another difference is that ...
LookupPrefix - Archive of obsolete content
this function is not necessary for gecko-based browsers when used in xhtml. ...
...ginalelement.prefix) === namespaceuri) { return originalelement.prefix; } if (originalelement.attributes && originalelement.attributes.length) { for (var i=0; i < originalelement.attributes.length; i++) { var att = originalelement.attributes[i]; xmlnspattern.lastindex = 0; var localname = att.localname || att.name.substr(att.name.indexof(':')+1); // latter test for ie which doesn't support localname if (localname.indexof(':') !== -1) { // for firefox when in html mode localname = localname.substr(att.name.indexof(':')+1); } if ( xmlnspattern.test(att.name) && att.value === namespaceuri && lookupnamespaceuri(originalelement, localname) === namespaceuri ) { return localname; } } } if (originalelement.parentnode) { // entityreferences may h...
Progress Listeners - Archive of obsolete content
a listener for all tabs, selected and not: listening to events on all tabs. ...
...ion() { gbrowser.removeprogresslistener(this); }, processnewurl: function(auri) { if (auri.spec == this.oldurl) return; // now we know the url is new... ...
QuerySelector - Archive of obsolete content
el.queryselectorall(selector); // note: the returned object is a nodelist. ...
... ...
getAttributeNS - Archive of obsolete content
this function is not necessary for gecko-based browsers. ...
...this function is not necessary for gecko-based browsers. ...
Common Pitfalls - Archive of obsolete content
the first couple of items deal with loading content from a uri. it's important to create the uri correctly, and then check that it's secure to load. this will shield you from loading <tt>javascript:</tt> or <tt>chrome:</tt> uris when you shouldn't. ...
... the first couple of items deal with loading content from a uri. it's important to create the uri correctly, and then check that it's secure to load. this will shield you from loading <tt>javascript:</tt> or <tt>chrome:</tt> uris when you shouldn't. ...
Default Preferences - Archive of obsolete content
default preferences are set similarly but inside an extension and use the pref() function. ...
...default preferences are set similarly but inside an extension and use the pref() function. ...
Migrating raw components to add-ons - Archive of obsolete content
at these components don't have a mechanism for specifying the versions of firefox with which they are compatible, leading to poor integration and instability as users upgrade their firefox installations. the firefox extension mechanism allows you to do everything that you could do through direct component drops, but also gives you and your users extra flexibility and more sophisticated versioning support. as we roll this new behavior out, this document will be updated with additional information addressing scenarios we see developers encountering. simple migration if your goal is just to get your raw component working properly as an extension, you can do this in three steps: create a new add-on using the instructions here. as you'll see, add-ons give you much more flexibility than simply loa...
...dd-ons in an automated, programmatic way, we have documented a set of best practices. javascript c-types some add-on authors create binary components not because they want to interact with firefox at the c++ level, but strictly so that they can make use of third party dlls. if this is the only reason you are using a binary component instead of javascript, take a look at the new javascript c-types support introduced in firefox 3.6. it allows javascript code to load functions from dlls on windows, and should allow you to eliminate your dependence on binary components entirely. this leads to a better compatibility path as new versions of firefox are released. ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
...
...this report is avail...
Chapter 1: Introduction to Extensions - Archive of obsolete content
as opera or safari. what features are considered standard for web browsers these days? perhaps things like fine-grained tab controls, mouse gestures, extensive toolbars and buttons, a feed reader, integration with a variety of web applications, or sophisticated tools to assist with web design. but we didn't set out to create an all-in-one browser that can satisfy everyone. instead, firefox can support these features through extensions. the core browser is limited to basic features, so it’s something that a beginner can be comfortable with, but users who want something beyond that can install extensions. about extensions management using the add-ons manager firefox's add-ons manager is an excellent way to manage extensions, and is a great step up in ease of use. the add-ons manager ...
...he add-ons manager handles the following tasks: safely installs and uninstalls add-ons makes sure add-ons are compatible with the version of firefox you're using manages a whitelist of sites trusted for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge. because firefox and its extensions are designed to support multiple languages, excellent extensions come from all over the world, and can be quickly localized by anyone ...
Appendix D: Loading Scripts - Archive of obsolete content
ipt tags may or may not be loaded from pre-compiled bytecode in the fastload cache (gecko 1.x) or startup cache (gecko 2), which means they don't necessarily need to read as source and compiled with each restart. flexibility: script tags provide a means to specify the character set and javascript version of the scripts to be loaded, which many other methods do not. debuggable: development tools support debugging javascript loaded by script tags disadvantages scoping: scripts loaded via script tags share the global scope with all other scripts loaded into the same window. these tags provide no means to load scripts into a private or otherwise specific scope. speed: even if these scripts are loaded from a cache, only read and compile time are reduced. the scripts still need to execute a...
...o the possible performance concerns, passing data between these compartments is not entirely transparent. some known issues include: e4x xml objects cannot be wrapped for passage between compartments: bug 613142 there are a number of type detection issues, including: string.replace does not recognize regexp objects from foreign compartments: bug 633830 debugging: support for sandbox evaluation in development tools is uneven. chromebug supports firebug based sandboxes. examples the following code will execute a simple script in a sandbox with the privilege level of the current content page. the globals of the current content window will be available in the scripts global scope. in stack traces, the script will appear to have been loaded from the file "zz-9:...
Appendix F: Monitoring DOM changes - Archive of obsolete content
his document lays out some alternatives which do not have such severe performance impacts. mutation observers mutation observers are the more efficient, w3c speced replacement for the highly inefficient mutation events. their major advantage is in their performance and their ease of use, especially when combined with simple libraries. their main disadvantage is that, due to their recent advent, support is currently limited to firefox 14+ and chrome 18. while they are still viable for add-ons targeting only the latest firefox, those wishing to support older browsers will need to provide fallbacks. for more information, see this blog post on the issues at hand. non-mutation triggers it is usually possible to tell when a mutation has occurred or is about to occur without resorting to mutati...
...fficient fallback implementation for older browsers. it is worth noting, however, that while the animation-based implementation will fire any time an element which previously did not match the given selector is changed so that it does (when a class is added, for instance), the fallback will only match nodes when they are inserted into the dom tree. minor changes are also required if one wishes to support other browsers, or to run in non-chrome-privileged scopes. /** * watches for nodes matching the given css selector to become * available. * * @param {string} selector the css selector of nodes about which you * want to be notified. * @param {function(event)} callback the function which is to be called * when matching nodes become available. * @param {document} doc the documen...
User Notifications and Alerts - Archive of obsolete content
hrome://xulschoolhello/skin/hello-notification.png", title, message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver. we do this when we need to handle clicks on the alert box. the image can have any size, but it is recommended that you use a medium, fixed size. the main disadvantage of using alerts is that support for the alerts service is not guaranteed for all platforms and firefox versions. support for windows has existed since firefox 2. for mac os x, support was added on firefox 3, and only through a third-party tool called growl. on linux systems, we have confirmed that it works on firefox 3 on ubuntu linux, but we haven't tested all distributions and firefox versions. because of the inconsisten...
... custom alerts creating custom solutions for alerting the user is not complicated, given the advantages of xul overlays and css positioning. ...
Promises - Archive of obsolete content
exstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api. while this api does not have direct support for promises, its standard usage is very easy to adapt to a promise-based approach. moreover, many third-party wrappers for the xmlhttprequest api now support promises out of the box. example direct usage task.spawn(function* () { // make the initial request. let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; ...
...t for the // second request. let form = new formdata; form.append("id", data.id); form.append("content", data.content); // make the second request. xhr = yield request(updateurl, { data: form }); // use the response of the second request. notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module. the downloads object provides a promise-based api for downloading remote files, with full support for progress tracking, pause and resume, and, optionally, integration with the download manager ui. representative example usage components.utils.import("resource://gre/modules/downloads.jsm"); task.spawn(function* () { // fetch a file in the bac...
Creating reusable content with CSS and XBL - Archive of obsolete content
ing> </bindings> make a new css file, bind6.css. this separate stylesheet contains style for the binding. copy and paste the content from here: /*** xbl demonstration ***/ [anonid="square"] { width: 20em; height: 20em; border: 2px inset gray; } [anonid="button"] { margin-top: 1em; padding: .5em 2em; } open the document in your browser and press the button. this wiki does not support javascript 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 javascript code. the document does not contain any buttons. it only contains the text of the button's label. the ...
...fter you press the button: notes about this demonstration: the html document links the document stylesheet as usual, but it does not link any javascript code. the document does not contain any buttons. it only contains the text of the button's label. the button is added by the binding. the document stylesheet links the binding. the binding links its own stylesheet, and it supplies its own content and javascript code. so the binding is self-contained. challenges change the xbl file so that the square doubles in width when it changes color, instead of jumping to the right. use the dom inspector tool to inspect the document, revealing the added content. what next? if you had difficulty understanding this page, or if you have other comments a...
MozOrientation - Archive of obsolete content
you should use that api instead. an event that is repeatedly fired on the window as accelerator data is provided to the browser. note: this below describes how these values worked for the now obsolete mozorientation. the x axis represents the amount of right-to-left tilt. this value is 0 if the device is level along the x axis, and approaches 1 as the device is tilted toward the left, and -1 as the device is tilted toward the right. ...
...to increase. the value is 0 if the device is being thrust upward. in free fall (weightless or falling as a result of a drop), the value remains -1. in weightlessness, all values would be zero when the device is not moving, regardless of orientation, and would only change when being accelerated. in firefox versions 3.6, 4, and 5 gecko utilized mozorientation which was also built to support orientation data but with different apis from the specified deviceorientationevent. to normalize between the two you can do something like this: function orientationhandler(evt){ // for ff3.6+ if (!evt.gamma && !evt.beta) { evt.gamma = -(evt.x * (180 / math.pi)); evt.beta = -(evt.y * (180 / math.pi)); } // use evt.gamma, evt.beta, and evt.alpha // according...
Using XML Data Islands in Mozilla - Archive of obsolete content
html5 has a more general feature called "data blocks" that can carry almost any textual data, including xml. ...
...html5 has a more general feature called "data blocks" that can carry almost any textual data, including xml. ...
Working with BFCache - Archive of obsolete content
q: what is the bfcache exactly? a: bfcache stands for back-forward cache. for more info about this, read how to use firefox caching. q: when a user clicks a link that replaces the view in the current tab with a new page, what is the fate of the nsidomwindow supporting the view they click on? or: what happens when they hit the 'back' button? a: the outer nsidomwindow (the |window| object in content js, aka the <browser>'s contentwindow object in the parent document) stays right where it is. it just has its inner window and document replaced. the inner nsidomwindow (the global scope object in content js) is either thrown away when gc happens, or frozen and placed in the bfcache. when the user hits the 'back' button, either the window in bfcache is thawed or a new inner window is create...
...w tells you whether it's coming from bfcache. note that just because a page went into bfcache doesn't mean it'll ever come out again, like any other cache. q: hmm, so what event tells me “you'll never get a pageshow so you can drop the megabytes of info you've saved in firebug side table for that page?” a: an observer notification with the topic "inner-window-destroyed" whose subject is an nsisupportspruint64 containing the window id of the inner window being destroyed. ...
Building TransforMiiX standalone - Archive of obsolete content
read the build instructions for your platform to get the requirements, which are the same as for mozilla. you need to get the source from cvs. add tx_exe=1 mk_add_options build_modules="xpcom transformiix" ac_add_options --enable-standalone-modules="xpcom transformiix" to your .mozconfig, and use client.mk to pull as usual. ...
...as usual. this will pull the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/transformiix mozilla/include mozilla/allmakefiles.sh mozilla/client.mk mozilla/aclocal.m4 mozilla/configure mozilla/configure.in mozilla/makefile.in plus nspr and xpcom from the cvs repository. building from a full mozilla tree is not supported. it is recommended to add ac_add_options --disable-gtktest ac_add_options --without-jpeg ac_add_options --without-zlib ac_add_options --without-png ac_add_options --without-x to your .mozconfig, too, as it stops configure from testing unneeded libs. make -f client.mk build as usual. of course, make -f client.mk checks out and builds just transformiix alright. the binary transfor...
Creating a Microsummary - Archive of obsolete content
web pages can reference generators via <link rel="microsummary"> elements in their <head> elements. generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. in this tutorial we're going to create a microsummary generator for the spread firefox home page that displays the current firefox download count along with the label fx downloads; for example: 174475447 fx downloads. ...
...we might do so via the following code: <script> const warning = "sorry, you need a microsummary-enabled browser like firefox 2.0 to install and use microsummary generators."; function addgenerator(ur...
DTrace - Archive of obsolete content
dtrace is sun microsystem's dynamic tracing framework that allows developers to instrument a program with probes that have little to no effect on performance when not in use and very little when active. probe data can be collected with scripts written in d (no, not that one). mozilla dtrace support has been added by the sun dtrace team and can be used on solaris 10 and mac os x 10.5. dtrace has been largely supplanted by the gecko profiler and other tools, so this documentation has been archived. if you find that there are still use cases of consequence, you're welcome to file a documentation bug. the dtrace probes currently built into the codebase may be enabled by default in the future, but for now you'll need to create a build with --enable-dtrace (on mac os x you also have to...
...ill use cases of consequence, you're welcome to file a documentation bug. the dtrace probes currently built into the codebase may be enabled by default in the future, but for now you'll need to create a build with --enable-dtrace (on mac os x you also have to use at least the 10.5 sdk for --with-macos-sdk, unlike the common configuration that uses the 10.4 sdk). trunk nightly builds with shark support (*-mac-shark.dmg here) are built with --enable-dtrace. documentation writing scripts a general introduction to writing d scripts and using the built-in mozilla probes. optimizing javascript with dtrace a guide on profiling javascript code using dtrace. adding probes a guide on creating probes and the build system magic needed to add probes to...
Drag and Drop - Archive of obsolete content
s can be handled. this first involves using the drag and drop xpcom interfaces directly. the second is to use a javascript wrapper object that handles some of this for you. the code for this wrapper can be found in a file named toolkit/content/nsdraganddrop.js nsdraganddrop.js which is contained in the widget-toolkit (or global) package. xpcom drag and drop interfaces two interfaces are used to support drag and drop. the first is a drag service, nsidragservice and the second is the drag session, nsidragsession. the nsidragservice is responsible for creating drag sessions when a drag starts, and removing the drag session when the drag is complete. the function invokedragsession should be called to start a drag inside an ondraggesture event handler. once this function is called, a drag has s...
... dragged. for example, this will be set to 5 if five bookmarks are being dragged. getdata(transfer,index) get the data being dragged. the first argument should be an nsitransferable object to hold the data. the second argument, index, should be the index of the item to return. sourcedocument the document where the drag started. sourcenode the dom node where the drag started. isdataflavorsupported(flavor) returns true if the data being dragged contains data of the specified flavor. next » original document information author(s): neil deakin original document: copyright information: copyright (c) neil deakin ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
umentopeninfo this class encapsulates all the information related to a particular load. there is basically one of these per load (though see the section on stream converters). nsdocumentopeninfo implements nsistreamlistener and proxies the nsistreamlistener calls over to the "real" stream listener once one is chosen. this is the class that handles deciding where the data from the load should go. supporting roles necko this is the mozilla networking library. this handles actually going out and getting the data. it also handles determining the mime type of the data, which is used to decide who gets the data. category manager this is used in a last-ditch attempt to find a content listener. nsiuricontentlistener implementations we try to find one of these which can handle data of the type we'r...
... session history issues. it calls douriload(). douriload() creates a channel, massages it to have the right post data, load flags, cache key, referrer, etc. it then passes the channel to dochannelload, which does some more flag massaging and then calls into the uriloader. nsuriloader::openuri gets a channel to open, a boolean indicating whether this load is the result of a link click, and an nsisupports "window context" (the docshell triggering the load, actually, but in drag and heavy makeup). it immediately hands off to nsuriloader::openchannel. nsuriloader::openchannel notifies the nsiuricontentlistener hanging off the window context, if any, of the start of the load; this gives embedders a chance to abort the load if this uri type is something they want to handle in the embedding app.
GRE - Archive of obsolete content
laced by xulrunner. mozilla suite: the old gre there are two different forms for the gre: the "old" gre was part of the mozilla application suite. it was installed with the windows installer of mozilla 1.4 through 1.7.x. there was never an official gre shipped for linux, but various distributors such as red hat have registered mozilla installations as if they were a gre. the mozilla suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version of the gre, which not only allows embedding but is capable of bootstrapping entire xul applications such as firefox. xulrunner supports or is planned to support embedding on all three major platforms (windows, mac, and linux). finding and using a gre from application code avoid linking directly against xpcom.dll if an ap...
...avoid linking directly against xpcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries. if you link directly against xpcom.dll/libxpcom.so (xpcom.lib import lib), your application will not launch unless xpcom.dll is in your path. this prevents dynamically finding a compatible gre at runtime. find a compatible gre note: support for locating a standalone glue was removed in gecko 6.0. to find a compatible gre, you should use the function gre_getgrepathwithproperties() (declared in xpcom/glue/standalone/nsxpcomglue.h). this allows the embedder to specify what version(s) of gre are appropriate, and to specify any special features the gre must have (currently there are no special features defined). statically link to...
Helper Apps (and a bit of Save As) - Archive of obsolete content
oc() method on nsilocalfilemac. unix: launch directly via nsiprocess. security considerations multiple checks for whether a file is executable (on windows) to keep from launching such files via ::shellexecute(). checks happen in onstartrequest, in the helper app dialog, and as a last ditch in the launching code. limitations of nsimimeinfo no way to say "do whatever the os default is." no support for command-line arguments. no support for multiple commands connected by pipes (mostly useful on unix). ongoing work support synchronous dialogs, not just asynchronous ones (fixes many issues related to pre-downloading, content-decoding, etc). reworking the nsimimeservice api to improve the quality of the mimeinfo we get. reworking the helper app dialog to save user choices better. g...
... possible kde integration. possibly reflecting the os settings in our helper app preferences (readonly? writable?). have a way for users to override things in the "not overridable" built-in list. ...
generateCRMFRequest() - Archive of obsolete content
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't wo...
... this string is an optional algorithm dependent parameter value. for diffie-hellman it is used to specify p and g parameters. for dsa, it will be used to specify pqg. if the key generation requires parameters and the value passed in is null, then the client will generate the parameters on its own. currently, this value is ignored. "keygenalgn" which algorithm the generated key will support. acceptable values are (the mentioned values for keyusage pertain to the keyusage value of the certificate extension that will ultimately be in the issued certificate): "rsa-ex" - generate an rsa key for key exchange only (this will have eyencipherment set for keyusage.) "rsa-dual-use" - generate a single rsa key for both signing and encryption. (this will have digitalsignature...
Java in Firefox Extensions - Archive of obsolete content
a firefox extension, you can make use of liveconnect. liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., var ajavalist = new java.util.linkedlist(); if you want to load your own jars, then you can create your own java class loader. the following technique only works in javascript code linked from or contained in xul files. if you wish to ...
...one example seems to be the fact that the "java" global is not immediately available if the extension operates in a sidebar (...
Extenders - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development. ...
... note: this page documents the jetpack prototype, which is no longer under active development. ...
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
e clicked. see bug 534014 for details and a workaround. data string an arbitrary string that the feature may associate with the menuitem. disabled boolean if true, the menuitem is disabled. icon string the url of an icon to display in the menuitem. note that some environments, notably gnome 2.28, do not support menuitem icons either by default or at all. label string the label of the menuitem. menu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's shortcut key while the menu is open. it should be one of the characters that appears in the item's lab...
...nu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's shortcut key while the menu is open. it should be one of the characters that appears in the item's label. on some platforms this character is underlined in the label. type string currently only "separator" is supported. if this property is undefined, the item is a normal menuitem. note that when type == "separator", any other properties (such as label) may be specified. fancy separators may behave differently on different platforms, however. xulid string the id of the menuitem's backing xul element, exposed for the benefit of advanced developers. menu bar menus jetpac...
Monitoring downloads - Archive of obsolete content
ks like this: logtransfercompleted: function(adownload) { var endtime = new date(); // current time is the end time // issue the replace sqlite command to update the record. we find a // record for the same source uri and start time, then update the end // time, size, and speed entries in the record. by matching on both // source uri and start time, we support logging multiple downloads of // the same file. var dbconn = this.storageservice.opendatabase(this.dbfile); var statement = dbconn.createstatement("update items set size=?1, " + "endtime=?2, speed=?3, status=?4 where source=?5 and starttime=?6"); statement.bindint64parameter(0, adownload.size); statement.bindint64parameter(1, endtime.gettime()); stateme...
...dint64parameter(5, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); }, this simply opens the database and builds and executes a update sqlite command that finds the download item whose source uri and start time match the download that has completed and updates its information. by looking for a record with both the same uri and start time, we properly support the case where the user downloads the same file multiple times. displaying the download log the download log window's code is encapsulated in an object called downloadlogger_dlwindow. since this is a simple example, it's a one-shot log window; it doesn't monitor for further changes to the log. it simply displays the state of downloads at the moment the window was opened. that means all its...
FAQ - Archive of obsolete content
Archive › Mozilla › Prism › FAQ
rovided by prism becomes a product or is integrated into other products (like firefox), then it won't necessarily continue to be called by this codename. is prism a platform? no, prism is not a platform. prism is built on top of the mozilla platform and its gecko rendering engine, just like mozilla firefox, so it provides the same capabilities to web applications that firefox provides, including support for html, javascript, css, and <canvas>. at the same time, we're also working to increase the capabilities of those apps by adding features to the web itself, like support for offline data storage and access to 3d graphics hardware, that will be available to web applications in both prism and firefox. how is prism different from xulrunner? prism is built on top of xulrunner. prism is a simpl...
...re, that will be available to web applications in both prism and firefox. how is prism different from xulrunner? prism is built on top of xulrunner. ...
Prism - Archive of obsolete content
also benefit from operating system tools that lets us view the memory/cpu consumption of a specific application. minimal user interface: a general-purpose browser ui is not necessary or appropriate for most web apps. it is more efficient to provide a ui that is specific to the application. this also cuts down on ui clutter (hence the term distraction-free browser). basic desktop integration: support of desktop features can make using the app more natural and convenient for end users. this includes the ability to create desktop shortcuts, to place the application icon in the tray or dock and to display pop-up notifications. customization: apps can be run using a shared browser runtime and customized using client-side script (similar to greasemonkey). custom stylesheets can be used to tw...
... a webapp bundle should contain a webapp.ini configuration file. the configuration file is a simple, ini-style text file that specifies some parameters about a web application. styling one of prism's goals is to make web applications feel more like desktop applications. one way to make the illusion seem more real is to use styling (or theming). prism supports a simple styling system that allows the user to add css files to the webapp bundle. scripting prism allows for some client-side web application customization. some simple objects and utilities are exposed to webapp scripts. host window prism provides a simple, scaled down browser window for running we...
Proxy UI - Archive of obsolete content
products firefox menu: preferences > advanced tab > networking tab > connection button. thunderbird menu: preferences > advanced tab > networking tab > connection button. seamonkey menu: preferences > advanced group > proxies panel menu: right-click on offline-online button (on browser windows). camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel overview the ui is based on selecting a proxy mode, then filling out any additional needed information in "related" ui. the "ok" button saves the preferences. the preference changes selecting the proxy "mode" all product's proxy preference panels share a basic design: a radio button that selects the proxy mode, then "related proxy mode" ui...
...f the protocol was proxyable and did not match any of the previous protocols), then use socks. the socks version is selected by radio buttons: ( ) socks v4 ( ) socks v5 "no proxy for:" discussed in detail elsewhere... but should be noted that if you cut and paste from ie, the semi-colons are automatically converted to commas when you save changes (ff, tb, sm). automatic proxy configuration url supports a url (which is checked via urifixup) and a reload button. offline|online "plug" location status bar on the right side. right-click a menu is displayed that has the following items: online (proxy: none) online (proxy: auto discover) online (proxy: auto url) online (proxy: manual) --- proxy configuration... <h7 name="details">details</h7> the menu should display the current proxy mode with a ...
Reading textual data - Archive of obsolete content
with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some platforms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced with; nsiconverterinputstream.default_replacement_character is u+fffd replacement character, which is often a good choice. if you do not want any replacement, you can specify 0x0000 as replacement cha...
...equences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced with; nsiconverterinputstream.default_replacement_character is u+fffd replacement character, which is often a good choice. if you do not want any replacement, you can specify 0x0000 as replacement character; that way, readstring will throw an exception when reaching unsupported bytes. reading lines the nsiunicharlineinputstream interface provides an easy way to read entire lines from a unichar stream. it can be used like nsilineinputstream, except that it supports non-ascii characters, and has no problems with charsets with embedded nulls (like utf-16 and utf-32). it can be used like this: var charset = /* need to find out what the character encoding is. using...
Space Manager Detailed Design - Archive of obsolete content
the space manager, and as an introduction to the classes, structures and algorithms container in this, the detailed design document. nsspacemanager the space manager is the central class is a group of classes that manage the occupied and available space that exists in horizontal bands across a canvas. the primary goal of the space manager is to provide information about those bands of space to support the css notion of floated elements. there are three important parts to the space manager api: the parts that deal with the coordinate space of the space manager, the parts that deal with the regions managed by the space manager, and the parts that manage float impact intervals. the class nsspacemanager is declared in the file nsspacemanger.h. the class is only used in the layout module and ca...
...lementation }; public api life cycle the constructor requires a presentation shell, used for arena allocations mostly, and a frame that this space manager is rooted on. the coordinate space of this space manager is relative to the frame passed in to the constructor. nsspacemanager(nsipresshell* apresshell, nsiframe* aframe); ~nsspacemanager(); operators 'new' and 'delete' are overridden to support a recycler. space manager instances come and go pretty frequently, and this recycler prevents excessive heap allocations and the performance penalties associated with it. the #define ns_space_manager_cache_size is used to control the number of space manager instances that can be present in the recycler, currently 4. if more than ns_space_manager_cache_size are allocated at a time,then standar...
Table Layout Regression Tests - Archive of obsolete content
it is unclear whether or how well rtest continues to work and whether it is still used or not. subject overview changes in layout, parser and content code can have unintended side effects, also known as regressions. ...
...clude your file. additional notes there is a special type of frame dumps - the printing regression tests, they are invoked by the -prt command line argument to the viewer and include first a display then a frame dump taking into account the printer pages. please contact if you need help with running those tests. i would like to thank chris karnaze for his guidance and fantasai for her language support. original document information author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Venkman Introduction - Archive of obsolete content
eract with the debugger from a command line. commands are entered in the text box, and responses are appended to the end of the output. type /commands in the input area (the text box) to list all of the commands available. the /help command can be used to get additional information about a specific command. you can type /help next, for example, to see how to use the next command. the input area supports command history and tab-completion for command names. command history remembers the last 20 commands entered. the up and down arrows can be used to revisit these previous commands. tab completion allows the user to type the first portion of a command, and press tab twice to see possible completions. if only one command matches, it will be auto-completed on the first tab. view customization ...
...nd with it — to set it up in the way that makes the most sense to you, to try loading scripts and setting breakpoints, evaluating expressions in the interactive session view, watching the values of variables as they change when scripts are executed, getting profile data. debugging extensions although at first glance it might seem that venkman cannot debug extensions, doing so is in fact fully supported; it's just disabled by default. to debug your extension with venkman (xul files and their attached js files), you'll have to load browser and extension files into venkman by unchecking debug > exclude browser files. resources using breakpoints in venkman — next article about venkman. venkman's home page on mdc. original document information authors: ian oeschger, robert ginda ...
Binding Implementations - Archive of obsolete content
e property is requested. a setter contains a script that is invoked when a new value is assigned to the property. in script, the word val is used to represent the new value. properties can be designated as constant using the readonly attribute. when set to true, the property's value cannot be altered. if a property is readonly and a setter is defined, then the setter is ignored. properties also support a shorthand syntax for defining getters and setters that forward requests or assignments to an anonymous content element. the element attribute specifies the id of anonymous content underneath the bound element that should be used when obtained the property or setting the property. on the anonymous content element, the property can be obtained either from an attribute on the element or from ...
... attribute to use on the anonymous content element. if either of these attributes is specified on the property element, then any defined getters and setters are ignored. a raw initial value is also ignored. if both a property and attribute are specified, then the property takes precedence and the attribute is ignored. inheritance of implementations when two bindings in an inheritance chain both supply implementations, the derived binding's implementation inherits from the base binding's implementation. method and property lookups are dynamic. without disambiguating, if two bindings define the same method or property, then the most derived binding's method or property will be used. because bindings extend dom elements, they can override any built-in methods or properties on the dom element.
Event Handlers - Archive of obsolete content
s the target to which the handler is attached, and capturing, which indicates the handler should fire during the capturing phase of event flow. xbl event handlers always fire last, after all other event handlers at the same position in the event flow. since xbl handlers usually constitute the default actions for a widget, this allows authors in the bound document to write events that potentially suppress the default actions taken by the xbl handlers. within an xbl inheritance chain, event handlers always fire first on the derived binding and then on the base binding in the chain. a derived handler then has a way of preventing the event from flowing to its base binding handlers. mouse and key handlers have certain additional properties that are supported by xbl. additional attributes can be...
... handler to execute. examples of common keys in the list are shift and control. for more details, see the xbl element reference for <handler>. in addition, mouse events can specify the button and the clickcount. this allows xbl authors to easily define handlers for right-click, or for left double-click, without having to write script on the same handler to differentiate those cases. key events support the charcode and keycode attributes. when set, the corresponding fields in the event object must match for the event to fire. [editor's note: should we have section on error-handling? probably.] ...
confirm - Archive of obsolete content
nfirmation dialog. method of install object syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8. it accepts any number of parameters up to 8. previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form. see the notes at the end of this document for a safe way to implement a fallback. atext the string to be displayed in the confirmation dialog. this string is typically in the form of a...
... 0 'cancel' or button 1. also: user closed the dialog window 1 'ok' or button 0 2 the third button previous versions of the xpinstall api stated the return value of confirm() to be a boolean. that is incorrect, confirm() always returned a plain integer (in pre-gecko-1.8 versions either 0 or 1). notes the preferred method for detecting support for custom dialog boxes is querying the existence of the button constants. other approaches (e.g. buildid comparisons) are not recommended. if ("button_pos_0" in install) { // use extended confirm() method } else { // use classic confirm() method } ...
XPJS Components Proposal - Archive of obsolete content
this is a proposal for a system that got implemented, but it may differ from the actual implementation. see the status document for more recent info on the status of this proposal. draft 1.0 what are xpjs components? xpjs components is a (cheesy) name for a system to support xpcom components written in javascript. now, you might ask: "isn't that what xpconnect does?" and i would answer that xpconnect is necessary, but not sufficient to the task. ...
...d answer that xpconnect is necessary, but not sufficient to the task. xpconnect provides the mechanisms for communication between native and js xpcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window. xpjs will provide that infrastructure. so what does this mean? the xpjs component system will support implementing xpcom services, factories, and components in javascript. it will support service and factory registration. these components will be independent of web content and browser windows. they will run from the user's disk just like native components. how will it work? the overriding principle is to make this work as much like native components as possible. xjs components will 'live' i...
drawintitlebar - Archive of obsolete content
...
... ...
Getting File Information - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the nsifile object has a number of useful attributes which may be used to retrieve information about a file. two useful attributes filesize and lastmodifie...
... ...
Reading from Files - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. reading data from a file involves getting a reference to a file and then creating an input stream to read from it. an input stream provides a means of readi...
...codings the default character encoding is utf-8. if you know that a file is stored using a different encoding, you can specify a third argument to nsiscriptableio.newinputstream() which specifies the encoding. this example opens a file using the utf-16 encoding. var stream = io.newinputstream(file, "text", "utf-16"); this third argument is not needed if the file is stored in utf-8. for a list of supported character encodings, see supported character sets. the files can be read in the same manner using the readstring and readline methods. the difference is handled internally so you don't need to write any other part of the code differently. reading binary data in addition to text, binary values may be read from a file either as bytes, or interpreted as numbers. a number of methods are availab...
Uploading and Downloading Files - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to upload files to servers in various ways. the exact method depends on the type of upload that you wish to pe...
...mdata(); formdata.append(fieldname, new file(filepath)); var req = new xmlhttprequest(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation. this is simpler but it doesn't allow sending additional data and web servers usually need special configuration to support put operations. function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method. fetch ...
Moving, Copying and Deleting Files - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object which may be used to move and copy files on disk. nsifile.copyto() is used to copy a file, while nsifile.mo...
...name. this will be the usual behaviour when copying to a different directory, but you would want to specify a filename when copying a file to another name within the same directory. in this latter situation, you may also omit the destination directory. var file = io.newfile("desktop", "myimage.png"); file.copyto(null, "anotherimage.png"); here, a file is copied within the same directory as the supplied destination is null. a number of errors could occur when copying a file, for instance if the file to copy does not exist or the destination directory is not writable. it is a good idea to enclose file operations within a try-catch block in order to capture any errors that might occur. for a list of possible file related errors, see file errors. moving a file to move a file, nsifile.moveto...
How to implement a custom XUL query processor component - Archive of obsolete content
custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component. in this example, we will create a simple javascript xpcom component. the component will hold a small array of javascript objects as its datasource. in practice, you would use your own custom source of data. ...
...prepended to it, so be sure to handle it appropriately. we are not handling any datasources, but instead hard code the datasource in the component. you could easily extend this sample to handle multiple datasources by checking the datasources value in getdatasource and initializeforbuilding. we do not make use of any <query/> or <rule/> elements in the xul template block. these could be used to support filtering the datasource. ...
ContextMenus - Archive of obsolete content
left-clicked or pressed normally, as opposed to context clicked. you can indicate this item, if it applies, using the default attribute. <menupopup id="link-menu"> <menuitem label="open link" default="true"/> <menuitem label="open in new window"/> <menuitem label="properties"/> </menupopup> the default attribute has been set to true on the first menu item ('open link'). on platforms that support it, it will be marked as a default item. on other platforms, the attribute will just be ignored and the menuitem will be displayed normally. naturally, it only makes sense to have one default item per context menu. note that the default attribute just affects how the item is displayed, it performs no other function itself. you will still need to associate code with the element to handle the ...
...l="image details"/> </menupopup> <browser src="http://www.mozilla.org" context="contentareacontextmenu"/> when the popupshowing event is fired, the showhideitems function is called. the triggernode is retrieved and examined to see if it is an image. the nsiimageloadingcontent interface is implemented by all types of images. this is useful instead of comparing the tag, as several different tags support images. the test also checks to ensure that the element has a uri set. finally, the hidden state of two menuitems are adjusted based on whether the context is an image or not. the result is that context clicking on images will show a menu with three items, but will only show one item for other types of elements. ...
Menus - Archive of obsolete content
'. instead of creating a standard button, this will create a button with a small arrow or other indicator. clicking the button will display the menu, allowing a command to be selected. this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box. see menu buttons for more information. toolbarbutton toolbar buttons can also support menus. this works just like it does for other buttons. see menu buttons for more information. menulist a menulist is used when you wish the user to select from a list of items. for this type of menu, one of the items within it is selected. when another item is selected, the label of the item is set as the label of the menulist. other user interfaces call this type of widget a combobox. yo...
...ame document, in this case 'cmd_open'. the command event will be fired on the command element instead of the menuitem. this is useful when you wish to have several elements performing the same action, for example a menuitem on a menubar, a context menu, and a toolbar button, because you can place the code to execute only once on the command and hook each element up to the command. menuitems also support displaying shortcuts associated with the menuitem, as well as icons beside the label. for details about adding shortcut keys to menus, see adding shortcut keys to menu items. for details about adding icons to menus, see adding icons to menu items. for details about creating checkbox menu items or radio menu items see checkbox menu items or radio menu items. menu items can be disabled by set...
OpenClose - Archive of obsolete content
us, and the submenu is closed when the mouse is moved away. now try opening a context menu on the same bookmark and note how the other menus aren't affected by mouse movement. this difference is handled by the use of the iscontextmenu flag. finally, the last argument to the openpopup method, attributesoverride indicates whether attributes placed on the popup element itself override the arguments supplied. this allows a popup to use specific positioning behaviour by using the position, left and top attributes instead. more details on these attributes can be found at positioning a popup. unanchored popups with openpopup if the first argument to the openpopup method is null, this creates an unanchored popup. in this case, the second argument, the position, is not used, so an empty string can ...
...is method. void openpopupatscreen(in long x, in long y, in boolean iscontextmenu); the iscontextmenu argument indicates that a context menu is being opened, and functions the same as the corresponding argument for the openpopup method. in the following example, the popup is opened at horizontal positon 100 and vertical position 200: popup.openpopupatscreen(100, 200, false); note that if the supplied coordinates would cause the popup to be partially or completely off screen, the popup will be moved such that it is fully visible, and may be resized if necessary. closing a popup with the hidepopup method a popup menu is closed by the user pressing the escape key or by clicking somewhere outside the popup. for closing menupopups that use the menu tag, the button tag and the toolbarbutton...
Introduction - Archive of obsolete content
eturned from the query, generate some content. the template syntax allows for different rules to generate different content based on particular criteria as well as set attribute values from returned results. some other systems call this databinding. effectively, xul templates are the xul way of doing databinding. each template retrieves its data from a datasource. several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources. in xul, the datasource is specified by placing the datasources attribute on an element. typically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the url of an xml file is specified. when the xul parser sees an element wi...
... </template> </listbox> this template uses an xml datasource to generate a listbox. although we'll look at the details of this later, the simple result here is that a listitem will be generated for each child node in the xml data, setting the label to the name attribute for each xml node. for sqlite datasources, the datasources attribute specifies the uri of a database file. only local files are supported, so a file url should be used. if the datasource type supports it, the template builder can also use multiple datasources which are all combined into a single datasource as if they were all in one datasource to begin with. only the built-in rdf type supports this mechanism; the xml and sqlite types do not. when multiple datasources are used, an nsirdfcompositedatasource is created to hold a...
RDF Modifications - Archive of obsolete content
ed information. you don't need to implement this observer yourself, although you may add an observer to the datasource if you want to be notified when the data changes. note that this automatic updating of the template does not occur for xml and sqlite sources, only for rdf datasources. however, as it is possible to use and/or implement other query types with templates, these additional types may support automatic updating. there are two main situations when the notifications are made. the first is when the modification functions on the datasource are called. there are four such functions: 'assert', to add a new triple (or arrow) to the rdf graph, 'unassert' to remove a triple, 'change' to adjust the target of a triple, and 'move' to adjust the source of a 'triple'. for mozilla's datasources,...
...is part of the process, so the builder moves onto the member statement. this type of statement can only cause a change when an item is being added or removed from a container. since this is a new rdf triple that isn't an addition or removal from a container, this statement can be skipped. effectively, if the result generation process was to evaluate this member statement, the same output would be supplied for the ?photo variable whether the new data is there or not. thus, the member statement can be skipped. the next statement is a triple involving the 'http://purl.org/dc/elements/1.1/title' predicate. we aren't adding a arc involving this triple so we can ignore this statement as well. the second triple, however, could cause a change, since the predicate attribute matches the predicate being...
Template Logging - Archive of obsolete content
« previous debugging problems with a template can be difficult as many problems are logic errors that are often not possible to determine automatically. for example, if you spell a value wrong, no data may be returned, but the template system won't know that that this was because of a spelling error, or simply that there shouldn't be any data anyway. fortunately, some debugging and logging support is provided with templates that may help. logging template results there are two main ways in which template errors may be detected. the first debugging method involves logging all new results that apply to the template due to the data changing as well as logging results that are changed or removed. in addition, each result generated when the template is first created and initialized is logge...
...sing ref http://www.some-fictitious-zoo.com/birds removed inactive result for query 2 (active query is 1): http://www.some-fictitious-zoo.com/birds/barnowl in this example, a result with the id 'http://www.some-fictitious-zoo.com/birds/barnowl' has been removed. again, it was a result from query 2. however, note that the result is specified as being 'inactive'. this is because the result is also supplied by the first query which overrides it. the template's generated content will not change in this example as an active result is not changing. in other words, the generated content will only change when active results are involved. in template with id root using ref http://www.some-fictitious-zoo.com/birds removed active result for query 1 (no new active query): http://www.some-fictitious-zoo.
XML Templates - Archive of obsolete content
an xml document will be loaded and xpath expressions may be used to take portions of the xml document and generate content from these. when an xml source is desired, specify a querytype attribute on the root node of the template to the value xml. this indicates to the template builder that an xml source is being used as that the queries use syntax that is specific to xml. the datasources attribute should be set to the url of an xml document, either a local file or a remote web site. ...
...istbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <listbox> the url in the datasources attribute may be a relative url or an absolute url. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). for this and the following examples, we are going to use the following xml document containing a list of people: <people> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gende...
textbox (Toolkit autocomplete) - Archive of obsolete content
fore the timer fires a command event. there is no default. the timer starts after the user types a character. if the user types another character, the timer resets. type type: one of the values below you can set the type attribute to one of the values below for a more specialized type of textbox. don't set the type if you wish to use a regular textbox. autocomplete a textbox that supports autocomplete. for more information about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalpl...
..., focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata getsearchat( index ) return type: string returns the search component with the given index. ...
Tree Widget Changes - Archive of obsolete content
el attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ... </treecol> </treecols> </tree> if the column is editable, the user can click the cell to change the state of the checkbox. when the user clicks the cell, the view's setcellvalue method will be called with either the value true or false. note that the tree must also be marked as edita...
...order for this to work. this is shown in the example above. sometimes, you might have a particular row or cell which you do not want to be editable. in this case, disable editing for that cell by setting editable to false for that cell, as in the following: <treecell value="true" editable="false"/> or, for custom views, return false from the iseditable method. currently, only checkbox columns support editing, although the content-based tree handles the nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells. for instance: var col = tree.columns.getprimarycolumn(); treecell.setcelltext(5, col, "banana"); this will change the label of the cell in row 5 and the primary column to banana. however, this paves the wa...
Adding Labels and Images - Archive of obsolete content
n set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes here."; internally, both the label element and the description elements are the same. the label element is intended for labels of controls, such as text fields. the control attribute is only supported for labels. the description element is intended for other descriptive text such as informative text at the top of a dialog box. images xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the url of the image file. the example below shows...
... at the top of a dialog box. images xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the url of the image file. the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in order to support different themes to use a style sheet to set the image url. a later section will describe how to use style sheets, but an example will be shown here for completeness. you can use the list-style-image css property to set the url for the image. here are some examples: xul: <image id="image1"/> <image id="search"/> style sheet: #image1 { list-style-image: url("chrome://findfile/skin/banne...
Creating Dialogs - Archive of obsolete content
it works and appears to the user. these differences will vary depending on the platform the application is running on. in addition, the opendialog() function can take additional arguments beyond the first three. these arguments are passed to the new dialog and placed in an array stored in the new window's arguments property. you can pass as many arguments as you wish. this is a convenient way to supply default values to the fields in the dialog. var somefile=document.getelementbyid('enterfile').value; window.opendialog("chrome://findfile/content/showdetails.xul","showmore", "chrome",somefile); in this example the dialog showdetails.xul is displayed. it's passed one argument, somefile, which was taken from the value of an element with the id enterfile. in a script used b...
...privilege. this means it will not work on remote sites; for those, use window.open() instead. the dialog element the dialog element should be used in place of the window element when creating a dialog. it provides the useful ability to construct up to four buttons along the bottom of the dialog forok,cancel, and so on. you do not need to include the xul for each button; however, you do need to supply code to perform the appropriate tasks when the user presses each button. this mechanism is necessary because different platforms have a specific order in which the buttons appear. example dialog source view <?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/keyma...
Focus and Selection - Archive of obsolete content
the user presses tab or shift+tab. for textboxes, a special attribute, focused is added whenever the element has the focus. you can check for the presence of this attribute to determine if the element has the focus, either from a script or within a style sheet. it will have the value true if the textbox has the focus and, if the textbox does not have the focus, the attribute will not be present. suppose you wanted to move the focus from where it currently is, to the next place the browser thinks it should be. a user typically does this by hitting the "tab" key. you can do this anywhere you have a xul browser document by simply: document.commanddispatcher.advancefocus(); in fact, the commanddispatcher simply implements the nsidomxulcommanddispatcher interface. this interface also provi...
...ll fit in the textbox. the change event is similar in that it fires only when the field is changed. however it only fires once the textbox loses the focus, thus, only once per set of changes. text selection when working with a textbox, you may wish to retrieve not the entire contents of a field but only what the user has selected. or, you may wish to change the current selection. xul textboxes support a way to retrieve and modify the selection. the simplest one is to select all of the text in a textbox. this involves using the select method of the textbox. tbox.select(); however, you may wish to select only part of the text. to do this you can use the setselectionrange function. it takes two parameters, the first is the starting character and the second is the character after the last one...
Tree View Details - Archive of obsolete content
t possibly be. imagine a situation where a row had subrows and those subrows had child rows of their own and several are open. it could take a while in some implementations to determine what the next sibling's row index would be in such a case. example of hierarchical custom view let's put this together into a simple example that takes an array and constructs a tree from it. this tree will only support a single parent level with an inner child level, but it could be extended to support additional levels without too much effort. we'll examine it piece by piece. <window onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="elementlist" flex="1"> <treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> ...
... then, we scan along the rows until we come to one that is at the same level. all those that have a higher level will need to be removed, but a row at the same level will be the next container which should not be removed. finally, we use the splice function to remove the rows from the visibledata array and call the rowcountchanged function to redraw the tree. when deleting rows, you will need to supply a negative count of the number of rows to delete. whether opening or closing a row, we need to tell the tree to repaint the twisty in the new state. the easiest way to do this is to invalidate the row. complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. they are add...
Using Visual Studio as your XUL IDE - Archive of obsolete content
r window element uses the correct xul namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul. 3. xbl if you are writing your own elements in xbl, you can download a xbl schema from mozilla.doslash.org/xblschema. grab the xsd version and add it in the same way, you added the xul schema. to combine both, you can also add your own xbl elements to the xul schema to get autocompletion-support and validation for those in your xul files. mihailo posted some instructions in this codeplex discussion. 4. visual assist and file extensions since version 10.5, visual assist supports javascript and xml. as it does not work out of the box with unknown file extensions (like .xul, .xbl and .jsm), you have to do some registry tricks, so that va knows how to treat these file types. all va opt...
...tities that are declared in this file. 5.2 text preprocessor the mozilla build system includes a text preprocessor. as preprocessor directives are not valid xml, visual studio will mark them as errors in your xul files. 5.3 javascript related you will get validation errors for javascript code whenever using the keywords "const" and "let". these keywords are mozilla-specific at the moment. vs just supports ecmascript 3rd edition and thus doesn't know these keywords. ...
XULBrowserWindow - Archive of obsolete content
see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. ...
...see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. ...
button - Archive of obsolete content
ose the menu. menu-button you can also use the value menu-button to create a button with a menu. unlike the menu type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed. panel similar to the menu type, this opens a popup. place a panel element inside the button. panel elements are popups that support any type of content. radio the button acts like a radio button. only one button in the group can be on a once. repeat this button will fire its command event repeatedly while the mouse button is held down. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a valu...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
dialog - Archive of obsolete content
with the buttonlabelextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma). warning: if the accept and cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply. if it is set to true any changes to settings are supposed to be applied immediately. the accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close the dialog in this situation (windows and linux) or might be hidden, too (mac os). the default setting of browser.preferences.instantapply currently is true on linux and mac os and false on windows (which however might or might not change...
..., focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata acceptdialog() return type: no return value accepts the dialog and closes it, similar ...
editor - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a frame which is expected to contain an editable document. set the value of the editortype attribute to html to create an editor document. mozilla provides two types of editors, the html editor and the plaintext editor. the editor does not provide any editing user interface; you would supply that yourself. however, text editing, image resizing, and table row and cell editing capabilities are provided. if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method. to specify the document to load in the editor use the src attribute. however, an issue is that if you specify the src attribute initially on the editor tag in the xul file, the documen...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
grid - Archive of obsolete content
Archive › Mozilla › XUL › grid
"/> <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, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, me...
... ...
iframe - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an inner frame that works much like the html <iframe> element. the src attribute can be used to specify the content of the frame. this content is a separate document. the children of the iframe are ignored. currently, xul iframes running in remote processes are not supported. if you want to run content in a remote process, use a xul browser element. warning: when used in chrome-privileged documents (either html or xul) such as firefox addons, the contents of the frame may have the same permissions as firefox itself. this can be a serious security vulnerability, for example if you use src="http://...". when used in this case, please see displaying web content in an extension without security...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related nsiaccessibleprovider ...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
atforms that do not have them. shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super or hyper key on linux. this shouldn't be specified directly because it may conflict with system wide shortcut key. accel: the key used for keyboard shortcuts on the user's platform, which is control on windows and linux, and command on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in ...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata details on key, keycode, and modifiers attributes for example, consider the following key: <ke...
menupopup - Archive of obsolete content
...
...nd y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location. anchor the popup may be either anchored to another node or opened freely. to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: bef...
preference - Archive of obsolete content
e nsiprefbranch apis regardless of the instantapply mode in effect). methods reset() return type: no return value resets the preference to its default value. for a textbox it also clears the undo transaction list (gecko 1.9). type getelementvalue(in domelement element); retrieves the value that should be written to preferences based on the current state of the supplied element. this function calls onsynctopreference. boolean iselementeditable(in domelement element) returns true, if the given element is "editable" (see below). void setelementvalue(in domelement element); initializes the supplied element from the value stored in the preference. this function calls onsyncfrompreference. void updateelements(); update all elements that observe this prefer...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata events change when a preference value changes, an onchange/change event is fired on the <pre...
richlistitem - Archive of obsolete content
accessible type: nsiaccessible returns the accessibility object for the element. control type: element id gets and sets the value of the control attribute. disabled type: boolean gets and sets the value of the disabled attribute. label type: string gets the concatentation of text from any child label elements. does not support setting label values. use the child elements directly to set label text. searchlabel type: string gets and sets the value of the searchlabel attribute. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox ...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
stringbundle - Archive of obsolete content
gs type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumeration contains nsipropertyelement objects. methods getformattedstring( key, strarray ) return type: string looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. alternatively, numbered indices of the format %n$s (e.g. %1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. if you need to handle substitutions involving plurals, take a look at localization and plurals. getstring( key ) return type: string returns the string with the given key name from the string bundle. inherited methods adde...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul property files ...
tabbrowser - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata addprogresslistener( listener ) return type: no return value add a progress...
...tain a uri property for the url of the page to load. a referreruri property may also be optionally used to set the referrer page. this method returns an array of the session history objects for the tabs that were removed. selecttabatindex( index, event ) return type: no return value selects the tab at the given index. index values may be positive or negative. if the event argument is supplied, the default event handling will be prevented and propagation stopped. seticon( atab, auri ) return type: no return value sets the specified tab's favicon to the image specified by auri. see geticon to get the current icon. showonlythesetabs( atabs ) return type: no return value makes all tabs in the atabs array visible, and all other tabs hidden. stop() return ...
toolbar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container which typically contains a row of buttons. it is a type of box that defaults to horizontal orientation. it can be collapsed with a grippy when the toolbar is placed inside a toolbox. the toolbar should always have an id attribute. note: gecko 2.0 adds support for external toolbars. these are toolbars that are not children of a toolbox element. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the chromeclass-toolbar class may be used to create a toolbar where its visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the specified resource...
...attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes chromeclass-toolbar when this class is used, the toolbar will be hid...
tooltip - Archive of obsolete content
...
...and y have the value -1 the call will realign the popup with its anchor node. openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location. anchor the popup may be either anchored to another node or opened freely. to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: bef...
wizard - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata « xul reference home advance( pageid ) return type: no return value call this method...
...setattributenode(), setattributenodens(), setattributens(), setuserdata « xul reference home advance( pageid ) return type: no return value call this method to go to the next page. this is equivalent to pressing the next button. the canadvance property must be set to true for the page to be changed. the pageid argument allows you to specify the index of the page to which to jump. supply null as the argument to go to the next page in the sequence. cancel() return type: no return value call this method to cancel and close the wizard. getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type. getpagebyid( pageid ) return type: wizardpage element returns the wizardpage element corresponding to the spec...
Opening a Link in the Default Browser - Archive of obsolete content
toopen = ioservice.newuri("http://www.example.com/", null, null); var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); // now, open it! extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application. ...
... .getservice(components.interfaces.nsiexternalprotocolservice); // now, open it! extps.loaduri(uritoopen, null); by default, the external protocol service will warn the user about opening the link in another application. to suppress this warning for particular protocols that are safe to open in the default application, you must set default prefs (thunderbird sets the following prefs): // suppress external-load warning for standard browser schemes pref("network.protocol-handler.warn-external.http", false); pref("network.protocol-handler.warn-external.https", false); pref("network.protocol-handler.warn-external.ftp", false); you can also check whether an external handler for a scheme exists. this is how you do it: var extps = components.classes["@mozilla.org/uriloader/external-proto...
calICalendarViewController - Archive of obsolete content
ntroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendarview is included. calendar/base/public/calicalendarviewcontroller.idlscriptable please add a summary to this article. ...
...to the user regarding the deleting of recurring caliitems, in the case where aoccurrence is a single occurrence of a recurring caliitem. ...
2006-09-22 - Archive of obsolete content
authors dean woodside sherman fernandes ...
... authors dean woodside sherman fernandes ...
NPN_SetValueForURL - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary allows a plugin to change the stored information associated with a url, in particular its cookies. (while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the ty...
...nperror npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the type of information to be changed. the only supported type is npnurlvcookie. url the url for which to change information. value the new associated information for the url. note: the value may have internal null bytes and may not be null-terminated. len the length of the value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. de...
NPAPI plugin reference - Archive of obsolete content
n api this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. np_getmimedescription np_getmimedescription returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. np_getvalue allows the browser to query the plug-in for information. np_initialize provides global initialization for a plug-in. np_port contains information required by the window field of an npwindow structure. np_shutdown provides global ...
...lemented by browsers. this call is used to inform the browser of variable information controlled by the plugin. npn_setvalueforurl allows a plugin to change the stored information associated with a url, in particular its cookies. (while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) npn_status lets a plug-in display a message on the browser's status line. npn_useragent returns the browser's user agent field. this can be used to handle variations in different browsers (or versions thereof) when implementing your plug-in. npn_utf8fromidentifier returns the utf-8 string corresponding to the given string identifier. npn_version lets plugins obtain version informa...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
place the plugin into the plugins directory, or place it into your own directory and modify the windows registry to let firefox know where to find the plugin. the downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin. as of firefox 3 (and any gecko 1.9 based application) the use of install.js scripts is no longer supported and plugins must either be shipped as an executable installer or in a bundle as described here. bundle structure toolkit bundles can be used for all add-ons including extensions, themes and plugins. plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file cont...
...o a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc-gcc3/ plugins/ libplugin.dylib more specific information can be found in the platform-specific subdirectories documentation. gecko 2.0 (firefox 4) and later gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for platform-specific subdirectories. instead, you need to place the different plugin libraries into the plugins directory. for example: plugins/ libplugin.so libplugin.dylib install manifest the install manifest describes the plugin to the user. for a plugin the manifest only needs to be very simple: <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozil...
Plugins - Archive of obsolete content
flash usage is also set to be phased out in the future. note: plugins are now a legacy technology. they are not available on most mobile devices. mozilla encourages website developers to avoid using plugins wherever possible and use standard web apis instead. if there are plugin features which are not available in the web platform, we encourage developers to post their use cases to mozilla.dev.platform project list, so that mozilla can prioritize web platform work to make those use cases possible. for more information about plugin roadmap, see non-archived plugin information. ...
...the firefox click-to-activate feature. scripting plugins (npruntime) this reference describes the new cross-browser npapi extensions that let plugins be scriptable and also let them access the script objects in the browser. shipping a plugin as a toolkit bundle plugins can be shipped as a toolkit bundle, allowing a user to easily install, uninstall and manage their personal plugins. supporting private browsing in plugins firefox 3.5 introduced support for private browsing; learn how to make your plugin respect the user's privacy wishes. multi-process plugin architecture how firefox loads plugins into a separate process. firefox 3.6.4 introduced out-of-process plugins which execute in a separate process so that a crashing plugin does not crash the browser. logging and debuggi...
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
rss has long had the <description> element that can be used to include the contents of an <item>. for example, you could use it to include the entire contents of a blog post; or just a summary of it. however, the rss <description> element is only suppose to be used to includeplain text data. this obviously limits you. and since many peoplewrite in html information and formatting is lost with the rss <description> element. however, it has become common practice to putxml escaped html data in it. (even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. then the <description> would be: <description>this is &lt;b&gt;bold&lt;/b&gt;.</description> note that the "<" has been turned into "&lt;". and the ">" has been turned into "&gt;". this greatl...
...e of contents but is necessary since certain characters are no allowed in xml. xml does however have the cdata convention. you can put (almost) whatever you want in a cdata section. including "<" and ">" without having to escape them. using the example above we'd have: <description><![cdata[this is <b>bold</b>.]]></description> this helps reduce the bloat. however, the <description> is not suppose to be used for any of this. it is only suppose to be used to includeplain text. but rss still leaves us without a way to include html contents. the rss content module fills this gap. note: do not put anything butplain text into the rss <description> element. although it has become common practice to use the rss <description> element and put non-plain text data in it. it is not actually allo...
SAX - Archive of obsolete content
below is an exam...
...below is an example of parsing from a string: xmlreader.parsefromstring("<f:a xmlns:f='g' d='1'><bbq/>...
.htaccess ( hypertext access ) - Archive of obsolete content
s stands for "hypertext access". a file with the htaccess file extension is an access configuration file for apache server. the .htaccess file configures the current directory with things like password protection, url rewrites & redirects, and more. file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highliting support for .htaccess files less. common application url redirects & rewrite: htaccess files are often used to redirect traffic to a web page to another or from traffic to a directory to another even between domains is possible. it's a fast and efficient way of redirecting traffic, because the redirect happens before the pages are served. redirects can be made on a temporary basis or permanently by...
...ort for .htaccess files less. common application url redirects & rewrite: htaccess files are often used to redirect traffic to a web page to another or from traffic to a directory to another even between domains is possible. it's a fast and efficient way of redirecting traffic, because the redirect happens before the pages are served. redirects can be made on a temporary basis or permanently by supplying the status codes. redirect 301 / http://example.com/ # redirect the traffic to the directory to example.com , permanent redirect redirect 302 / http://example.com/ # redirect the traffic to the directory to example.com , temporary redirect blocking : htaccess also facilitates blocking traffic based on ip and ip range, also, use to block bad bots, rippers, and referrers; ofte...
Building a Theme - Archive of obsolete content
--> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>29.0</em:minversion> <em:maxversion>39.*</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <em:name>my theme</em:name> <em:internalname>sample</em:internalname> <em:description>a ...
...r.png loads the file bar.png from the foo theme's skin section. when you load content using a chrome uri, firefox uses the chrome registry to translate these uris into the actual source files on disk (or in jar packages). create a chrome manifest the chrome manifest is the file that maps these chrome uris to your theme's files. for more information on chrome manifests and the properties they support, see the chrome manifest reference. open the file called chrome.manifest that you created alongside the chrome directory at the root of your extension's source folder hierarchy. add in this code: skin browser sample chrome/browser/ skin communicator sample chrome/communicator/ skin global sample chrome/global/ skin mozapps sample chrome/mozap...
Theme changes in Firefox 3.5 - Archive of obsolete content
ffected element. browser.xul bug 463189 added a new attribute on the xul window element of browser.xul named browsingmode. the value of this attribute is normal when the private browsing mode is inactive, and private when it's active. this attribute can be used to style different parts of the browser window inside the private browsing mode. see this blog post for an example. ...
... see private browsing for theme designers for details. ...
:-moz-system-metric() - Archive of obsolete content
efox 58, this pseudo-class is no longer available to web content — it is only available internally (e.g. to xul / chrome code). see bug 1396066 for more details. ...
...this will exclude windows classic themes as well as third-party themes. formal syntax syntax...
::-ms-check - Archive of obsolete content
allowable properties only the following css properties can be used in a rule with ::-ms-check in its selector. other properties are ignored. ...
... the button is checked. */ color: green; /* this will make the checkmark green when the button is checked. */ } result below is an example for you to try. the screenshot to the left shows what will happen when you check the buttons if you don't have access to internet explorer or edge. screenshotlive sample specifications not part of any specification. browser compatibility historically supported in internet explorer and edge before version 79. ...
E4X for templating - Archive of obsolete content
security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user input within inline javascript; may be combined with escape function above as well if (typeof s === 'string') { return s.replace(/"/g, '&quot;').rep...
... ...
E4X - Archive of obsolete content
Archive › Web › E4X
ed since it could be removed at any time. try to avoid using it. warning: e4x is obsolete. it has been disabled by default for webpages (content) in firefox 17, disabled by default for chrome in firefox 20, and has been removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized by ecma international in ecma-357 standard (currently in its second edition, decemb...
...ent hiding trick, and cdata sections (<![cdata[...]]>) are not parsed as cdata literals (which leads to a js syntax error in html since html's <script> element produces an implicit cdata section, and therefore cannot contain explicit cdata sections). someone verify the above known bugs and limitations it is not currently possible to access a dom object through e4x (bug 270553). e4x doesn't support parsing xml declaration. <?xml version=...?>) (see bug 336551). you may get syntaxerror "xml is a reserved identifier" (despite the xml being in a string). workaround: var response = xmlhttprequest.responsetext; // bug 270553 response = response.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551 var e4x = new xml(response); resources e4x tutorial processing ...
Date.getVarDate() - Archive of obsolete content
warning: this method is supported in internet explorer only. the getvardate method returns a vt_date value from a date object. syntax dateobj.getvardate() parameters the required dateobj reference is a date object. return value returns a vt_date value. remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that accept and return date values in vt_date format. these include objects in visual basic and visual basic scripting edition (vbscript). the actual format of the returned value depends on regional settings. ...
...te object. return value returns a vt_date value. remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that accept and return date values in vt_date format. these include objects in visual basic and visual basic scripting edition (vbscript). the actual format of the returned value depends on regional settings. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards. not supported in windows 8.x store apps. applies to: date object see also date.getdate() date.parse() ...
Debug - Archive of obsolete content
llback stack associated with a previously specified asynchronous operation has completed. debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation. debug.mstraceasyncoperationcompleted indicates that an asynchronous operation has completed. debug.mstraceasyncoperationstarting initiates a trace for an asynchronous operation. debug.msupdateasynccallbackrelation updates the relationship status between a synchronous work item and the associated asynchronous operation. debug.write sends strings to the script debugger. debug.writeln sends strings to the script debugger, followed by a newline character. examples print the value of a variable this example uses the write function to display the value of the variable. var coun...
...nous work item and the associated asynchronous operation. debug.write sends strings to the script debugger. debug.writeln sends strings to the script debugger, followed by a newline character. examples print the value of a variable this example uses the write function to display the value of the variable. var counter = 42; debug.write("the value of counter is " + counter); 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. also supported in store apps (windows 8 and windows phone 8.1). ...
Enumerator - Archive of obsolete content
the enumerator object enables enumeration of items in a collection. syntax enumobj = new enumerator([collection]) parameters enumobj the variable name to which the enumerator object is assigned. collection optional any collection object. remarks collections differ from arrays in that the members of a collection are not directly accessible. instead of using indexes, as you would with arrays, you can move the current item pointer only to the first or next element of a collection. ...
...the enumerator object has no properties. methods enumerator.atend returns a boolean value indicating if the enumerator is at the end of the collection. enumerator.item returns the current item in the collection. enumerator.movefirst resets the current item in the collection to the first item. enumerator.movenext moves the current item to the next item in the collection. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards. not supported in windows 8.x store apps. ...
Error.description - Archive of obsolete content
the error.description property returns or sets the descriptive string associated with a specific error. syntax object .description [= stringexpression] parameters object required. any instance of an error object. stringexpression optional. a string expression containing a description of the error. remarks the description property contains the error message string associated with a specific error. use the value contained in this property to alert a user to an error. ...
...e description property. try { // cause an error: x = y } catch(e) { // prints "[object error]": document.write(e) document.write (" "); // prints 5009: document.write((e.number & 0xffff)) document.write (" "); // prints "'y' is undefined": document.write(e.description); document.write (" "); // prints "'y' is undefined": document.write(e.message) } 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. also supported in store apps (windows 8 and windows phone 8.1). applies to: error object see also number property (error) message property (error) name prope...
Error.number - Archive of obsolete content
the error.number property returns or sets the numeric value associated with a specific error. the error object's default property is number. syntax object .number [= errornumber] parameters object any instance of the error object. errornumber an integer representing an error. remarks an error number is a 32-bit value. the upper 16-bit word is the facility code, and the lower word is the error code. to determine the error code, use the & (bitwise and) operator to combine the number property with the hexadecimal number 0xffff. ...
...: "); document.write (e.number & 0xffff) document.write ("<br />"); document.write ("facility code: ") document.write(e.number>>16 & 0x1fff) document.write ("<br />"); document.write ("error message: ") document.write (e.message) } example the output of this code is as follows. error code: 5009 facility code: 10 error message: 'y' is undefined 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. also supported in store apps (windows 8 and windows phone 8.1). applies to: error object see also description property (error) message property (error) name ...
ScriptEngineBuildVersion - Archive of obsolete content
non-standard. do not use! ...
...sion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginebuildversion function: if(window.scriptenginebuildversion) { console.log(window.scriptenginebuildversion()); } // 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. also supported in store apps (windows 8 and windows phone 8.1). scriptengine function scriptenginemajorversion function scriptengineminorversion function ...
ScriptEngineMajorVersion - Archive of obsolete content
non-standard. do not use! ...
...enginemajorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginemajorversion function: if (window.scriptenginemajorversion) { console.log(window.scriptengine()); } output: <current major 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. also supported in store apps (windows 8 and windows phone 8.1). ...
ScriptEngineMinorVersion - Archive of obsolete content
non-standard. do not use! ...
...ion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptengineminorversion function. if (window.scriptengineminorversion) { console.log(window.scriptengineminorversion()); } //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. also supported in store apps (windows 8 and windows phone 8.1). ...
VBArray - Archive of obsolete content
the vbarray object provides access to visual basic safe arrays. syntax varname = new vbarray(safearray) parameters varname the variable name to which the vbarray is assigned. safearray a vbarray value. remarks vbarrays are read-only, and cannot be created directly. the safearray argument must have obtained a vbarray value before being passed to the vbarray constructor. this can only be done by retrieving the value from an existing activex or other object. vbarrays can have multiple dimensions. the indices of each dimension can be different. ...
...ns returns the number of dimensions in a vbarray. vbarray.getitem returns the item at the specified location. vbarray.lbound returns the lowest index value used in the specified dimension of a vbarray. vbarray.toarray returns a standard javascript array converted from a vbarray. vbarray.ubound returns the highest index value used in the specified dimension of the vbarray. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, and internet explorer 10 standards. not supported in windows 8.x store apps. ...
New in JavaScript 1.5 - Archive of obsolete content
can compare javascript 1.5 to jscript version 5.5 and internet explorer 5.5, which was released in july 2000. the corresponding ecma standard is ecma-262 edition 3 (from december 1999). new features in javascript 1.5 number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() const is now a reserved word. multiple catch clauses in a try...catch statement are supported. javascript authors can now add getters and setters to their objects. changed functionality in javascript 1.5 runtime errors are now reported as exceptions. regular expression changes: quantifiers — +, *, ? and {} — can now be followed by a ? to force them to be non-greedy. non-capturing parentheses, (?:x) can be used instead of capturing parentheses, (x). when non-captu...
...are now reported as exceptions. regular expression changes: quantifiers — +, *, ? and {} — can now be followed by a ? to force them to be non-greedy. non-capturing parentheses, (?:x) can be used instead of capturing parentheses, (x). when non-capturing parentheses are used, matched subexpressions are not available as back-references. positive and negative lookahead assertions are supported. both assert a match depending on what follows the string being matched. the m flag has been added to specify that the regular expression should match over multiple lines. functions can now be declared inside an if clause. functions can now be declared inside an expression. ...
New in JavaScript 1.8.5 - Archive of obsolete content
s function in the context provided (with a given sequence of arguments). bug 429507 new ecmascript5 features get and set operators now allows the identifier to be numeric or a string. bug 520696 function.apply() can accept any array-like object as the arguments list, instead of only true arrays. strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its tostring() method. other standardization work various non-standard syntaxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed. these were all pretty es...
...taxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed. these were all pretty esoteric and rarely used; if this affects you, see this blog post for details. new objects object description old proxy api offers support for creating object and function proxies that enable meta-programming in javascript. changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601 format date strings. global objects made read only: the nan, infinity, and undefined global objects ...
New in JavaScript - Archive of obsolete content
this chapter contains information about javascript's version history and implementation status for mozilla/spidermonkey-based javascript applications, such as firefox. ecmascript versions language resources learn more about the ecmascript standards on which the javascript language is based on. ecmascript 5 support implementation status for the current standard ecma-262 edition 5.1 in mozilla-based engines and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ecmascript next support implementation status for upcoming ecma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning ...
...ped in firefox 2. released in october 2006. includes generators, iterators, array comprehensions, let expressions, and destructuring assignment. javascript 1.8 version shipped in firefox 3. released in june 2008. includes expression closures, generator expressions and array.reduce() javascript 1.8.1 version shipped in firefox 3.5. released on june 30, 2009. includes the tracemonkey jit and supports native json. javascript 1.8.2 version shipped in firefox 3.6. released june 22, 2009. includes only minor changes. javascript 1.8.5 version shipped in firefox 4. released july 27, 2010. includes many new features for ecma-262 edition 5 compliance. this is the last javascript version. ...
Archived JavaScript Reference - Archive of obsolete content
e bytelength of the oldbuffer is used. this operation leaves oldbuffer in a detached state.date.prototype.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting. intl.datetimeformat is an alternative to format dates in a standards-compliant way. see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties. for each distinct property, a specified statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standard isgenerator() method use...
...res legacy generator functions with the specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression. ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
e of sql data stores in javascript. the sample script in listing 1 could be factored out to it’s own function to retrieve the set of employee information, or abstracted further into a more generic data handler class. next we’ll take a look at another powerful feature in rhino, e4x processing. e4x (ecmascript for xml) is an extension of javascript which provides direct support for xml, greatly simplifying the process of consuming xml via javascript. rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java. listing 3 below details a script used to process an rss feed from the mozilla website. importpackage( java.net ); // connect to the remote resource var u = new url( "http://www.mozilla.org/news.rdf" ); var c = u...
...)", [ name,...
background-size - Archive of obsolete content
sistency. feel free to put it inside, nothing is set in stone. konqueror's global market share is 0.05%, (< 5% of linux users). given the fact that this reference has serious shortcomings in many places and few contributors, i think spending much time here is not effective. people especially interested in this browser are welcome to contribute. it's hard to get reliable information about its css support without having this browser (read: multiple versions of this browser) installed. are you able and willing to do that for all css properties? if so, feel free to change the en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior. [i assume it's the same as sa...
...rted a webkit patch into khtml. but we need facts, rather than assumptions.] btw, some time ago i'v listed opera in the property template table and removed netscape because netscape is gecko based and opera has a global market share of > 2% (> 40% in some european countries). user:jürgen jeka 2009-08-04 <hr> is there anyway to have the -moz-border-image only apply if -moz-background-size is not supported? i'm guessing not, just asking because having both rules in for 3.6 creates a strange effect: -moz-border-image gets inherited by every element on the page user:robertc 2009-08-08 -moz-border-image should not inherit. some example code? user:jürgen jeka 2009-08-09 ok, here's a page with both rules - the css is derived from the code on the page here, this is what it looks like in 3.6a2pre...
XForms Repeat Element - Archive of obsolete content
will serve as the context node for any relative xpath expressions in that set of repeated markup. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. node set binding special startindex - optional 1-based initial value of the repeat index. the default value is 1. number - isn't supported type restrictions the repeat element can be bound to a nodeset. representations the repeat element doesn't have a visual representation. however, it can influence the layout of generated controls depending on its appearance attribute. default layout each generated control set is placed vertically. compact layout each generated control set is placed horizontally. occurs when the...
...dex repeat-number additionally, when using xforms action setindex, its repeat attribute (which contains an idref) can point to any element carrying these repeat attributes. similarly, the index function can be used with the repeating structures created via these repeat-attributes. the id of the element that contains the repeat attributes can be used as the argument to index. note, we don't fully support attribute-based repeats. there are a number of errors that may occur, especially when these attributes are used with html:table. be sure to test your form carefully. example <xforms:model id="i_model"> <xforms:instance xmlns=""> <data xmlns:html="http://www.w3.org/1999/xhtml" xmlns=""> <val id="1"> <nest>nest 1.1</nest> <nest>nest 1.2</nest> </val> <...
XForms - Archive of obsolete content
see the html forms guide for approaches to creating forms in html5. xforms essentials an online book giving you a guided tour of xforms. xforms were envisioned as the future of online forms as envisioned by the w3c. ...
...at xforms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author forms so that they can be displayed by a wide variety of devices. xforms is a w3c specification. xforms tutorial and cookbook xforms in wikibook format - over 50 examples tested with firefox. xforms support can be added to firefox and seamonkey by installing the mozilla xforms extension. this extension, while supporting a significant subset of the xforms 1.0 and 1.1 candidate recommendations, is not actively maintained any more since about 2010. the last official release has been done for firefox 3.6 and is available for download on addons.mozilla.org. for more details about the future of the m...
Correctly Using Titles With External Stylesheets - Archive of obsolete content
stylesheet always affects a document, or if it is only used under certain circumstances. there are three kinds of stylesheets that are possible: persistent, preferred, and alternate stylesheets. authors will be most familiar with persistent stylesheets, of which any number may be applied to a document at once. a persistent stylesheet is one which has no title attribute and a value of stylesheet supplied for the rel attribute. a document may refer to one or more persistent stylesheets, all of which are used in the presentation of the document. a preferred stylesheet, on the other hand, is one that has a value of stylesheet supplied for the rel attribute, and any value at all for the title attribute. here are two examples: <link type="text/css" rel="stylesheet" title="basic styles" href="ba...
...k type="text/css" rel="stylesheet" title="basic styles" href="basic.css" /> <link type="text/css" rel="stylesheet" title="fish and boats" href="ocean.css" /> according to the html 4.01 specification, only one of the preferred stylesheets can be used at a time. therefore, given the above example, only one of the two preferred stylesheets will be applied to the document. the specification does not supply a procedure to decide which one should be used, so user agents are free to make whatever choice they like. therefore, any link to a stylesheet that includes a title attribute cannot be persistent, and is likely to be ignored by the web browser. any link element referring to a stylesheet with a title attribute must be either preferred or alternate, depending on the value of the rel attribute. ...
RDF in Mozilla FAQ - Archive of obsolete content
enerally a bad idea, because your ui will completely lock up! remote.refresh(false); // note that ds will load asynchronously, so assertions will not // be immediately available you may decide that you need to "manually" create an rdf/xml datasource if you want to force it to load synchronously. how do i reload an rdf/xml datasource? you can force an rdf/xml datasource (or any datasource that supports nsirdfremotedatasource) to reload using the refresh() method of nsirdfremotedatasource. refresh() takes a single parameter that indicates whether you'd like it to perform its operation synchronously ("blocking") or asynchrounously ("non-blocking"). you should never do a synchronous load unless you really know what you're doing: this will freeze the ui until the load completes! how can i tel...
...signed scripts, and are runnable from http directly. see also duplicates.rdf (for live rdf feed from mozilla) alongside duplicates.xul. note that for these to work, you have to relax mozilla's security model. to do this, add the following line to your preferences file. (shut down mozilla first since it overwrites your preferences file when you quit.) user_pref("signed.applets.codebase_principal_support", true); mozilla will ask you if you want to grant the scripts in duplicates.xul permission to access xpconnect; respond in the affirmative. currently, mozilla does not allow unprivileged access to the rdf interfaces and services; see bug 122846 for details. please mail danbri, mozilla-rdf or waterson with urls if you are aware of other examples to which we ought to link! notes see al...
Bounding volume collision detection with THREE.js - Game development
which checks whether the box3 fully wraps another one. sphere vs. sphere in a similar fashion as before, there is a sphere.intersectssphere method to perform this test. knotbsphere.intersectssphere(othersphere); sphere vs. box3 unfortunately this test is not implemented in three.js, but we can patch sphere to implement a sphere vs. aabb intersection algorithm. ...
... debug collisions by rendering the meshes that boxhelper creates. by default they are created with a linebasicmaterial material (a three.js material for drawing wireframe-style geometries). the main disadvantage is that it only creates box bounding volumes, so if you need spheres vs aabb tests you need to create your own sphere objects. to use it, we need to create a new boxhelper instance and supply the geometry and — optionally — a color that will be used for the wireframe material. we also need to add the newly created object to the three.js scene in order to render it. we assume our scene variable to be simply called scene. var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new three.meshnormalmaterial({}) ); var knotboxhelper = new three.boxhelper(knot, 0x00ff0...
Building up a basic demo with A-Frame - Game development
lopment world, but it targets web developers with a familiar markup structure, manipulable with javascript. the end result is 3d web experiences, which are vr-enabled by default. environment setup let's start by setting up an environment to create something with a-frame. we'll then build up a demo and run it. you should start off by: making sure you are using a modern browser with good webgl support (and webxr support if you have available vr or ar hardware) such as the latest firefox or chrome — download firefox nightly or chrome (v54 or higher). (optional) set up a vr device such as oculus rift or google cardboard. create a new directory to store your project in. save a copy of the latest a-frame javascript library file inside your directory (check the github repository for latest...
...o check it out on github. that was easier than you thought, right? a-frame targets web developers by offering easy to use web markup and all the advantages that brings, such as javascript manipulation. it is easy to start with, but also provides a powerful api for advanced concepts, as well as dealing with cross browser differences and suchlike. the community is growing, just like the number of supported vr devices — it's a great time to start experimenting with such frameworks. ...
Building up a basic demo with Three.js - Game development
t is one of the most popular webgl libraries, and it is easy to get started with. we are not trying to say it is better than any other webgl library available, and you should feel free to try another library, such as copperlicht, glge, or playcanvas. environment setup to start developing with three.js, you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. open the three.js documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: three.js demo</ti...
...e a few different renderers: webgl is the default, and others you can use are canvas, svg, css, and dom. they differ in how everything is rendered, so the webgl implementation will implement differently than the css one. despite the variety of ways they achieve the goal, the experience will look the same for the user. thanks to this approach, a fallback can be used, if a desired technology is not supported by the browser. var renderer = new three.webglrenderer({antialias:true}); renderer.setsize(width, height); renderer.setclearcolor(0xdddddd, 1); document.body.appendchild(renderer.domelement); we are creating a new webgl renderer, setting its size to fit the whole available space on the screen, and appending the dom structure to the page. you might have noticed the antialias parameter in ...
Desktop gamepad controls - Game development
previous overview: control mechanisms next now we'll look at adding something extra — support for gamepad controls, via the gamepad api. it brings a console-like experience to your web games. the gamepad api gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the javascript code thanks to the browsers implementing such feature. an api exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. ...
...s a console-like experience to your web games. the gamepad api gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the javascript code thanks to the browsers implementing such feature. an api exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already quite good — around 63% global coverage, according to caniuse.com. the list of supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps3) should be suitable for web implementations. pure javascript approach let's think about implementing pure javascript gamepad controls i...
Mobile touch controls - Game development
he screen. touchmove is fired when they move the finger on the screen while touching it touchend is fired when the user stops touching the screen touchcancel is fired when a touch is cancelled, for example when the user moves their finger outside of the screen. note: the touch events reference article provides more examples and information. pure javascript demo let's implement the mobile support in a little demo available on github, so we can move the player's ship by touching the screen on a mobile device. we will use two events: touchstart and,touchmove both handled by one function. why? the function touchhandler will assign proper variables to the ship's position so that we can use it for both cases: when the player touches the screen but doesn't move it (touchstart), and when th...
...of the screen and is 80 pixels wide. the stick being pressed can be handled during the gameplay in the update function like so: if(this.stick.isdown) { // move the player } we can adjust the player's velocity based on the current angle of the stick and move him appropriately. summary that covers adding touch controls for mobile; in the next article we'll see how to add keyboard and mouse support. overview: control mechanisms next ...
Unconventional controls - Game development
javascript client for the leap motion controller and read the documentation there. if all else fails, there's also a gallery of working examples you can look at. to get the leap motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. when everything is installed and the controller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leanin...
...reference page for more details. makey makey if you want to go completely bananas you can use makey makey, a board that can turn anything into a controller — it's all about connecting real-world, conductive objects to a computer and using them as touch interfaces. check out the banana piano video, and be sure to visit the quick start guide for all the needed info. there's even a cylon.js-supported makey button functionality inspired by the makey makey board, so you can use the popular cylon robotics framework for your experiments with arduino or raspberry pi. connecting the boards and using them may look like this: var cylon = require('cylon'); cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyacm0' } }, devices: { makey: { driver: 'makey-butto...
Implementing game control mechanisms - Game development
ent in javascript right now, but it should be fairly easy to reuse the knowledge contained within these articles when building games in pure javascript or any other framework. if you're looking for a good introduction to phaser, then check the 2d breakout game using phaser tutorial. in the following articles we will show how to implement various different control mechanisms for captain rogers to support different platforms — from touch on mobile, through keyboard/mouse/gamepad on desktop, to more unconventional ones like tv remote, shouting to or waving your hand in front of the laptop, or squeezing bananas. setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game states, so we know what's happening where. the game's folder...
...wn boolean variable on every frame of the game. that should give you some understanding of the project structure. we'll be playing mostly with the mainmenu.js and game.js files, and we'll explain the code inside the create() and update() methods in much more detail in later articles. pure javascript demo there's also a small online demo with full source code available on github where the basic support for the control mechanisms described in the articles is implemented in pure javascript. it will be explained in the given articles themselves below, but you can play with it already, and use the code however you want for learning purposes. the articles javascript is the perfect choice for mobile gaming because of html5 being truly multiplatform; all of the following articles focus on the ap...
Square tilemaps implementation: Static maps - Game development
the basic information included in our tilemaps introduction article. the tile atlas a tilemap might use one or several atlases — or spritesheets — that contain all of the tile images. this is the atlas we will be using as an example, which features five different tiles: to draw a tile from the atlas into the canvas we make use of the drawimage() method in a canvas 2d context. ...
... the tilemap data structure to store that map data, we can use a plain object or a custom class. for the sake of simplicity, in the example code a plain object has been used. it contains the basic map properties: cols: the width of the map, in column...
Tiles and tilemaps overview - Game development
ile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor. some popular games that use this technique are super mario bros, pacman, zelda: link's awakening, starcraft, and sim city 2000. think about any game that uses regularly repeating squares of background, and you'll probably find it uses tilemaps. the tile atlas the most efficient way to store the tile images is in an atlas or spritesheet. this is simply all of the required tiles grouped together in a single image file. when it's time to draw a ti...
...ull) is needed to represent empty tiles. square tiles square-based tilemaps are the most simple implementation. a more generic case would be rectangular-based tilemaps — instead of square — but they are far less common. square tiles allow for two perspectives: top-down (like many rpg's or strategy games like warcraft 2 or final fantasy's world view.) side-view (like platformers such as super mario bros.) static tilemaps a tilemap can either fit into the visible screen area screen or be larger. in the first case, the tilemap is static — it doesn't need to be scrolled to be fully shown. this case is very common in arcade games like pacman, arkanoid, or sokoban. rendering static tilemaps is easy, and can be done with a nested loop iterating over columns and rows. a high-level al...
Techniques for game development - Game development
javascript can be compiled off the main thread and be cached for future game running, resulting in a significant performance improvement for your users. this article explains how. optimizing startup performance how to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device. using webrtc peer-to-peer data channels in addition to providing support for audio and video communication, webrtc lets you set up peer-to-peer data channels to exchange text or binary data actively between your players. this article explains what this can do for you, and shows how to use libraries that make this easy. efficient animation for web games this article covers techniques and advice for creating efficient animation for web games, with a slant towards ...
...port for audio and video communication, webrtc lets you set up peer-to-peer data channels to exchange text or binary data actively between your players. this article explains what this can do for you, and shows how to use libraries that make this easy. efficient animation for web games this article covers techniques and advice for creating efficient animation for web games, with a slant towards supporting lower end devices such as mobile phones. we touch on css transitions and css animations, and javascript loops involving window.requestanimationframe. audio for web games audio is an important part of any game — it adds feedback and atmosphere. web-based audio is maturing fast, but there are still many browser differences to negotiate. this article provides a detailed guide to implement...
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
the reason why polyfills are not used exclusively is for better functionality and better performance. native implementations of apis can do more and are faster than polyfills. ...
... the reason why polyfills are not used exclusively is for better functionality and better performance. native implementations of apis can do more and are faster than polyfills. ...
SVG - MDN Web Docs Glossary: Definitions of Web-related terms
based on an xml syntax, svg can be styled with css and made interactive using javascript. html5 now allows direct embedding of svg tags in an html document. ...
... based on an xml syntax, svg can be styled with css and made interactive using javascript. html5 now allows direct embedding of svg tags in an html document. ...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
etwork, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols. both ssl and tls are client / server protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. when a server and client communicate using tls, it ensures that no third party can eavesdrop or tamper with any message. ...
...ird party can eavesdrop or tamper with any message. all modern browsers support the tls protocol, requiring the server to provide a valid digital certificate confirming its identity in order to establish a secure connection. it is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates. note: tls 1.0 and 1.1 support will be removed from all major browsers in early 2020; you'll need to make sure your web server supports tls 1.2 or 1.3 going forward. from version 74 onwards, firefox will return a secure connection failed error when connecting to servers using the older tls versions (bug 1606734). ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
xml inclusions (xinclude) is a w3c recommendation to allow inclusion of xml more different sources in a more convenient fashion than xml external entities. when used in conjunction with xpointer (firefox supports a subset of it, and is used in the code sample below), xinclude can also target just specific portions of a document for inclusion. firefox does not support it natively, but the following function aims to allow its use with documents passed into it. code sample the following code aims to let <xi:include> and <xi:fallback> tags (the two elements in the language) with all of the attributes of <xi:include> be included in an xml document so as to be resolvable into a single xml document. (note that this has not been thoroughly tested for all circumstances and may not necessari...
...; break; } request.send(null); if((request.status === 200 || request.status === 0) && request[responsetype] !== null) { response = request[responsetype]; if (responsetype === 'responsexml') { // apply xpointer (only xpath1() subset is supported) var responsenodes; if (xpointer) { var xpathresult = response.evaluate( xpointer, response, null, ...
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
xlink is a w3c standard which is used to describe links between xml and xml or other documents. some its behaviors are left to the implementation to determine how to handle. simple xlinks are "supported" in firefox (at least in svg and mathml), though they do not work as links if one loads a plain xml document with xlinks and attempts to click on the relevant points in the xml tree. for those who may have found xlink 1.0 cumbersome for regular links, xlink 1.1 drops the need to specify xlink:type="simple" for simple links. xlink is used in svg, mathml, and other important standards. ...
...nts in the xml tree. for those who may have found xlink 1.0 cumbersome for regular links, xlink 1.1 drops the need to specify xlink:type="simple" for simple links. xlink is used in svg, mathml, and other important standards. specification xlink 1.0 xlink 1.1 (currently a working draft) see also xml in mozilla code snippets:getattributens - a wrapper for dealing with some browsers not supporting this dom method code snippets:xml:base function - a rough attempt to find a full xlink-based on an xlink:href attribute (or <xi:include href=>) and its or an ancestor's xml:base. ...
Accessible multimedia - Learn web development
blem, right? let's investigate. the problem with native html5 controls html5 video and audio instances even come with a set of inbuilt controls that allow you to control the media straight out of the box. for example (see native-controls.html source code and live): <audio controls> <source src="viper.mp3" type="audio/mp3"> <source src="viper.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio. here is a <a href="viper.mp3">link to the audio</a> instead.</p> </audio> <br> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> the controls attribute provides play/pause buttons, seek bar...
...mp4, and rabbit320.webm files and save them in a new directory on your hard drive. create a new file called main.js and save it in the same directory. first of all, let's look at the html for the video player, in the html: <section class="player"> <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> <div class="controls"> <button class="playpause">play</button> <button class="stop">stop</button> <button class="rwd">rwd</button> <button class="fwd">fwd</button> <div class="time">00:00</div> </div> </section> javascript basic setup we've inserted some simple control butto...
Advanced styling effects - Learn web development
nd modes, and filters. prerequisites: html basics (study introduction to html) and an idea of how css works (study css first steps.) objective: to get an idea about how to use some of the advanced styling effects available in modern browsers. box shadows box-shadow allows you to apply one or more drop shadows to an element's box. like text shadows, box shadows are supported pretty well across browsers, including ie9+ and edge. users of older ie versions might just have to cope with no shadows, so just test your designs to make sure your content is legible without them. you can find the examples in this section at box-shadow.html (see the source code too). a simple box shadow let's look at a simple example to get things started. first, some html: <article c...
...background images and colors set on a single element. mix-blend-mode, which blends together the element it is set on with elements it is overlapping — both background and content. you can find a lot more examples than are available here in our blend-modes.html example page (see source code), and on the <blend-mode> reference page. note: blend modes are also very new, and slightly less well supported than filters. there is no support as yet in edge, and safari only supports some of the blend mode options. background-blend-mode again, let's look at some examples so we can understand this better. first, background-blend-mode — here we'll show a couple of simple <div>s, so you can compare the original with the blended version: <div> </div> <div class="multiply"> </div> now some css ...
Pseudo-classes and pseudo-elements - Learn web development
the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements. there are a large number of these, and they often serve quite specific purposes. once you know how to use them, you can look at the list to see if there is something which works for the task you are trying to achieve. once again the relevant mdn page for each selector is helpful in explaining browser support. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the pseudo-class and pseudo-element selectors. what is a pseudo-class? a pseudo-class is a selector that selects elements that are in ...
... what is a pseudo-element? pseudo-elements behave in a similar way, however they act as if you had added a whole new html element into the markup, rather than applying a class to existing elements. pseudo-elements start with a double colon ::. ::pseudo-element-name note: some early pseudo-elements used the single colon syntax, so you may sometimes see this in code or examples. modern browsers support the early pseudo-elements with single- or double-colon syntax for backwards compatibility. for example, if you wanted to select the first line of a paragraph you could wrap it in a <span> element and use an element selector; however, that would fail if the number of words you had wrapped were longer or shorter than the parent element's width. as we tend not to know how many words will fit o...
CSS selectors - Learn web development
ected by the selector are referred to as the subject of the selector. in earlier articles you met some different selectors, and learned that there are selectors that target the document in different ways — for example by selecting an element such as h1, or a class such as .special. in css, selectors are defined in the css selectors specification; like any other part of css they need to have support in browsers for them to work. the majority of selectors that you will come across are defined in the level 3 selectors specification, which is a mature specification, therefore you will find excellent browser support for these selectors. selector lists if you have more than one thing which uses the same css then the individual selectors can be combined into a selector list so that the rule ...
... finding out about type, class, and id selectors. previous overview: building blocks next reference table of selectors the below table gives you an overview of the selectors you have available to use, along with links to the pages in this guide which will show you how to use each type of selector. i have also included a link to the mdn page for each selector where you can check browser support information. you can use this as a reference to come back to when you need to look up selectors later in the material, or as you experiment with css generally. selector example learn css tutorial type selector h1 { } type selectors universal selector * { } the universal selector class selector .box { } class selectors ...
Styling tables - Learn web development
bit of texture, as well as giving those elements a bright purple border. it is useful to have multiple nested elements available so you can layer styles on top of one another. yes, we could have put both the background image and the linear gradient on the <thead> and <tfoot> elements using multiple background images, but we decided to do it separately for the benefit of older browsers that don't support multiple background images or linear gradients. zebra striping we wanted to dedicate a separate section to showing you how to implement zebra stripes — alternating rows of color that make the different data rows in your table easier to parse and read. add the following css to the bottom of your style.css file: /* zebra striping */ tbody tr:nth-child(odd) { background-color: #ff33cc; }...
...the same things as the aforementioned formulae. in this case we are giving the odd and even rows different (lurid) colors. we've also added a repeating background tile to all the body rows, which is just a bit of noise (a semi-transparent .png with a bit of visual distortion on it) to provide some texture. lastly, we've given the entire table a solid background color so that browsers that don't support the :nth-child selector still have a background for their body rows. this color explosion results in the following look: now, this may be a bit over the top and not to your taste, but the point we are trying to make here is that tables don't have to be boring and academic. styling the caption there is one last thing to do with our table — style the caption. to do this, add the follow...
Floats - Learn web development
llbars or clipped shadows due to unintended consequences of using overflow. display: flow-root the modern way of solving this problem is to use the value flow-root of the display property. this exists only to create a bfc without using hacks — there will be no unintended consequences when you use it. remove overflow: auto from your .wrapper rule and add display: flow-root. assuming you have a supporting browser, the box will clear. .wrapper { background-color: rgb(79,185,227); padding: 10px; color: #fff; display: flow-root; } float example 7 <h1>simple float example</h1> <div class="wrapper"> <div class="box">float</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla luctus aliquam dolor, eu lacinia lorem placerat vulputate. </p> </div> <p class="clear...
...ent. ...
Responsive design - Learn web development
um zoom level. user-scalable: prevents zooming if set to no. you should avoid using minimum-scale, maximum-scale, and in particular setting user-scalable to no. users should be allowed to zoom as much or as little as they need to; preventing this causes accessibility problems. note: there is a css @ rule designed to replace the viewport meta tag — @viewport — however, it has poor browser support. when both are used the meta tag overrides @viewport. summary responsive design refers to a site or application design that responds to the environment in which it is viewed. it encompasses a number of css and html features and techniques and is now essentially just how we build websites by default. consider the sites that you visit on your phone — it is probably fairly unusual to come a...
...are still useful, modern use of css and html makes it far easier to create elegant and useful designs, no matter what device your visitor views the site with. previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
non-standard features in browsers without polluting the regular namespace, preventing future incompatibilities to arise when the standard is extended. the use of such properties on production websites is not recommended — they have already created a huge web compatibility mess. for example, many developers only using the -webkit- prefixed version of a property when the non-prefixed version is supported across all browsers meant that a feature relying on that property would break in non-webkit-based browsers, completely needlessly. this problem got so bad that other browsers started to implement -webkit- prefixed aliases to improve web compatibility, as specified in the compatibility living standard. in fact most browsers now do not use css prefixes when implementing experimental features...
...s now do not use css prefixes when implementing experimental features, instead implementing those features only on nightly browser versions or similar. if you need to use prefixes in your work, you are advised to write your code in a way that uses the prefixed versions first, but then includes a non-prefixed standard version afterwards so it can automatically override the prefixed versions where supported. for example: -ms-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg); note: for more information on dealing with prefixed properties, see handling common html and css problems — handling css prefixes from our cross-browser testing module. note: see the mozilla css extensions page for more information on the mozilla-prefixed css properties. how doe...
How can we design for all types of users? - Learn web development
f 16 pixels). em-based sizes: em this unit is calculated the same way as percents, except that you compute in portions of 1 and not portions of 100. it is said that "em" is the width of a capital “m” in the alphabet (roughly speaking, an “m” fits into a square). rem-based sizes: rem this unit is proportional to the root element's font size and is expressed as portions of 1, like em. suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at the default font size (usually 16px). here is the html we're using: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>font size experiment</title> </head> <body> <h1>this is our main ...
...} /* 1em = 100% of the browser's base font size, so in most cases this will render as 16 pixels */ h1 { font-size:2rem; } /* twice the size of the body, thus 32 pixels */ span.subheading { font-size:1rem; } /* original size */ easier, isn't it? this works as of internet explorer 9 and in every other current browser, so please feel free to use this unit. note: you may notice opera mini does not support font sizing in rem. it will end up setting its own font size, so don't bother feeding it font units. why would i want to use proportional units? because you don't know when a browser is going to come around and refuse to zoom up text whose size is expressed in pixels. also, check your website's statistics: you may receive visits from older browsers. we would advise the following: descr...
How do I start to design my website? - Learn web development
ls call project ideation, project planning, and project management. what exactly do i want to accomplish? this is the most important question to answer, since it drives everything else. list all the goals you want to reach. it can be anything: selling goods to make money, expressing political opinions, meeting new friends, gigging with musicians, collecting cat pictures, or whatever you want. suppose you are a musician. you could wish to: let people hear your music. sell goodies. meet other musicians. talk about your music. teach music through videos. publish photos of your cats. find a new girl/boyfriend. once you have such a list, you need to prioritize. order the goals from most important to least important: find a new girl/boyfriend. let people hear your music. talk ab...
...ain, could you do this with existing web services?) give people access to your videos on some part of your website two things to notice. first, some of these items are not web-related (e.g., record music, write articles). often those offline activities matter even more than the web side of the project. in sales, for instance, it's far more important and time-consuming to handle supply, payment, and shipment than to build a website where people can place orders. second, setting out actionable steps leads to new questions you'll need to answer. usually there turn out to be more questions than we originally thought. (for example, should i learn how to do all this myself, ask someone to do it for me, or use third-party services?) conclusion as you can see, the simple idea "i...
What is a web server? - Learn web development
erver is and gain a general understanding of how it works. summary the term web server can refer to hardware or software, or both of them working together. on the hardware side, a web server is a computer that stores web server software and a website's component files. (for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other devices connected to the web. on the software side, a web server includes several parts that control how web users access hosted files. at a minimum, this is an http server. an http server is software that understands urls (web addresses) and http (the protocol your browser uses to view webpages). an http server can be accessed through the domain names o...
... good hosting provider is a key part of building your website. examine the various services companies offer. choose one that fits your needs and budget. (services range from free to thousands of dollars per month.) you can find more details in this article. once you have web hosting service, you must upload your files to your web server. communicating through http second, a web server provides support for http (hypertext transfer protocol). as its name implies, http specifies how to transfer hypertext (linked web documents) between two computers. a protocol is a set of rules for communication between two computers. http is a textual, stateless protocol. textual all commands are plain-text and human-readable. stateless neither the server nor the client remember previous communication...
Styling web forms - Learn web development
prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand the issues behind styling forms, and learn some of the basic styling techniques that will be useful to you. why is styling form widgets challenging? form controls were added to html in the html 2 specification in 1995; css wasn't released until late 1996, and wasn't supported very well by browsers for a few years after that. browsers relied on the underlying operating system to manage and render form controls. and even with css available to style html, browser vendors have historically been reluctant to make form controls stylable because users were so accustomed to the visual appearance of their respective platforms. but this has changed. website owners want f...
...ome. rather, it uses the font-family: system-ui. this is another reason to use <button> elements over their equivalent input types! there's a lot of debate as to whether forms look better using the system default styles, or customized styles designed to match your content. this decision is yours to make, as the designer of your site, or web application. box sizing all text fields have complete support for every property related to the css box model, such as width, height, padding, margin, and border. as before, however, browsers rely on the system default styles when displaying these widgets. it's up to you to define how you wish to blend them into your content. if you want to keep the native look and feel of the widgets, you'll face a little difficulty if you want to give them a consisten...
JavaScript basics - Learn web development
ryselector('h1'); myheading.textcontent = 'hello world!'; make sure the html and javascript files are saved. then load index.html in your browser. you should see something like this: note: the reason the instructions (above) place the <script> element near the bottom of the html file is that the browser reads code in the order it appears in the file. if the javascript loads first and it is supposed to affect the html that hasn't loaded yet, there could be problems. placing javascript near the bottom of an html page is one way to accommodate this dependency. to learn more about alternative approaches, see script loading strategies. what happened? the heading text changed to hello world! using javascript. you did this by using a function called queryselector() to grab a reference to y...
...attach an event handler to an element. here we select the <html> element, setting its onclick handler property equal to an anonymous (i.e. nameless) function, which contains the code we want the click event to run. note that document.queryselector('html').onclick = function() {}; is equivalent to let myhtml = document.queryselector('html'); myhtml.onclick = function() {}; it's just shorter. supercharging our example website with this review of javascript basics completed (above), let's add some new features to our example site. adding an image changer in this section, you will learn how to use javascript and dom api features to alternate the display of one of two images. this change will happen as a user clicks the displayed image. choose an image you want to feature on your examp...
Tips for authoring fast-loading HTML pages - Learn web development
nd will not work for every use of a background image. however, the fewer http requests and single image caching can help reduce page-load time. use a content delivery network (cdn) for the purposes of this article, a cdn is a means to reduce the physical distance between your server and your visitor. as the distance between your server origin and visitor increases, the load times will increase. suppose your website server is located in the united states and it has a visitor from india; the page load time will be much higher for the indian visitor compared to a visitor from the us. a cdn is a geographically distributed network of servers that work together to shorten the distance between the user and your website. cdns store cached versions of your website and serve them to visitors via the...
...y is true. choose your user-agent requirements wisely to achieve the greatest improvements in page design, make sure that reasonable user-agent requirements are specified for projects. do not require your content to appear pixel-perfect in all browsers, especially not in down-version browsers. ideally, your basic minimum requirements should be based on the consideration of modern browsers that support the relevant standards. this can include recent versions of firefox, internet explorer, google chrome, opera, and safari. note, however, that many of the tips listed in this article are common-sense techniques which apply to any user agent, and can be applied to any web page, regardless of browser-support requirements. use async and defer, if possible make the javascript scripts such that ...
What’s in the head? Metadata in HTML - Learn web development
subpages of mdn web docs listed below the main homepage link — these are called sitelinks, and are configurable in google's webmaster tools — a way to make your site's search results better in the google search engine. note: many <meta> features just aren't used any more. for example, the keyword <meta> element (<meta name="keywords" content="fill, in, your, keywords, here">) — which is supposed to provide keywords for search engines to determine relevance of that page for different search terms — is ignored by search engines, because spammers were just filling the keyword list with hundreds of keywords, biasing results. other types of metadata as you travel around the web, you'll find other types of metadata, too. a lot of the features you'll see on websites are proprietary cr...
... for many years. it is the first icon of this type: a 16-pixel square icon used in multiple places. you may see (depending on the browser) favicons displayed in the browser tab containing each open page, and next to bookmarked pages in the bookmarks panel. ...
Test your skills: Multimedia and embedding - Learn web development
mbedding 1 in this task we want you to embed a simple audio file onto the page. you need to: add the path to the audio file to an appropriate attribute to embed it on the page. the audio is called audio.mp3, and it is in a folder inside the current folder called media. add an attribute to make browsers display some default controls. add some appropriate fallback text for browsers that don't support <audio>. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. multimedia and embedding 2 in this task we want you to mark up a slightly more complex video player, with multiple sources, subtitles, and other features besides. you need to: add an attribute to make browsers disp...
...download the starting point for this task to work in your own editor or in an online editor. multimedia and embedding 2 in this task we want you to mark up a slightly more complex video player, with multiple sources, subtitles, and other features besides. you need to: add an attribute to make browsers display some default controls. add some appropriate fallback text for browsers that don't support <video>. add multiple sources, containing the paths to the video files. the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (3...
Fetching data from the server - Learn web development
ne, rather than being inside the previous one (which can get unwieldy). the only other difference is that we've had to include a return statement in front of response.text(), to get it to pass its result on to the next link in the chain. which mechanism should you use? this really depends on what project you are working on. xhr has been around for a long time now and has very good cross-browser support. fetch and promises, on the other hand, are a more recent addition to the web platform, although they're supported well across the browser landscape, with the exception of internet explorer. if you need to support older browsers, then an xhr solution might be preferable. if however you are working on a more progressive project and aren't as worried about older browsers, then fetch could be a...
...h will become more popular as internet explorer declines in usage (ie is no longer being developed, in favor of microsoft's new edge browser), but you might need xhr for a while yet. a more complex example to round off the article, we'll look at a slightly more complex example that shows some more interesting uses of fetch. we have created a sample site called the can store — it's a fictional supermarket that only sells canned goods. you can find this example live on github, and see the source code. by default, the site displays all the products, but you can use the form controls in the left hand column to filter them by category, or search term, or both. there is quite a lot of complex code that deals with filtering the products by category and search terms, manipulating strings so t...
Video and Audio APIs - Learn web development
how to use browser apis to control video and audio playback. html5 video and audio the <video> and <audio> elements allow us to embed video and audio into web pages. as we showed in video and audio content, a typical implementation looks like this: <video controls> <source src="rabbit320.mp4" type="video/mp4"> <source src="rabbit320.webm" type="video/webm"> <p>your browser doesn't support html5 video. here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> this creates a video player inside the browser like so: you can review what all the html features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls. if you don't specify this, you get no playback cont...
...nked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls. if you don't specify this, you get no playback controls: this is not as immediately useful for video playback, but it does have advantages. one big issue with the native browser controls is that they are different in each browser — not very good for cross-browser support! another big issue is that the native controls in most browsers aren't very keyboard-accessible. you can solve both these problems by hiding the native controls (by removing the controls attribute), and programming your own with html, css, and javascript. in the next section we'll look at the basic tools we have available to do this. the htmlmediaelement api part of the html5 spec, the htm...
Arrays - Learn web development
re and how to manipulate them in javascript. what is an array? arrays are generally described as "list-like objects"; they are basically single objects that contain multiple values stored in a list. array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value. maybe we've got a series of product items and their prices stored in an array, and we want to loop through them all and print them out on an invoice, while totaling all the prices together and printing out the total price at the bottom. if we didn't have arrays, we'd have to store every item i...
...error-prone. if we had 10 items to add to the invoice it would already be annoying, but what about 100 items, or 1000? we'll return to this example later on in the article. as in previous articles, let's learn about the real basics of arrays by entering some examples into browser developer console. creating arrays arrays consist of square brackets and elements that are separated by commas. suppose we want to store a shopping list in an array. paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays. we can also mix data types in a single array — we do not have to limit our...
Handling text — strings in JavaScript - Learn web development
ly quoted code can be confusing, especially if you use two different quotes on the same string! the following will return an error: let badquotes = 'what on earth?"; the browser will think the string has not been closed because the other type of quote you are not using to contain your strings can appear in the string. for example, both of these are okay: let sgldbl = 'would you eat a "fish supper"?'; let dblsgl = "i'm feeling blue."; sgldbl; dblsgl; however, you can't include the same quote mark inside the string if it's being used to contain them. the following will error, as it confuses the browser as to where the string ends: let bigmouth = 'i've got no right to take my place...'; this leads us very nicely into our next subject. escaping characters in a string to fix our p...
...\ni gave it a score of ' + (score/highestscore * 100) + '%.'; template literals respect the line breaks in the source code, so newline characters are no longer needed. this would achieve the same result: output = `i like the song "${ song }". i gave it a score of ${ score/highestscore * 100 }%.`; we would recommend that you get used to using template literals as soon as possible. they are well-supported in modern browsers, and the only place you'll find a lack of support is internet explorer. many of our examples still use standard string literals, but we will include more template literals going forward. see our template literals reference page for more examples and details of advanced features. test your skills! you've reached the end of this article, but can you remember the most imp...
Multimedia: video - Learn web development
mizing video to improve web performance. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the various video formats, their impact on performance, and how to reduce video impact on overall page load time while serving the smallest video file size based on each browsers file type support. why optimize your multimedia? for the average website, 25% of bandwidth comes from video. optimizing video has the potential for very large bandwidth savings that translate into better website performance. optimizing video delivery it's best to compress all video, optimize <source> order, set autoplay, remove audio from muted video, optimize video preload, and consider streaming th...
... larger versions. with the smallest version, make sure that the most compressed video still looks good. there are some compression algorithms that can make video look (bad) like an animated gif. while a 128 kb video may seem like it could provide a better user experience than a 10 mb download, a grainy gif-like video may reflect poorly on the brand or project. see caniuse.com for current browser support of video and other media types. video autoplay to ensure that a looping background video autoplays, you must add several attributes to the video tag: autoplay, muted, and playsinline. <video autoplay="" loop="" muted="true" playsinline="" src="backgroundvideo.mp4"> while the loop and autoplay make sense for a looping and autoplaying video, the muted attribute is required for autoplay in...
Website security - Learn web development
the data to make it unusable. sql injection types include error-based sql injection, sql injection based on boolean errors, and time-based sql injection. this vulnerability is present if user input that is passed to an underlying sql statement can change the meaning of the statement. for example, the following code is intended to list all users with a particular name (username) that has been supplied from an html form: statement = "select * from users where name = '" + username + "';" if the user specifies a real name, the statement will work as intended. however, a malicious user could completely change the behavior of this sql statement to the new statement in the following example, by simply specifying the text in bold for the username. select * from users where name = 'a';drop tab...
...n gets rich. note: the trick here is that john doesn't need to have access to the user's cookies (or access credentials). the browser of the user stores this information and automatically includes it in all requests to the associated server. one way to prevent this type of attack is for the server to require that post requests include a user-specific site-generated secret. the secret would be supplied by the server when sending the web form used to make transfers. this approach prevents john from creating his own form, because he would have to know the secret that the server is providing for the user. even if he found out the secret and created a form for a particular user, he would no longer be able to use that same form to attack every user. web frameworks often include such csrf preve...
Ember resources and troubleshooting - Learn web development
re html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to provide further resource links and troubleshooting information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord server — a forum/chat server where you can meet the ember community, ask for help, and help others! general troubleshooting, gotchas, and misconceptions this is nowhere near an extensive list, but it is a list of things that came up around the time of writing (latest update, may 2020). how do i debug what's going on in the framewo...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Routing in Ember - Learn web development
sponds to the specific path ("active", "completed", or "index"), will render the <todolist /> component. the location in the page where <todolist /> is rendered is determined by the {{ outlet }} inside the parent route, which in this case is application.hbs. so we have our routes in place. great! but now we need a way to differentiate between each of these routes, so that they show what they are supposed to show. first of all, return once more to our todo-data.js file. it already contains a getter that returns all todos, and a getter that returns incomplete todos. the getter we are missing is one to return just the completed todos. add the following below the existing getters: get completed() { return this.todos.filter(todo => todo.iscompleted); } models now we need to add models to ou...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Starting our Svelte Todo list app - Learn web development
tive technologies that we're treating our <h2> with an id of list-heading as the label that describes the purpose of the list beneath it. making this association gives the list a more informative context, which could help screen reader users better understand the purpose of it. this seems like a good time to talk about how svelte deals with accessibility; let's do that now. svelte accessibility support svelte has a special emphasis on accessibility. the intention is to encourage developers to write more accessible code "by default". being a compiler, svelte can statically analyze our html templates to provide accessibility warnings when components are being compiled. accessibility (shortened to a11y) isn't always easy to get right, but svelte will help by warning you if you write inaccess...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Dynamic behavior in Svelte: working with variables and props - Learn web development
99, name: newtodoname, completed: false }) newtodoname = '' } note: for the moment we are just assigning the same id to every todo, but don't worry, we will fix that soon. now we want to update our html so that we call addtodo() whenever the form is submitted. update the newtodo form's opening tag like so: <form on:submit|preventdefault={addtodo}> the on:eventname directive supports adding modifiers to the dom event with the | character. in this case, the preventdefault modifier tells svelte to generate the code to call event.preventdefault() before running the handler. explore the previous link to see what other modifiers are available. if you try adding new todos at this point, the new todos are added to the todos array but our ui is not updated. remember that i...
...ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Cross browser testing - Learn web development
g with user groups. handling common html and css problems with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. this includes linting code, handing css prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. handling common javascript problems now we'll look at common cross-browser javascript problems and how to fix them. this includes information on using browser dev tools to track down and fix problems, using polyfills and libraries to work around problems, getting modern javascript features working in older browsers, and more. ha...
... getting modern javascript features working in older browsers, and more. handling common accessibility problems next we turn our attention to accessibility, providing information on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues. implementing feature detection feature detection involves working out whether a browser supports a certain block of code, and running different code dependent on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to speed up implementation, and native features for feature detection such as @supports. introductio...
Tools and testing - Learn web development
, 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 javascript frameworks, to testing and automation tools, and more besides. as your web projects become larger and more complex, you'll want to start taking advantage of some of these tools, working out a reliable toolchain to give your development process superpowers. on top of that, we still need to keep cross-browser support in the forefront of our minds, and make sure that our code follows best practices that allow our projects to work across different browsers and devices that our users are using to browse the web, and be usable by people with disabilities. working out what tools you should be using can be a difficult process, so we have written...
...hat tools you should be using can be a difficult process, so we have written this set of articles to inform you of what types of tool are available, what they can do for you, and how to make use of the current industry favourites. note: we have referenced a number of tools in this topic, not because we endorse them or think they are the best, but because we know they work and have good industry support. in most cases there are other tools available, old ones will go out of fashion, and new ones will no doubt appear. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites you should really learn the basics of the core html, css, and javascript languages first ...
Accessibility Information for Core Gecko Developers
is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Accessibility information for UI designers and developers
is always a good chance to find someone to chat with there, day or night. ...
...ance to find someone to chat with there, day or night. ...
Accessibility and Mozilla
rencethis cross-reference helps us see the difference between today's accessibility api's. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc.accessibility features in firefoxfirefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. we are optimistic that jaws support will catch up this year. in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comforta...
...developerswhen you design user interfaces with accessibility in mind, they will work for more people. this page describes a number of design-related aspects to look out for, in no particular order.accessibility/liveregiondevguidethis page is currently under construction. this developer's guide lays out general guidelines that assistive technology (at) developers can use in developing live region support. this guide was written from an atk/at-spi point of view as part of the orca live region support project. however, many of the concepts were also used during the development of firevox, an at using iaccessible2.accessible toolkit checklistplease contact the mozilla accessibility community with questions or feedback.csun firefox materialsfirefox 1.5 is a fast, free, standards compliant web bro...
Creating Sandboxed HTTP Connections
on (arequest, acontext, aprogress, aprogressmax) { }, onstatus : function (arequest, acontext, astatus, astatusarg) { }, // nsihttpeventsink (not implementing will cause annoying exceptions) onredirect : function (aoldchannel, anewchannel) { }, // we are faking an xpcom interface, so we need to implement qi queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiinterfacerequestor) || aiid.equals(components.interfaces.nsichanneleventsink) || aiid.equals(components.interfaces.nsiprogresseventsink) || aiid.equals(components.interfaces.nsihttpeventsink) || aiid.equals(components.interfaces.nsistreamlistener)) return this; throw components.results.ns_nointerface;...
... // make sure it is our connection first. if (asubject == gchannel) { var httpchannel = asubject.queryinterface(components.interfaces.nsihttpchannel); if (atopic == "http-on-modify-request") { // ... } else if (atopic == "http-on-examine-response") { // ... } } }, queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiobserver)) return this; throw components.results.ns_nointerface; } }; // get the observer service and register for the two coookie topics. var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(li...
Configuring Build Options
please read the following directions carefully before building, and follow them in order. ...
...different applications or configurations (see below for a full example). note that in the export example below the filename was not mozconfig. regardless of the name of the actual file you use, we refer to this file as the mozconfig file in the examples below. setting the mozconfig path: export mozconfig=$home/mozilla/mozconfig-firefox calling the file .mozconfig (with a leading dot) is also supported, but this is not recommended because it may make the file harder to find. this will also help when troubleshooting because people will want to know which build options you have selected and will assume that you have put them in your mozconfig file. mozconfig contains two types of options: options prefixed with mk_add_options are passed to client.mk. the most important of these is moz_...
Simple Thunderbird build
e directory. use an absolute path to be sure! to also build lightning when building thunderbird (deprecated) note: the lightning calendar add-on was integrated into thunderbird starting with version 74. the `--enable-calendar` option is now deprecated and no longer has any effect. if it is in your `mozconfig` file, you should go ahead and remove it when building thunderbird 74 or later, since support for it will eventually be removed completely. add the following line to your mozconfig file: ac_add_options --enable-calendar to add that line you can do this in the source/ directory: echo 'ac_add_options --enable-calendar' >> mozconfig building before you start, make sure that the version you checked out is not busted. for hg tip, you should see green bs on https://treeherder.mozill...
...lone instruction). check to make sure that the path in which you placed the source code has no spaces, and is not too long. searched the bug database for issues relating to your problem (e.g., platform-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a symlink. a symlink there is not supported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram. clobbering (see below) will also r...
Commenting IDL for better documentation
volunteers. we will take your comments and notes and turn them into beautiful, easy to search and read documentation. but by following the guidelines here, you can help make sure that our tools can generate a "good start" version of the documentation for your interfaces, and that the writers will be able to easily figure out what the tools are not able to do automatically. comment format doxygen supports several comment formats; for style and consistency reasons, we use the following: /** * */ note the two asterisks ("**") on the first line of the comment. that lets doxygen (and by extension, our automated documentation import tools) know that the comment should be absorbed into documentation. if you use any other format for your comments, our tools will ignore them. following the rules b...
...leave out things like [in]/[out]. @returns description if the method returns something then this should be included. @throws error description the error should be the actual name of the error constant, in all caps. @note description used to include a note styled paragraph. @remarks remark a remark paragraph to be included in the remarks section of the documentation. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. @see description either an interface or a html link. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. - or . used at the beginning of a comment line to indicate an unordered list item. there must be a space between the list marker and the item. nested lists s...
Runtime Directories
~/.mozilla/firefox/xxxxxxxx.default/ n/d thunderbird os application directory user profile directory temporary directory windows vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbird\ (or %appd...
... c:\documents and settings\<username>\local settings\application data\thunderbird\ os x /applications/thunderbird.app ~/library/thunderbird/profiles/xxxxxxxx.default/ ~/library/caches/thunderbird/profiles/xxxxxxxx.default/ linux ???? ~/.thunderbird/xxxxxxxx.default/ (or ~/.mozilla-thunderbird/xxxxxxxx.default/ on debian/ubuntu) n/d see also https://support.mozilla.org/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile https://support.mozilla.org/kb/profiles-tb#w_where-is-my-profile-stored http://kb.mozillazine.org/profile_folder ...
SVG Guidelines
d with editor" comments non-standard editor specific tags and attributes (sketch:foo, illustrator:foo, sopodi:foo, …) the xml namespace definition that comes with the latter (xmlns:sketch, xmlns:sopodi, …) other metadata in addition to non-standard editor metadata, standard compliant metadata also exists. typical examples of this are <title> and <desc> tags. although this kind of data is supported by the browser, it can only be displayed when the svg is opened in a new tab. plus, in most of the cases, the filename is quite descriptive so it's recommended to remove that kind of metadata since it doesn't bring much value. you shouldn't include doctypes in your svgs either; they are a source of many issues, and the svg wg recommends not to include them. see svg authoring guidelines. a...
... uncolored ones are easier to spot, since they usually come with styles making them invisible. they must meet two conditions: they must be devoid of any fill (or a transparent one) or stroke. unused attributes on root <svg> element the root <svg> element can also host many useless attributes. ...
mach
t there should not be any ideally). however - mach does offer some additional features over manual invocation of client.mk: if on windows, mach will automatically use pymake instead of gnu make, as that is preferred on windows. mach will print timings with each line of output from the build. this gives you an idea of how long things take. ...
... is mach a build system? no. mach is just a generic command dispatching tool that happens to have a few commands that interact with the real build system. historically, mach was born to become a better interface to the build system. ...
Displaying Places information using views
gside those provided by the built-in tree view. changing the way a built-in view displays dates or other data. inserting information into the display that is not determined by the underlying data. displaying places information in an element not covered by one of the built-in views. potentially bad reasons for creating a custom view might include (but are not limited to): changing only the superficial appearance of a built-in view rather than the content it displays. try css here. hiding columns of the built-in tree view. just leave out the treecol elements you want to hide. managing how the view responds to clicks, commands, and other user interaction. don't break the separation of concerns here. views are for displaying data, controllers for logic. you can hook up a built-in view t...
...ew, placestreeview, is especially useful since it implements all three of nsinavhistoryresulttreeviewer, nsinavhistoryresultobserver, and nsitreeview. you can therefore implement your own custom functionality on top of placestreeview while relying on it for non-custom functionality and much of the tedious work. one strategy is to create your custom object(s) implementing each of these interfaces, support your custom behavior with them, but pass off everything else to a placestreeview instance that you would own. perhaps an easier strategy is to modify an existing placestreeview instance, which is what the following example does. the following javascript creates a new placestreeview instance but overrides two of its nsitreeview methods to display columns not present in the built-in tree view:...
Multiple Firefox profiles
reasons to have multiple profiles the casual user may want to have different profiles for work and personal use, or different family members. having different profiles would help separate work and personal life, or allow each family member to have his or her own set of bookmarks, settings, and add-ons. ...
...he profile folder you wish to launch into. this will launch firefox immediately. otherwise, enter a space character followed by --profilemanager. this will present the profile manager window in which you can make your selection. hit return. here is a complete example terminal command from steps 2-3: /applications/firefox.app/contents/macos/firefox -profile /users/suzie/library/application\ support/firefox/profiles/r99d1z7c.default if the profile manager window does not open, firefox may have been running in the background, even though it was not visible. close all instances of firefox, or restart the computer, and then try again. if you want to do this frequently and more easily, you may wish to create an automator application, as explained in this tutorial. creating a profile ...
Performance best practices for Firefox front-end engineers
t the very beginning of the frame, before any changes have been made to the dom since the last time a style flush occurred. historically, there hasn't been an easy way of doing this - however, bug 1434376 has recently landed some chromeonly helpers to the window binding to make this simpler. if you want to queue up some javascript to run after the next "natural" style and layout flush, try: // suppose we want to get the computed "display" style of some node without // causing a style flush. we could do it this way: async function nodeisdisplaynone(node) { let display = await window.promisedocumentflushed(() => { // do _not_ under any circumstances write to the dom in one of these // callbacks! return window.getcomputedstyle(node).display; }); return display == "none"; } ...
...style(node).display; }); return display == "none"; } see detecting and avoiding synchronous reflow for a more advanced example of getting layout information, and then setting it safely, without causing flushes. promisedocumentflushed is only available to priviledged script, and should be called on the inner window of a top-level frame. calling it on the outer window of a subframe is not supported, and calling it from within the inner window of a subframe might cause the callback to fire even though a style and layout flush will still be required. these gotchas should be fixed by bug 1441173. for now, it is up to you as the consumer of this api to not accidentally write to the dom within the promisedocumentflushed callback. doing so might cause flushes to occur for other promisedocu...
Firefox UI considerations for web developers
pixels. the icon closest in size to 96 pixels is selected. firefox does its best to avoid having to scale the images, which can result in fuzzy or distorted images, especially at smaller sizes. providing a top sites ready icon the simple rule is to provide an icon which is at least 96x96 pixels in size, using a <link> element whose rel attribute is a reference to a file containing an icon of a supported type. <link rel="apple-touch-icon" sizes="128x128" href="touch-icon-128x128.png"> <link rel="apple-touch-icon" sizes="46x46" href="touch-icon-46x46.png"> <link rel="apple-touch-icon" sizes="256x256" href="touch-icon-256x256.png"> <link rel="icon" href="favicon.ico"> in this code, the 128x128 pixel icon will be used by firefox, as it's the smallest icon which is larger than the 96-pixel s...
...28x128.png"> <link rel="apple-touch-icon" sizes="46x46" href="touch-icon-46x46.png"> <link rel="apple-touch-icon" sizes="256x256" href="touch-icon-256x256.png"> <link rel="icon" href="favicon.ico"> in this code, the 128x128 pixel icon will be used by firefox, as it's the smallest icon which is larger than the 96-pixel size it requires. note: only "rich" icons (apple-touch-icon and fluid-icon) support the sizes attribute. you can't specify the size for rel="icon" using the sizes attribute. examples consider again the example top sites box shown at the top of the page, repeated below: let's look at some examples among the icons shown here (note that this discussion is based on the site designs as of early january, 2019). usa today the only icon provided by usa today is its classic f...
Browser API
t we can make it appear like a top-level browser window to the embedded content. this means that window.top, window.parent, window.frameelement, etc. should not reflect the frame hierarchy. api extensions: the api includes several new methods and events to manipulate and listen for changes to the embedded content's state, interited by the htmliframeelement interface. browser api interfaces to support the requirement of a browser <iframe>, the htmliframeelement dom interface has been extended with new methods that give the <iframe> some super powers. navigation methods the following navigation methods allow navigation through the browsing history of the <iframe>. they are necessary to be able to implement back, forward, stop, and reload buttons. htmliframeelement.reload() allows relo...
... playing in the browser <iframe>. htmliframeelement.unmute() unmutes any audio playing in the browser <iframe>. htmliframeelement.getmuted() indicates whether the browser <iframe> is currently muted. event-related methods in order to manage the browser <iframe>'s content, many new events were added (see below). the following methods are used to deal with those events: the <iframe> gains support for the methods of the eventtarget interface addeventlistener(), removeeventlistener(), and dispatchevent(). htmliframeelement.sendmouseevent() sends a mouseevent to the <iframe>'s content. utility methods last, there are some utility methods, useful for apps that host a browser <iframe>. htmliframeelement.getstructureddata() retrieves any structured microdata (and hcard and hcalend...
Roll your own browser: An embedding how-to
called config. contained within this directory are a couple of makefiles: basebrowser-unix basebrowser-win the xpinstall packager follows the same format. however in our case, we only have one named xpi package. after the build is done, you can change directory into mozilla/embedding/config, and do a make. this will produce a directory in dist named embed. it should include all of the base support that you need to get a web browser started up. included is the sample test application (gtkembed or winembed). what initializations do i have to do? somewhere during the start of your application, you must initialize xpcom. you will also want to shut this down when you quit. other initialization must be done to start up event queues and load some string bundles. all of this is somewhat ge...
...zilla to be embedded into the konqueror browser. uses gtkmozembed widget, part of the kdebindings module and available from http://websvn.kde.org/trunk/kde/kdebindings/xparts/. (news release, screenshot) mozilla examples gtkmozembed widget: gtk widget wrapper for the mozilla gecko engine. testgtkembed: basic browser built with the gtkmozembed widget. url location field, menu bar, html area, supports ssl. windows external projects k-meleon browser: the windows answer to galeon. fast ie-look-alike browser, uses ie and ns bookmarking system, fast loading time, privacy features, java support and complete control of the menus and "hotkeys". implemented with mozilla embedding apis. (screenshots) neoplanet browser: a gecko add-on for the neoplanet browser. activestate's komodo: develop...
Gecko
render web content, such as html, css, xul, javascript, and render it on the user's screen or print it. in xul-based applications gecko also renders the application's user interface. gecko is used in many applications, including a few browsers such as firefox and seamonkey (for a complete list, please refer to wikipedia's article on gecko). products using the same version of gecko have identical support for web standards. documentation chrome this page contains information specific to browser chrome (not google chrome) code running in gecko. gecko faq frequently asked questions about gecko. gecko dom reference reference to the dom. gecko event reference reference to events used within gecko and mozilla applications; for...
... frequently asked questions about gecko. gecko dom reference reference to the dom. gecko event reference reference to events used within gecko and mozilla applications; for web-standard dom events, see the dom event reference. introduction to layout in mozilla tech talk on layout. embedding mozilla using gecko in your own application. character sets supported by gecko a list of the character sets supported by gecko. html parser threading description of multithreading in the html parser. gecko home page on mozillawiki home for the active developers. roadmaps and more up-to-date resources. view all… community view mozilla forums: mailing list newsgroup rss feed related...
How to get a stacktrace for a bug report
mozilla developers what crashed and provide a starting point for investigating its cause. this article describes how to use the mozilla crash reporter (breakpad) to get a crash id, which our engineers can use to get a stacktrace, and alternative ways to get a stacktrace if you can't get a crash id. requirements you need a binary build of firefox from mozilla.org. seamonkey and thunderbird also support crash reporting. mozilla's crash report server currently only has debug information for mozilla builds and thus the crash reporter cannot work if you use a build from a linux distribution or if you compile from source code. in these cases you will need to use one of the alternative methods listed below. note: when filing a crash report, it is important to know whether the crash occurs with ...
...accessible from all firefox profiles, so if a new profile does not crash you can use it to access them through "about:crashes" as above. accessing crash report ids outside of firefox if you cannot load firefox at all you can find the crash report files at this location depending on your operating system: windows : %appdata%\mozilla\firefox\crash reports\submitted\ os x : ~/library/application support/firefox/crash reports/submitted/ linux : ~/.mozilla/firefox/crash reports/submitted/ each file in this folder contains one submitted crash report id. you can check the modified or creation time for each file to discern which crash reports are relevant to your bug report. alternative ways to get a stacktrace if the mozilla crash reporter doesn't come up or isn't available you will need to ...
Addon
sh them. permissions read only integer a bitfield holding all the the operations that can be performed on this add-on. operations my be restricted based on system policies (e.g., the system administrator may not allow certain add-ons to be uninstalled), add-on type (e.g., themes may not be disabled), or add-on state (e.g., an incompatible add-on cannot be enabled). providesupdatessecurely read only boolean true if the add-on has a secure means of updating or cannot be updated at all. scope read only integer indicates what scope the add-on is installed in, per profile, user, system, or application. type read only string the type of the add-on. userdisabled boolean true if the user wants this add-on to be disabled. ...
...that the add-on was most recently updated. operationsrequiringrestart read only integer a bitfield holding all of the operations that will require a restart to complete for this add-on. ...
JNI.jsm
the jni.jsm javascript code module abstracts all of the js-ctypes required for writing jni code. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17. if you would like to support versions before that, you can copy and paste the contents of the jsm file int jni stands for java native interface; this library allows calling java code running in java virtual machines (jvms), etc. the most common use for this module is in add-ons and other works on firefox for android (fennec). with this module, all of the android sdk functions that firefox has permissions for are at your fingertips. a note about firefox for android, this jsm file is already globally im...
... position in the array to obtain. return value returns primitive cdata. .getelements() returns a new cdata object of the section of the array specified by astart and ending at position astart + alength. void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in. alength the number of elements to copy from astart. if 0 is supplied, an empty cdata array is returned. return value a new cdata array object based on the array. .set() sets an element in the array at given aindex to the given aval. void set(number aindex, cdata aval); parameters aindex the position in the array to change. aval a value to set it to. return value this function has no return value, if you try to store the return value in a vari...
NetUtil.jsm
ssuccesscode(aresult)) { // an error occurred! } }) asyncfetch() the asyncfetch() method opens an input source, asynchronously, and gives an nsiinputstream containing the data obtained to the callback provided. the callback may then consume data from the input stream passed to the callback. note: prior to gecko 2, the input source was required to be specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. asyncfetch( asource, acallback ); parameters asource the source to open asynchronously. this may be specified as an nsiuri, nsifile, nsichannel, nsiinputstream or as a string specifying the url to open. acallback a function that will be called when the open operation is completed. the callback receives th...
...the optional character set to use when interpreting awhattoload as a string; this is ignored if awhattoload is not a string. defaults to utf-8 if not provided. abaseuri the base uri for the spec, specified as an nsiuri. only used if awhattoload is a string. newuri() the newuri() method creates a new nsiuri. this method wraps the nsiioservice.newuri(). note: starting in gecko 2, this method supports specifying an nsifile as the target of the uri. in previous versions of gecko, you must use a string to specify the uri. nsiuri newuri( atarget, [optional] aorigincharset, [optional] abaseuri ); parameters atarget specifies the target of the uri as either a uri string or (starting in gecko 2) as an nsifile. aorigincharset the optional character set for the uri. defaults to ut...
Using JavaScript code modules
e.jsm".) code modules can only be loaded using a chrome: (), resource:, or file: url. if you're writing an extension for firefox 4 and already have a chrome.manifest with a content instruction in it, you can put the code module in your content folder and reference it like your other content files via chrome://<yourextension>/content/<yourmodule>.jsm. if your extension or application needs to support mozilla 1.9.x (firefox 3.x), you should register a new resource url. details on doing this are in the "extending resource: urls" section below. sharing objects using code modules an extremely important behavior of components.utils.import() is that modules are cached when loaded and subsequent imports do not reload a new version of the module, but instead use the previously cached version. ...
...tration. this means you can't use components.utils.import() with your own resource url at the top level in a component source. a possible solution is moving the call to components.utils.import() into the xpcom component constructor (discussion). packaging notes it's important to note that you should not typically put your javascript code modules in a jar file in your add-on. firefox 3.6 doesn't support them at all, and there's only one case in which it's remotely useful: a firefox 4-only add-on which must be installed unpacked. otherwise placing code modules in a jar file breaks compatibility unnecessarily. importing commonjs modules the javascript code modules described here are not the same thing as commonjs modules, but you can import commonjs modules into any scope where you can use c...
source-editor.jsm
the editor provided is eclipse orion. ...
...nter enters a line annotation. sourceeditor.events.selection "selection" fired when the current selection in the editor changes. sourceeditor.events.text_changed "textchanged" fired when the editor's content changes. methods addbreakpoint adds a breakpoint to be triggered at a certain line in the code, under an optional condition. note: implementing actual support for debugger features such as breakpoints is up to you. the editor simply tracks their existence and marks them with annotations in the editor. void addbreakpoint( number alineindex, [optional] string acondition ); parameters alineindex the 0-based line number at which to place the breakpoint. acondition optional a string describing the condition under which the breakpoint shou...
JavaScript code modules
le bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloading capabilities of the platform. fileutils.jsm provides helpers for dealing with files. geometry.jsm provides routines for performing basic geometric operations on points and rectangles. http.jsm a wrapper for xmlhttprequest that provides convenie...
...data from an input stream to an output stream asynchronously. openlocationlasturl.jsm provides access to the last url opened using the "open location" option in the file menu. osfile.jsm allows routines to access files. to which can be read, write, rename, create directories,etc. perfmeasurement.jsm provides access to low-level hardware and os performance measurement tools. pluralform.jsm supplies an easy way to get the correct plural forms for the current locale, as well as ways to localize to a specific plural rule. popupnotifications.jsm gives an easy way to present non-modal notifications to users. promise.jsm implements the promises/a+ proposal as known in april 2013. promiseworker.jsm a version of chromeworker which uses promises to return the worker's result instead of us...
Localization and Plurals
put. chrome://mozapps/locale/downloads/do...tes,hours,days chrome://mozapps/locale/downloads/do...dstitlepercent chrome://browser/locale/browser.prop...auseddownloads version history 0.1: initial version with pluralrule check, properties input loading, table generation, sample output display 0.2: use pluralform.numforms() to get the number of forms instead of figuring out locally to better support future rules - requires build from 2007/01/27 or later 0.3: generate a list of what numbers fall into which plural form to minimize the sample output to at most 3 of each form developing with pluralform the functionality for getting the correct plural forms is provided by a javascript module, pluralform.jsm. this module provides a couple methods for localizing to the browser's current loca...
...suming a particular grammatical structure. the following would be better: components.utils.import("resource://gre/modules/pluralform.jsm"); let downloads = "you have one download.;you have #1 downloads."; let num = 10; // for english, this would display "you have 10 downloads." print(pluralform.get(num, downloads).replace("#1", num); notice in the above example that the code can be written to support placeholders or not use placeholders in some forms of the string. additionally, the localizer has control over where the placeholder is, in relation to the rest of the text. of course, the strings to be localized will be placed in a separate file, such as yourextension.properties, instead of being hardcoded in the javascript code file. the following 3 file snippets show how to use pluralfor...
Localizing with Koala
url: if you already have a repository set up by l10n-drivers (on bitbucket), type the url of the remote repository, e.g. http://bitbucket.org/mozillal10n/x-testing. if you're starting a new localization, you may not have a remote repository set up yet. it is still recommended to use mercurial locally to version your local files. just type a single dot (".") in the url field to enable mercurial support in koala. branch: default. revision: leave empty. user: type your name and your e-mail address in the form: "firstname lastname <me@example.com>" (be sure to type the wrapping quotes: "") note that you no longer have to edit the location now, it automatically fills in when you check the "mercurial" checkbox (e.g. "c:\mozilla\l10n\locale\x-testing\3.6" if you enabled mercurial (recommended...
...trol system. this will allow you to track changes, export them to remote repositories (first on bitbucket, later on hg.mozilla.org) and revert files to earlier versions in case of errors. version control systems add a lot of transparency to your work and allow others to get involved easily, so it's best to commit often (e.g. after you finish translating every file, or even more frequently). koala supports mercurial and allows you to add and commit files automatically from komodo. for the purposes of this tutorial, we will switch to the command line every now and then to see what koala does behind the scenes. normally though, you don't have to use the command line to commit your work. assuming that your locale files are in c:\mozilla\l10n\locale\x-testing\3.6 which is where the local mercurial...
Localizing with Mozilla Translator
if you decide to use mozillatranslator, be sure you have java 1.7 or above installed on your system. like most cat tools, mozillatranslator employs glossaries and translation memory to leverage your work from previous translations, thus cutting time and effort when localizing new versions of mozilla applications. ...
...has just [http://groups.google.es/group/mozill...eaf9f1322fa2fb announced] they are providing an en-us only mercurial repository comprising both mozilla-central and comm-central. if you are happy with a non-official solution (it's not like if they were third-party, they are your french equals!) ;-) you have a pretty easy and comfortable solution. if you are using a filesystem with symbolic links support (i.e., linux or mac), you can create symbolic links in a separate directory so it contains just the locale part. thanks to alexandru szasz, from narro, [http://groups.google.com/group/mozil...bbffa5402ec819 for this inspiration]. see this example for browser. for the last two options, you should be able to adjust your current mt product paths so you can keep using it just like with cvs. ke...
gettext
warning: this document pertains to the development of mozilla web sites and not to the development of gecko-based extensions or applications. plurals gettext lets you define and use singular and plural forms of a string. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). a definition of a string with plurals takes three arguments: the singular form of the english string, the plural form of the english string, and the number basing on which the function will return the correct (singular or plural) form of the str...
...ntical english strings and disambiguate the translation. in the po file, msgctxt looks like this: msgctxt "button label" msgid "log in" msgstr "" msgctxt "dialog title" msgid "log in" msgstr "" you can add context to your strings by passing an additional argument to the gettext function call and then having xgettext extract it as the context. in php, however, the default gettext functions don't support passing such additional argument. to fix this, you may choose to write your own helper gettext functions. the following example illustrates this. <?php // implement gettext context if (!function_exists('pgettext')) { function pgettext($context, $msgid) { $contextstring = "{$context}\004{$msgid}"; $translation = _($contextstring); if ($translation === $contextstrin...
MathML Demo: <mfrac> - fractions
inline, auto, normal line sin ⁔ θ π , numerator and denominator should render script size. inline, display style, normal line ln ⁔ x y , numerator and denominator should render normal size. inline, text style, normal line tan ⁔ θ 67 , numerator and denominator should render script size. inline, auto, thick line x 2 + 1 x , the superscripted 2 should be script-script size. inline, display style, thick line x - 1 0.98 × 10 2 + y , the superscripted 2 should be script size. inline, text style, thick line x 2 + 1 x x 2 + 1 x the end. inline, auto, no line x 2 + 1 x the end. inline, display style, no line 1.234567 89 + x the end. inline, text style, no line...
...>(</mo> <mi>f</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mn>2</mn> <mi>i</mi> <mo>&thinspace;</mo> <mi>cos</mi> <mo>(</mo> <mfrac> <mrow> <mi>&alpha;</mi> <mi>&pi;</mi> </mrow> <mn>2</mn> </mfrac> <mo>)</mo> </mrow> </mfrac> <mrow> <msub> <mo>&int;</mo> <mi>c</mi> </msub> <mfrac> <mrow> <mi>f</mi> <mo stretchy='false'>(</mo> <mi>i</mi> <mi>z</mi> <mo stretchy='false'>)</mo> <msup> <mrow> <mo>(</mo> <mo>-</mo> <mi>z</mi> <mo>)</mo> </mrow> <mi>&alpha;</mi> </msup> </mrow> <mrow> <msup> <mi>e</mi> <mrow> <mn>2</mn> <mi>&pi;</mi> <mi>z</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> </mrow> </mfrac> </mrow> <mi>d</mi> <mi>z</mi> </mrow> </math> css content [class="background"] { background-image: url(http://www.mozilla.org/images/mozilla-banner.gif); opacity: ...
MathML Demo: <mmultiscripts> - attach prescripts and tensor indices to a base
a mathml mmultiscripts object allows you to build tensor-like objects. for example m c d a b . the scripts come in pairs, with <mprescripts/> used to indicate prescripts and <none/> used to hold an empty position as in f b a . there are some variations possible: <mmultiscripts> a a b c d , nested <msubsup>s a a b c d , or &invisiblecomma; a a ⁣ c b ⁣ d . ...
... c d , or &invisiblecomma; a a ⁣ c b ⁣ d . ...
Activity Monitor, Battery Status Menu and top
n mac os x. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. activity monitor this is a built-in os x tool that shows real-time process measurements. it is well-known and its "energy impact" measure is likely to be consulted by users to compare the power consumption of different programs. (apple support documentation specifically recommends it for troubleshooting battery life problems.) unfortunately "energy impact" is not a good measure for either users or software developers and it should be avoided. activity monitor can still be useful, however. power-related measurements activity monitor has several tabs. they can all be customized to show any of the available measurements (by right-cl...
...: cpu usage percentage. this can exceed 100% if multiple cores are being used. idle wake ups: in mac os 10.9 this measured "package idle exit" wakeups. this is the same value as powermetrics' "pkg idle" measurement (i.e. task_power_info::task_platform_idle_wakeups obtained from the task_info function.) in mac os 10.10 it appears to have been changed to measure interrupt-level wakeups (a superset of idle wakeups), which are less interesting. this is the same value as powermetrics' "intr" measurement (i.e. task_power_info::task_interrupt_wakeups obtained from the task_info function.) requires high perf gpu: many macs have two gpus: a low-power, low-performance integrated gpu, and a high-power, high-performance external gpu. using the high-performance gpu can greatly increase pow...
BloatView
number to look for the worst offenders. (should be zero!) objects total - the total count of objects allocated of a given class. objects rem - the number of objects allocated of a given class that weren't deleted. (should be zero!) interesting things to look for: are your classes in the list? - look! if they aren't, then you're not using the ns_impl_addref and ns_impl_release (or ns_impl_isupports which calls them) for xpcom objects, or moz_count_ctor and moz_count_dtor for non-xpcom objects. not having your classes in the list is not ok. that means no one is looking at them, and we won't be able to tell if someone introduces a leak. (see below for how to fix this.) the bytes leaked for your classes should be zero! - need i say more? if it isn't, you should use the other tools to fix...
... if your object is not an xpcom object then some manual editing is in order. the following sample code shows what must be done: mytype::mytype() { moz_count_ctor(mytype); ... } mytype::~mytype() { moz_count_dtor(mytype); ... } ...
DMD
home/njn/moz/mi5/go64dmd/memory/replace/dmd/../../../../memory/replace/dmd/dmd.cpp:1286) #02: malloc (/home/njn/moz/mi5/go64dmd/memory/build/../../../memory/build/replace_malloc.c:153) #03: moz_xmalloc (/home/njn/moz/mi5/memory/mozalloc/mozalloc.cpp:84) #04: nscyclecollectingautorefcnt::incr(void*, nscyclecollectionparticipant*) (/home/njn/moz/mi5/go64dmd/dom/xul/../../dist/include/nsisupportsimpl.h:250) #05: nsxulelement::create(nsxulprototypeelement*, nsidocument*, bool, bool,mozilla::dom::element**) (/home/njn/moz/mi5/dom/xul/nsxulelement.cpp:287) #06: nsxblcontentsink::createelement(char16_t const**, unsigned int, mozilla::dom::nodeinfo*, unsigned int, nsicontent**, bool*, mozilla::dom::fromparser) (/home/njn/moz/mi5/dom/xbl/nsxblcontentsink.cpp:874) #07: nscomptr<...
... const (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:933) 0x7f6860fdb7af #04: nscyclecollector::sizeofincludingthis(unsigned long (*)(void const*), unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*) const (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3029) 0x7f6860fdb6b1 #05: cyclecollectormultireporter::collectreports(nsimemorymultireportercallback*, nsisupports*) (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3075) 0x7f6860fde432 #06: nsmemoryinfodumper::dumpmemoryreportstofileimpl(nsastring_internal const&) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper::dumpmemoryreportstofile(nsastring_internal const&, bool, bool) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:344) 0x7f6860febaf9 ...
JS::PerfMeasurement
the js::perfmeasurement class, found in jsperf.h, lets you take detailed performance measurements of your code. it is a stopwatch profiler -- that is, it counts events that occur while code of interest is running; it does not do call traces or sampling. ...
..._migrations migrations of the profiled thread from one cpu core to another these events map directly to "generic events" in the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; for instance, we can't tell you exactly which level of cache you get misses for if you measure cache_misses. we also can't guarantee that all platforms will support all event types, once we have more than one back end for this interface. here is the complete c++-level api: perfmeasurement::eventmask this is an enumeration defining all of the bit mask values in the above table. you bitwise-or the ones you want together and pass them to the constructor. perfmeasurement::all in a constructor call, this special value means "measure everything that can poss...
TimerFirings logging
it. nspr_log_modules=timerfirings:4 output once enabled, timerfirings will print one line of logging output per timer fired. it's best to redirect this output to a file. the following sample shows the basics of this output. -991946880[7f46c365ba00]: [6775] fn timer (slack 100 ms): layeractivitytracker -991946880[7f46c365ba00]: [6775] fn timer (one_shot 250 ms): presshell::spaintsuppressioncallback -991946880[7f46c365ba00]: [6775] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler -991946880[7f46c365ba00]: [6775] iface timer (one_shot 200 ms): 7f46964d7f80 -1340643584[7f46c365ec00]: [6775] obs timer (slack 1000 ms): 7f46a95a0200 each line has the following information. the first two values identify the thread. this is not especially useful. ...
...6c365ec00]: [6775] obs timer (slack 1000 ms): 7f46a95a0200 each line has the following information. the first two values identify the thread. this is not especially useful. the next value is the process id (pid). this is useful in a multi-process scenario. next is the timer kind, one of fn (function), iface (interface) or obs (observer), which are the three kinds of timers that gecko supports. then comes the function kind, one of one_shot (a single-use timer), slack or precise (repeating timers of differing precision). then comes the timer period, measured in milliseconds. finally there is the identifying information for the timer. function timers have an informative label. interface and observer timers only have an address, which is less useful, but they are uncommon enough t...
TraceMalloc
if filename is -, nothing is written to a file, but tracemalloc will be active and will track live allocations and their stack traces. ...
... by dmd and removed from the codebase. this documentation is only relevant to older versions of the codebase that still contain it. tracemalloc captures stack traces of all malloc, calloc , realloc, and free calls (this currently covers all operator new and delete calls in mozilla, too). to enable tracemalloc in your build, configure with --enable-trace-malloc. the built mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary format to the given file. if filename is -, nothing is written to a file, but tracemalloc will be active and will track live allocations and their stack traces. --shutdown-leaks=filename on shutdown, the application will save liv...
Performance
igation techniques. automated performance testing and sheriffing information on automated performance testing and sheriffing at mozilla. best practices for front-end engineers tips for reducing impacts on browser performance in front-end code. memory profiling and leak detection tools the developer tools "memory" panel the memory panel in the devtools supports taking heap snapshots, diffing them, computing dominator trees to surface "heavy retainers", and recording allocation stacks. about:memory about:memory is the easiest-to-use tool for measuring memory usage in mozilla code, and is the best place to start. it also lets you do other memory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports. a...
...n characteristic. see also the documentation on leak-hunting strategies and tips. profiling and performance tools profiling with the developer tools profiler the profiler built into the developer tools has a high-level waterfall, detailed call tree, allocations and gc profiling, and flame graphs. it is available on all platforms and release channels, and also supports remote profiling b2g and fennec. profiling with the firefox profiler the firefox profiler is a good tool to start with, particularly for understanding where time is spent within c++ code in firefox. profiling with instruments how to use apple's instruments tool to profile mozilla code. profiling with xperf how to use microsoft's xperf tool to profile...
A guide to searching crash reports
ignature, date, platform, product, version, etc. grouping you can cluster the results of each search into groups using the same criteria. to achieve full power and flexibility requires a good understanding of both of these functions. search is easy to understand, but the grouping capabilities are easy to overlook. searching the search form you can get to the search page by clicking on the "super search" link near the toolbar at the top right of any page in crash-stats. this brings up a search form like the one in the following screenshot. fields are provided for four common search criteria: product, version, platform, and process type. the product field is pre-populated with "firefox" because that is a common case. as the fine print says, the default date range is the past week. th...
... values (such as numeric fields) often don't group well. for example, if we do a default search grouped by uptime we get results like those in the following screenshot. in this example the top 10 groups account for less than 12% of all crashes, and there is an extremely long tail. these results would be improved by using numeric ranges instead of individual values, but unfortunately that isn't supported. advanced usage the combination of searching and grouping is powerful. searches find crash reports that match particular criteria, and grouping organizes those crash reports into interesting groups. when a search is performed, the page's url is updated to include the search parameters. this means that the results of any search can be easily shared by copying and pasting the page's url. ...
L20n HTML Bindings
le}}/strings.l20n", "/shared/{{locale}}/date.l20n"¨ ] } make html elements localizable use the data-l10n-id attribute on an html element to mark it as localizable. <p data-l10n-id="about"></p> notice that you don't have to put the text content in the html anymore (you still can if you want to). all content lives in the localization resources. a safe subset of html elements (e.g. em, sup), attributes (e.g. title) and entities can be used in translations. in addition to the pre-defined whitelists, any element found in the original source html is allowed in the translation as well. consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <input value...
...tion about the available and the default locales, l20n will switch to the monolingual mode. you can then embed localization resources right in your html. <script type="application/l20n"> <brandname "firefox"> <about "about {{ brandname }}"> </script> an alternative is to include localization resources in script elements. note that this still only works for a single language. we plan to add support for a language pack service in the future that can tap into this scenario on the client side. <script type="application/l20n" src="../locales/strings.l20n"></script> note that you currently cannot use the manifest file and manually add resources via script tags at the same time (bug 923670). ...
McCoy
c keys and other mccoy data are kept in a profile folder separate from the application so you can uninstall and reinstall without losing your precious keys. backing up data if you need to backup your data or move it from one machine to another you need to take a copy of the profile folder. this is located in: %appdata%\mozilla\mccoy (windows) ~/.mozilla/mccoy (linux) ~/library/application support/mccoy (mac os x) it is highly recommended that you back up your profile folder and store it in a safe location whenever you create a new key; without a backup, there is no way to recover your private keys if they are lost! running mccoy to run mccoy simply run the mccoy executable (or the mccoy application on os x). the first time it runs it will ask you to create a master password. it is...
... to run mccoy simply run the mccoy executable (or the mccoy application on os x). the first time it runs it will ask you to create a master password. it is strongly recommended that you use a password to protect your mccoy data. once you have a password set you can change it from the keys menu and you will have to enter it each time you run mccoy. signing from command line currently there is no support to run mccoy from command line under windows, but it is planned to add this support in the future. however, there are several external and unofficial tools which enable signing from command line: uhura - part of the mxtools package from softlights http://www.softlights.net/projects/mxtools/uhura.html signontheline - an extension to mccoy - important: you have to checkout rev 222, later re...
Optimizing Applications For NSPR
this has proven to be quite challenging, a challenge that was met to a large degree, but there is always room for improvement. the casual client may not encounter a need to know the details of the shortcomings to the level described here, but if and when clients become more sophisticated, these issues will certainly surface. this memo is by no way complete. multiplatform do not call any blocking system call from a local thread. ...
...not see the data as intended because the stack has been swapped out to the shadow stack and the current thread's stack now occupies the windows stack. this can be difficult to diagnose. for complete cross platform portability, do not take the address of a stack variable and make that address available to another thread. for more details, see the memo on automatic addresses. windows 3.1 does not support 64 bit file offsets. the nspr 64 bit file offset apis map to windows 3.1 32 bit file offset apis. you may use nspr's 64bit file offset apis in your windows 3.1 applications for cross platform consistency, but do not expect to see real 64 bit file offset behavior. on windows 3.1, when nspr detects a value in a 64 bit file offset greater than 32bit significance, it terminates with an assert. t...
NSPR Error Handling
function. pr_io_pending_error an i/o operation has been attempted on a file descriptor that is currently busy with another operation. pr_directory_open_error the directory could not be opened. pr_invalid_argument_error one or more of the arguments to the function is invalid. pr_address_not_available_error the network address (prnetaddr) is not available (probably in use). pr_address_not_supported_error the type of network address specified is not supported. pr_is_connected_error an attempt to connect on an already connected network file descriptor. pr_bad_address_error the network address specified is invalid (as reported by the network). pr_address_in_use_error network address specified (prnetaddr) is in use. pr_connect_refused_error the peer has refused to allow the conne...
...empt to use a non-network file descriptor on a network-only operation. pr_not_tcp_socket_error attempt to perform a tcp specific function on a non-tcp file descriptor. pr_socket_address_is_bound_erro attempt to bind an address to a tcp file descriptor that is already bound. pr_no_access_rights_error calling thread does not have privilege to perform the operation requested. pr_operation_not_supported_erro the requested operation is not supported by the platform. pr_protocol_not_supported_error the host operating system does not support the protocol requested. pr_remote_file_error access to the remote file has been severed. pr_buffer_overflow_error the value retrieved is too large to be stored in the buffer provided. pr_connect_reset_error the (tcp) connection has been reset by ...
NSPR Types
ntion types are used for externally visible functions and globals. algebraic types of various lengths are used for integer algebra. miscellaneous types are used for representing size, pointer difference, boolean values, and return values. for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions. calling convention types these types are used to support cross-platform declarations of prototypes and implementations: pr_extern is used for declarations of external functions or variables. pr_implement is used for definitions of external functions or variables. pr_callback is used for definitions and declarations of functions that are called via function pointers. a typical example is a function implemented in an application but called from ...
...64-bit numeric fields in different ways. some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. since the types (long long versus struct longlong) are not type compatible, nspr defines macros to manipulate 64-bit numeric fields. these macros are defined in prlong.h. conscientious use of these macros ensures portability of code to all the platforms supported by nspr and still provides optimal behavior on those systems that treat long long values directly. print64 pruint64 floating-point number type the nspr floating-point type is always 64 bits. prfloat64 native os integer types these types are most appropriate for automatic variables. they are guaranteed to be at least 16 bits, though various architectures may define them to be wi...
PRNetAddr
r_af_inet6 for raw.family, pr_af_inet for inet.family, pr_af_inet6 for ipv6.family. data raw address data. port port number of tcp or udp, in network byte order. ip the actual 32 (for inet.ip) or 128 (for ipv6.ip) bits of ip address. the inet.ip field is in network byte order. pad unused. flowinfo routing information. description the union prnetaddr represents a network address. nspr supports only the internet address family. by default, nspr is built to support only ipv4, but it's possible to build the nspr library to support both ipv4 and ipv6. therefore, the family field can be pr_af_inet only for default nspr, and can also be pr_af_inet6 if the binary supports ipv6. prnetaddr is binary-compatible with the socket address structures in the familiar berkeley socket interface, a...
...(note that prnetaddr does not have the length field that is present in struct sockaddr_in on some unix platforms.) the macros pr_af_inet, pr_af_inet6, pr_inaddr_any, pr_inaddr_loopback are defined if prio.h is included. ...
PR_SetConcurrency
numcpus the number of extra virtual processor threads to be created. description setting concurrency controls the number of virtual processors that nspr uses to implement its m x n threading model. the m x n model is not available on all host systems. on those where it is not available, pr_setconcurrency is ignored. virtual processors are actuallyglobal threads, each of which is designed to support an arbitrary number oflocal threads. since global threads are scheduled by the host operating system, this model is particularly applicable to multiprocessor architectures, where true parallelism is possible. however, it may also prove advantageous on uniprocessor systems to reduce the impact of having a locally scheduled thread calling incidental blocking functions. in such cases, all the th...
...trary number oflocal threads. since global threads are scheduled by the host operating system, this model is particularly applicable to multiprocessor architectures, where true parallelism is possible. however, it may also prove advantageous on uniprocessor systems to reduce the impact of having a locally scheduled thread calling incidental blocking functions. in such cases, all the threads being supported by the virtual processor will block, but those assigned to another virtual processor will be unaffected. ...
PR_dtoa
ing the method specified by mode. possible modes are: 0 shortest string that yields d when read in and rounded to nearest. 1 like 0, but with steele & white stopping rule. for example, with ieee 754 arithmetic, mode 0 gives 1e23 whereas mode 1 gives 9.999999999999999e22. 2 max(1, ndigits) significant digits. this gives a return value similar to that of ecvt, except that trailing zeros are suppressed. 3 through ndigits past the decimal point. this gives a return value similar to that from fcvt, except that trailing zeros are suppressed, and ndigits can be negative. 4,5,8,9 same as modes 2 and 3, but usingleft to right digit generation. 6-9 same as modes 2 and 3, but do not try fast floating-point estimate (if applicable). all others treated as mode 2. upon return, the buffer ...
...e similar to that from fcvt, except that trailing zeros are suppressed, and ndigits can be negative. 4,5,8,9 same as modes 2 and 3, but usingleft to right digit generation. 6-9 same as modes 2 and 3, but do not try fast floating-point estimate (if applicable). all others treated as mode 2. upon return, the buffer specified by buf and bufsz contains the converted string. trailing zeros are suppressed. sufficient space is allocated to the return value to hold the suppressed trailing zeros. if the input parameter d is+infinity,-infinity ornan, *decpt is set to 9999. ...
NSS Certificate Download Specification
ny of the binary formats described above. this data must be base64 encoded as described by rfc 1113. following the data should be the following line: -----end certificate----- in a text format download, nss ignores any text before the first begin certificate line, and ignores any text after the first end certificate line. between those two lines, there must be exactly one item of any of the supported binary formats described above, and that one item must be base64 encoded. regardless of which of the supported binary formats is used, the begin and end lines must say certificate, and not any other word (such as key). the begin and end lines must begin and end with 5 dashes, with no extra leading or trailing white space (excluding the end of line characters). importing certificate chains ...
...s administration guide for the most accurate information. for some nss-base servers, the following information is correct. server certificates are imported via the server admin interface. certificates are pasted into a text input field in an html form, and then the form is submitted to the admin server. since the certificates are pasted into text fields, only the text formats described above are supported for servers. the type of certificate being imported (e.g. server or ca or cert chain) is specified by the server administrator by selections made on the admin pages. if a certificate chain is being imported then the first certificate in the chain must be the server or ca certificate, and any subsequent certificates will be added as untrusted ca certificates to the local database. object id...
FIPS Mode - an explanation
t copy of nss. (note, the current version of fips 140 is revision 2, a.k.a. fips 140-2. fips 140-3 is being devised by nist now for adoption in the future.) users who are subject to the fips regulations must ensure that they have mozilla's fips mode enabled when they use mozilla software, in order to be fully conformant. instructions for how to configure firefox into fips mode may be found on support.mozilla.com. is nss fips-140 compliant? mozilla's nss cryptographic software has been tested by government-approved independent testing labs and certified by nist as being fips 140 compliant when operated in fips mode on 4 previous occasions. as of this writing, nss is now being retested to be recertified for the fifth time. nss was the first open source cryptographic library to be fips c...
...ervers. nss divides its operations up into two "devices" rather than just one. one device does all the operations that may be done without needing to authenticate, and the other device stores the user's certificates and private keys and performs operations that use those private keys. how do i put firefox into fips mode? instructions for how to configure firefox into fips mode may be found on support.mozilla.com. some third-parties distribute firefox ready for fips mode, a partial list can be found at the nss wiki. ...
HTTP delegation
port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepa...
...ow that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks. make sure you have completed the nss initialization before you attempt to register the callbacks. look at sec_httpclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefaulthttpclient. ...
HTTP delegation
port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepa...
...ow that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks. make sure you have completed the nss initialization before you attempt to register the callbacks. look at sec_httpclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefaulthttpclient. ...
4.3.1 Release Notes
new in jss 4.3.1 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3.1 requires nss 3.12.5 or higher. ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more information about this security vulnerability. ...
...r tool) at http://mxr.mozilla.org/mozilla/source/security/jss/ the run time behavior of jss can be affected by the nss environment variables. platform information you can check out the source from cvs by cvs co -r jss_4_3_1_rtm jss jss 4.3.1 works with jdk versions 4 or higher we suggest the latest. jss 4.3.1 requires nss 3.12.5 or higher. jss 4.3.1 requires nspr 4.7.1 or higher. jss only supports the native threading model (no green threads). known bugs and issues for a list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3.1 was released. compatibility jss 4.3.1 is backwards compatible with jss 4.2. applications compiled against jss 4.2 will work with jss 4.3.1. the 4.3.1 version of libjss4.so/jss4.dll must only be ...
Build instructions for JSS 4.3.x
ld instructions for jss 4.3.x newsgroup: mozilla.dev.tech.crypto before building jss, you need to set up your system as follows: build nspr/nss by following the nspr/nss build instructions, to check that nss built correctly, run all.sh (in mozilla/security/nss/tests) and examine the results (in mozilla/test_results/security/computername.#/results.html. install a java compiler and runtime. jss supports java version 1.5 or later. we suggest you use the latest. you must have perl version 5.005 or later. now you are ready to build jss. follow these steps: switch to the appropriate directory and check out jss from the root of your source tree. cvs co -r jss_4_3_1_rtm mozilla/security/jss or cvs co -r jss_4_3_rtm mozilla/security/jss setup environment variables needed for compil...
...(or wherever your jdk is installed) export java_home windows build configurations winnt vs win95 as of nss 3.15.4, nspr/nss/jss build generates a "win95" configuration by default on windows. we recommend most applications use the "win95" configuration. if you want jss to be used with your applet and the firefox browser than you must build win95. (see jss faq) the "win95" configuration supports all versions of windows. the "win95" name is historical; it should have been named "win32". to generate a "winnt" configuration, set os_target=winnt and build nspr/nss/jss win95. mac os x it has been recently reported that special build instructions are necessary to succeed building jss on osx. please see howto_successfully_compile_jss_and_nss_for_32_and_64_bits_on_osx_10.6_(10.6.7) for...
JSS
Mozilla › Projects › NSS › JSS
ork in progress, and many portions of any legacy documentation will be re-written over the course of time. stay tuned! legacy jss information can still be found at: source: https://hg.mozilla.org/projects/jss issues: https://bugzilla.mozilla.org/buglist.cgi?product=jss wiki: /docs/mozilla/projects/nss/jss network security services for java (jss) is a java interface to nss. jss supports most of the security standards and encryption technologies supported by nss. jss also provides a pure java interface for asn.1 types and ber/der encoding. jss offers a implementation of java ssl sockets that uses nss's ssl/tls implementation rather than sun's jsse implementation. you might want to use jss's own ssl classes if you want to use some of the capabilities found in nss's ssl/tls l...
... documentation before you use jss, you should have a good understanding of the crypto technologies it uses. you might want to read these documents: introduction to public-key cryptography. explains the basic concepts of public-key cryptography that underlie nss and jss. introduction to ssl. introduces the ssl protocol, including information about cryptographic ciphers supported by ssl and the steps involved in the ssl handshake. for information on downloading nss releases, see nss sources building testing. read using jss to get you started with development after you've built and downloaded it. release notes 4.3.1 release notes 4.3 release notes older release notes build instructions building jss 4.4.x ...
JSS 4.4.0 Release Notes
er. jss 4.4.0 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/jss_4_4_0_rtm/src/ new in jss 4.40 new functionality new functions new macros notable changes in jss 4.40 picks up work done downstream for fedora and rhel and used by various linux distributions with includes:. support for ipv6. support for tls v1.1 and tls v1.2 via nss though jss. bugs fixed in jss 4.4.0 this bugzilla query returns all the bugs fixed in nss 4.4.0: https://bugzilla.mozilla.org/buglist.cgi?product=jss&target_milestone=4.4&target_milestone=4.4&bug_status=resolved&resolution=fixed documentation build instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme platform i...
.../readme platform information you can check out the source from mercurial via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8. jss 4.4.0 requires nss 3.12.5 or higher though nss 3.28.3 is recommended. jss 4.3.1 requires nspr 4.7.1 or higher though nspr 3.13 is recommended. jss only supports the native threading model (no green threads). compatibility jss 3.30 shared libraries are not backward compatible with all older jss 4.3.2 shared libraries. a program linked with older jss 4.3.2 shared libraries will not work with jss 4.4.0 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of jss apis to the functions listed in jss publi...
NSS_3.12.1_release_notes.html
ncy test bug 330622: certutil's usage messages incorrectly document certain options bug 330628: coreconf/linux.mk should _not_ default to x86 but result in an error if host is not recognized bug 359302: remove the sslsample code from nss source tree bug 372241: need more versatile form of cert_nametoascii bug 390296: nss ignores subject cn even when san contains no dnsname bug 401928: support generalized pkcs#5 v2 pbes bug 403543: pkix: need a way to enable/disable aia cert fetching bug 408847: pkix_ocspchecker_check does not support specified responder (and given signercert) bug 414003: crash [[@ cert_decodecertpackage] sometimes with this testcase bug 415167: memory leak in certutil bug 417399: arena allocation results are not checked in pkix_pl_infoaccess_parselocatio...
... bug 439123: assertion failure in libpkix at shutdown bug 440062: incorrect list element count in pkix_list_appenditem function bug 442618: eliminate dead function cert_certpack...
NSS 3.15.1 release notes
h release for nss 3.15. the bug fixes in nss 3.15.1 are described in the "bugs fixed" section below. distribution information nss 3.15.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_1_rtm/src/ new in nss 3.15.1 new functionality tls 1.2: tls 1.2 (rfc 5246) is supported. hmac-sha256 cipher suites (rfc 5246 and rfc 5289) are supported, allowing tls to be used without md5 and sha-1. note the following limitations. the hash function used in the signature for tls 1.2 client authentication must be the hash function of the tls 1.2 prf, which is always sha-256 in nss 3.15.1. aes gcm cipher suites are not yet supported. new functions none...
...he protocol version of tls 1.2 on the wire, value 0x0303. tls_dhe_rsa_with_aes_256_cbc_sha256, tls_rsa_with_aes_256_cbc_sha256, tls_ecdhe_ecdsa_with_aes_128_cbc_sha256, tls_ecdhe_rsa_with_aes_128_cbc_sha256, tls_dhe_rsa_with_aes_128_cbc_sha256, tls_rsa_with_aes_128_cbc_sha256, tls_rsa_with_null_sha256 - new tls 1.2 only hmac-sha256 cipher suites. in sslerr.h ssl_error_unsupported_hash_algorithm, ssl_error_digest_failure, ssl_error_incorrect_signature_algorithm - new error codes for tls 1.2. in sslt.h ssl_hmac_sha256 - a new value in the sslmacalgorithm enum type. ssl_signature_algorithms_xtn - a new value in the sslextensiontype enum type. new pkcs #11 mechanisms none. notable changes in nss 3.15.1 bug 856060 - enforce name con...
NSS 3.15.2 release notes
b/mozilla.org/security/nss/releases/nss_3_15_2_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.2. users are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid uninitialized data read in the event of a decryption failure. new in nss 3.15.2 new functionality aes-gcm ciphersuites: aes-gcm cipher suite (rfc 5288 and rfc 5289) support has been added when tls 1.2 is negotiated. specifically, the following cipher suites are now supported: tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128_gcm_sha256 tls_rsa_with_aes_128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal. new types...
...sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128_gcm_sha256 tls_rsa_with_aes_128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal. new types no new types have been introduced. new pkcs #11 mechanisms no new pkcs#11 mechanisms have been introduced notable changes in nss 3.15.2 bug 880543 - support for aes-gcm ciphersuites that use the sha-256 prf bug 663313 - md2, md4, and md5 signatures are no longer accepted for ocsp or crls, consistent with their handling for general certificate signatures. bug 884178 - add pk11_cipherfinal macro bugs fixed in nss 3.15.2 bug 734007 - sizeof() used incorrectly bug 900971 - nssutil_readsecmoddb() leaks memory bug 681839 - allow ssl_handsha...
NSS 3.16 release notes
m has released network security services (nss) 3.16, which is a minor release. distribution information the hg tag is nss_3_16_rtm. nss 3.16 requires nspr 4.10.3 or newer. nss 3.16 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_rtm/src/ new in nss 3.16 new functionality supports the linux x32 abi. (this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss. new functions in cms.h nss_cmssignerinfo_verify - verify the signature of a single signerinfo. it just verifies the signature, assuming that the certificate has been verified already. new macros in sslproto.h tls_rsa_with_rc4_128_...
...n in sec_pkcs12_new_asafe. bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess. the built-in roots module has been updated to version 1.97, which adds, removes, and distrusts several certificates. the atob utility has been improved to automatically ignore lines of text that aren't in base64 format. the certutil utility has been improved to support creation of version 1 and version 2 certificates, in addition to the existing version 3 support. bugs fixed in nss 3.16 this bugzilla query returns all the bugs fixed in nss 3.16: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.16 ...
NSS 3.23 release notes
ch is a minor release. distribution information the hg tag is nss_3_23_rtm. nss 3.23 requires nspr 4.12 or newer. nss 3.23 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_23_rtm/src/ new in nss 3.23 new functionality chacha20/poly1305 cipher and tls cipher suites now supported (bug 917571, bug 1227905) experimental-only support tls 1.3 1-rtt mode (draft-11). this code is not ready for production use. new functions in ssl.h ssl_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism. clients that perform a version downgrade (which is a dangerous practice) call this with the highest version number that they pos...
... this gives them access to the version downgrade protection from tls 1.3. ...
NSS 3.26 release notes
distribution information the hg tag is nss_3_26_rtm. nss 3.26 requires netscape portable runtime (nspr) 4.12 or newer. ...
...ss_3_26_rtm. nss 3.26 requires netscape portable runtime (nspr) 4.12 or newer. ...
NSS 3.27 release notes
m. nss 3.27 requires netscape portable runtime (nspr) 4.13 or newer. nss 3.27 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_27_rtm/src/ new in nss 3.27 new functionality allow custom named group priorities for tls key exchange handshake (ssl_namedgroupconfig). ...
...illa.org/pub/mozilla.org/security/nss/releases/nss_3_27_rtm/src/ new in nss 3.27 new functionality allow custom named group priorities for tls key exchange handshake (ssl_namedgroupconfig). added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgroupconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft). although the maximum tls version enabled by default is still tls 1.2, there are applications that query the list of tls protocol versions supported by nss, and enable all supported versions. for those applications, updating to nss 3.27 may result in tls 1.3 (draft) to be enabled. the tls 1.3 (draft) protocol can be disabled, by defining symbol ns...
NSS 3.31 release notes
ri.h several new macros that start with pk11uri_pattr_ for path attributes defined in rfc7512. several new macros that start with pk11uri_qattr_ for query attributes defined in rfc7512. notable changes in nss 3.31 the apis that set a tls version range have been changed to trim the requested range to the overlap with a systemwide crypto policy, if configured. ssl_versionrangegetsupported can be used to query the overlap between the library's supported range of tls versions and the systemwide policy. previously, ssl_versionrangeset and ssl_versionrangesetdefault returned a failure if the requested version range wasn't fully allowed by the systemwide crypto policy. they have been changed to return success, if at least one tls version overlaps between the requested range and ...
...allowed by the systemwide crypto policy. they have been changed to return success, if at least one tls version overlaps between the requested range and the systemwide policy. an application may call ssl_versionrangeget and ssl_versionrangegetdefault to query the tls version range that was effectively activated. corrected the encoding of domain name constraints extensions created by certutil nss supports a clean seeding mechanism for *nix systems now using only /dev/urandom. this is used only when seed_only_dev_urandom is set at compile time. cert_asciitoname can handle oids in dotted decimal form now. bugs fixed in nss 3.31 this bugzilla query returns all the bugs fixed in nss 3.31: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advance...
NSS 3.37 release notes
able on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28. an issue where nss erroneously accepted hrr requests was resolved. this issue was found by oss fuzz. added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis of version 3.5.0 or newer. starting with nss version 3.31, an alternative implementation for rng seeding on the ...
..._only_dev_urandom is undefined.) with nss 3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the environment variable nss_seed_only_dev_urandom. with nss 3.37, this alternative implementation for linux has been enhanced to use the glibc function getentropy(), instead of reading from /dev/urandom directly, if the build and runtime linux platform supports it. the ca certificates list was updated to version 2.24. the following ca certificates were removed: cn = s-trust universal root ca sha-256 fingerprint: d8:0f:ef:91:0a:e3:f1:04:72:3b:04:5c:ec:2d:01:9f:44:1c:e6:21:3a:df:15:67:91:e7:0c:17:90:11:0a:31 cn = tc trustcenter class 3 ca ii sha-256 fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06...
NSS 3.39 release notes
39, which is a minor release. distribution information the hg tag is nss_3_39_rtm. nss 3.39 requires nspr 4.20 or newer. nss 3.39 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_39_rtm/src/ new in nss 3.39 new functionality the tstclnt and selfserv utilities added support for configuring the enabled tls signature schemes using the -j parameter. nss will use rsa-pss keys to authenticate in tls. support for these keys is disabled by default but can be enabled using ssl_signatureschemeprefset(). certutil added the ability to delete an orphan private key from an nss key database. added the nss-policy-check utility, which can be used to check an ...
... notable changes in nss 3.39 the tls 1.3 implementation uses the final version number from rfc 8446. previous versions of nss accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter. starting with version 3.39, nss requires the encoding to contain the null parameter. the tstclnt and selfserv test utilities no longer accept the -z parameter, as support for tls compression was removed in a previous nss version. the ca certificates list was updated to version 2.26. the following ca certificates were added: ou = globalsign root ca - r6 sha-256 fingerprint: 2cabeafe37d06ca22aba7391c0033d25982952c453647349763a3ab5ad6ccf69 cn = oiste wisekey global root gc ca sha-256 fingerprint: 8560f91c3624daba9570b5fea0d...
NSS 3.42 release notes
r release. distribution information the hg tag is nss_3_42_rtm. nss 3.42 requires nspr 4.20 or newer. nss 3.42 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_rtm/src/ other releases are available in nss releases. ...
...ps://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_rtm/src/ other releases are available in nss releases. new in nss 3.42 new functionality bug 818686 - support xdg basedir specification new functions none notable changes in nss 3.42 the following ca certificates were added: none the following ca certificates were removed: none added support for some of the testcases from the wycheproof project: bug 1508666 - added aes-gcm test cases bug 1508673 - added chacha20-poly1305 test cases bug 1514999 - added the curve25519 test cases thanks to jonas allmann for adapting these tests. bugs fixed in nss 3.42 bug 1490006 - reject invalid ch.legacy_version in ...
NSS 3.46 release notes
ient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns 0 bug 1532194 - remove or fix -ddebug_$user from make builds bug 1565577 - visual studio's cl.exe -? ...
...ns: 'int' and 'unsigned long' bug 1564714 - print certutil commands during setup bug 1565013 - hacl image builder times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve gcm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line formats bug 1575968 - add strsclnt option to enforce the use of either ipv4 or ipv6 bug 1549847 - fix nss builds on ios bug 1485533 - enable nss_ssl_tests on taskcluster this bugzilla query returns all the bugs fixed in nss 3.46: https://bugzilla.mozilla.org/buglist.cgi?resolution=...
NSS 3.50 release notes
bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 160967...
...use aes-ni for non-gcm aes ciphers on platforms with no assembly-optimized implementation, such as macos. bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is available anyway. this bugzilla query returns all the bugs fixed in nss 3.50: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.50 compatibility nss 3.50 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.
NSS 3.53 release notes
the nss team would like to recognize first-time contributors: jan-marek glogowski jeff walden distribution information the hg tag is nss_3_53_rtm. nss 3.53 requires nspr 4.25 or newer. nss 3.53 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_53_rtm/src/ other releases are available in nss releases. ...
...60 bug 1638289 - avoid multiple definitions of sha{256,384,512}_* symbols when linking libfreeblpriv3.so in firefox on ppc64le bug 1636389 - relocate deprecated seed algorithm bug 1637083 - lib/ckfw: no such file or directory. stop. ...
NSS Sample Code Sample_1_Hashing
he hash of a file and save it to another file. this program illustrates the use of nss message apis. ...
...nst 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. ...
Hashing - sample 1
he mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...nst 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. ...
Utilities for nss samples
rd */ extern char * getpassword(file *input, file *output, char *prompt, prbool (*ok)(char *)); /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option. * * this function supports password extraction from files with * multipe passwords, one for each token. in the single password * case a line would just have the passord whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ extern char * filepasswd(pk11slotinfo * slot, prbool retry, void *arg); /* * getmodulepassword */ ex...
... fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option. * * this function supports password extraction from files with * multipe passwords, one for each token. in the single password * case a line would just have the passord whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ char * filepasswd(pk11slotinfo *slot, prbool retry, void *arg) { char* phrases, *phrase; prfiledesc *fd; ...
sample1
1. a program to compute the hash of a file and save it to another file. ...
...shname; 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. ...
NSS PKCS11 Functions
arameter this function has the following parameter: func a pointer to the callback function to set. description during the course of an ssl operation, it may be necessary for the user to log in to a pkcs #11 token (either a smart card or soft token) to access protected information, such as a private key. such information is protected with a password that can be retrieved by calling an application-supplied callback function. the callback function is identified in a call to pk11_setpasswordfunc that takes place during nss initialization. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo *slot, prbool retry, void *arg); this callback function has the following parameters: slot a pointer to a slot info structur...
...tion. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo *slot, prbool retry, void *arg); this callback function has the following parameters: slot a pointer to a slot info structure. retry set to pr_true if this is a retry. this implies that the callback has previously returned the wrong password. arg a pointer supplied by the application that can be used to pass state information. can be null. this callback function returns one of these values: if successful, a pointer to the password. this memory must have been allocated with pr_malloc or pl_strdup. if unsuccessful, returns null. many tokens keep track of the number of attempts to enter a password and do not allow further attempts after a certain point.
FC_GetMechanismList
a user may call fc_getmechanismlist without logging into the token (to assume the nss user role). ...
...a user may call fc_getmechanismlist without logging into the token (to assume the nss user role). ...
FIPS mode of operation
ession fc_closeallsessions fc_getsessioninfo fc_getoperationstate fc_setoperationstate fc_login fc_logout object management functions these functions manage certificates and keys. fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. fc_encryptinit fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. fc_decryptinit fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512. fc_digestinit fc_digest fc_digestupda...
...te fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. fc_decryptinit fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512. fc_digestinit fc_digest fc_digestupdate fc_digestkey fc_digestfinal signature and mac generation functions these functions support dsa, rsa, ecdsa, and hmac. fc_signinit fc_sign fc_signupdate fc_signfinal fc_signrecoverinit fc_signrecover signature and mac verification functions these functions support dsa, rsa, ecdsa, and hmac. fc_verifyinit fc_verify fc_verifyupdate fc_verifyfinal fc_verifyrecoverinit fc_verifyrecover dual-function cryptographic functions fc_digestencryptupdate fc_decryptdigest...
NSS tools : cmsutil
encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only). -g include a signing time attribute (sign only). -h num generate email headers with info about cms message (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). ...
...-u certusage set type of cert usage (default is certusageemailsigner). -y ekprefnick specify an encryption key preference by nickname. usage encrypt example cmsutil -c [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, . . ...
troubleshoot.html
nformation on troubleshooting the nss and jss build and test systems, including known problems and configuration suggestions. if you have suggestions for this page, please post them to mozilla.dev.tech.crypto. building nss having /usr/ucb/bin in the path before /usr/ccs/bin breaks the build on 64-bit solaris. the solaris compiler needs to be workshop-5.0 or greater. the 64-bit builds don't support gcc. if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession...
...or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. some systems may not be configured to allow this many simultaneous connections by default; if the stress tests fail, try increasing the number of simultaneous sockets supported. building jss windows only: the shell invoked by gmake, shmsdos.exe, is likely to crash when invoking some java tools on windows. the current workaround is to use some other shell in place of shmsdos, such as sh.exe, which should be distributed with the cygnus toolkit you installed to build nss. the change is unfortunately rather drastic: to trick gmake, you rename the shell program. ...
pkfnc.html
func a pointer to the callback function to set. description during the course of an ssl operation, it may be necessary for the user to log in to a pkcs #11 token (either a smart card or soft token) to access protected information, such as a private key. such information is protected with a password that can be retrieved by calling an application-supplied callback function. the callback function is identified in a call to pk11_setpasswordfunc that takes place during nss initialization. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo *slot, prbool retry, void *arg); this callback function has the following parameters: slot ...
... void *arg); this callback function has the following parameters: slot a pointer to a slot info structure. retry set to pr_true if this is a retry. this implies that the callback has previously returned the wrong password. arg a pointer supplied by the application that can be used to pass state information. can be null. this callback function returns one of these values: if successful, a pointer to the password. this memory must have been allocated with pr_malloc or pl_strdup. if unsuccessful, returns null. many tokens keep track of the number of attempts to enter a password and do not allow further attemp...
sslintro.html
ome of the ssl header files provided as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use by the nss implementation of ssl. you should use only the ssl apis (and related certificate, key, and pkcs #11 apis) that are described in this document, the ssl reference. other apis that may be exposed in the header files are not supported for application use. initialization initialization includes setting up configuration files, setting global defaults, and setting up callback functions. functions used in the initialization part of an application can include the following: pr_init. initializes nspr. must be called before any other nss functions. pk11_setpasswordfunc. sets the global callback function to obtain p...
...er preference. one of these functions must be called before any cryptographic operations can be performed with nss. ssl_cipherprefsetdefault. enables all ciphers chosen by user preference. optional. initializing caches ssl peers frequently reconnect after a relatively short time has passed. to avoid the overhead of repeating the full ssl handshake in situations like this, the ssl protocol supports the use of a session cache, which retains information about each connection, such as the master secret generated during the ssl handshake, for a predetermined length of time. if ssl can locate the information about a previous connection in the local session cache, it can reestablish the connection much more quickly than it can without the connection information. by default, ssl allocates on...
NSS Tools cmsutil
essage for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only). -g include a signing time attribute (sign only). -h num generate email headers with info about cms message (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, . . . specify list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message, list of certificates to send. ...
...s output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, . . . specify list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message, list of certificates to send. -t suppress content in cms message (sign only). -u certusage set type of cert usage (default is <tt>certusageemailsigner)</tt>. <-y ekprefnick specify an encryption key preference by nickname. usage cmsutil -c [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, . . ." -e envfile cmsutil -d [-i infile] [-o outfile] [-d dbdir] [-p password] [-c content] [-n] [-h num...
NSS Tools pk12util
the tool allows you to import certificates and keys from pkcs #12 files into nss or export them and also list certificates and keys in such files. availability see the release notes for the platforms this tool is available on. ...
...be with sha1 and 40 bit rc2 cbc" pkcs #5 pbe ciphers: "pkcs #5 password based encryption with md2 and des cbc" "pkcs #5 password based encryption with md5 and des cbc" "pkcs #5 password based encryption with sha1 and des cbc" it should be noted that the the crypto provider may be the softtoken module or an external hardware module. it may be the case that the cryptographic module does not support the requested algorithm and a best fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. error codes pk12util can return the following values: 0 - no error 1 - user cancelled 2 - usage error 6 - nls init error 8 - certificate db open er...
NSS tools : cmsutil
Mozilla › Projects › NSS › tools › cmsutil
you can then use for future messages (encrypt only). -g include a signing time attribute (sign only). -h num generate email headers with info about cms message (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... specify list of recipients (email addresses) for an encrypted or enveloped message. for ce...
...estination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... specify list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message, list of certificates to send. -t suppress content in cms message (sign only). -u certusage set type of cert usage (default is certusageemailsigner). -y ekprefnick specify an encryption key preference by nickname. usage encrypt example cmsutil -c [-i infile] [-o outfile] [-d dbdir] [-p password] -r "recipient1,recipient2, . . ." -e envfile decode example cmsutil -d [-i infile] [-o outfile...
Multithreading in Necko
warning: the content of this article may be out of date. it was last updated in 2001. necko's primary interfaces are not thread safe. there has not yet been a need to make necko entirely thread safe as most of mozilla (and especially most of gecko) run only on the main/primordial thread. in the future, necko may be made thread safe to support changes to gecko that would put some other processing work on background threads (eg. multithreaded image decoding). however, most necko protocols utilize background threads. background threads are used to manage all i/o operations (with the exception of few cases). most simple protocol handlers (eg. file, finger, datetime) do not worry about threading issues. the internal i/o interfaces default to proxying all callbacks to the main thread.
... a file transport's asyncread method can operate partially on the file transport's thread before proxying data to the main thread. the file transport is confusingly named since it is not restricted to loading files. it simply promises to read from a nsiinputstream (or write to a nsioutputstream) on a background thread. the implementation of the stream should be blocking; however, there is limited support for non-blocking streams. cached page loads, file url loads, and jar url loads all utilize the file transport service. the jar protocol handler, for rexample, passes a special nsiinputstream impl that does gzip decoding on the fly. dns thread (0-1) on most platforms dns requests a processed on a background thread. however, the details of the implementation are heavily platform dependent. f...
Small Footprint
package org.mozilla.javascript.regexp can be removed. rhino will continue to run, although it will not be able to execute any regular expression matches. this change saves 47,984 bytes of class files. debug information debug information in rhino classes consumes about 25% of code size and if you can live without that, you can recompile rhino to remove it. smalljs.jar ant build script in rhino supports smalljar target that will generate smalljs.jar that does not include tools, optimizer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files. to build such minimalist jar without debug information, run the following command from the top directory of rhino distribution: ant clean ant -ddebug=off -dno-regexp=true -dno-e4x=true smalljar if yo...
...zer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files. to build such minimalist jar without debug information, run the following command from the top directory of rhino distribution: ant clean ant -ddebug=off -dno-regexp=true -dno-e4x=true smalljar if you omit -dno-regexp=true, then the resulting smalljs.jar will include regular expression support. similarly omitting -dno-e4x=true results in smalljs.jar that includes runtime support for e4x. ...
Rhino optimization
the compilation time is minimized at the expense of runtime performance. no class files are generated, which may improve memory usage depending on your system. another benefit of the interpreted mode is that the interpreter performs tail-call elimination of recursive functions. also, you must use this optimization level if your code uses continuation objects. if the optimization package is not available, then optimization acts as if it is always -1. 0 no optimizations are performed. the bytecode compiler runs fastest in this mode, but the generated byte code is less efficient. 1-9 all optimizations are performed. ...
...o java vm registers. function call targets are speculatively pre-cached (based on the name used in the source) so that dispatching can be direct, pending runtime confirmation of the actual target. arguments are passed as object/number pairs to reduce conversion overhead. note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels. these features have been removed from the language in ecma, so higher optimization levels are now conformant. future versions may allocate more aggressive optimizations to higher optimization levels. for compatibility with future versions, use level 1. for maximal optimization, use level 9, but retest your application when upgrading to new versions. scripts ...
Rhino requirements and limitations
to use the javaadapter feature or an optimization level of 0 or greater, rhino must be running under a security manager that allows the definition of class loaders. ...
... ...
Rhino shell
el optlevel, which must be -1 or an integer between 0 and 9. see rhino optimization for more details. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160 or 170. see javascript language versions for more information on language versions. -strict enable strict mode. -continuations enable experimental support for continuations and set the optimization level to -1 to force interpretation mode. starting with rhino 1.7 this options is no longer available. note if the shell is invoked with the system property rhino.use_java_policy_security set to true and with a security manager installed, the shell restricts scripts permissions based on their urls according to java policy settings. this is availabl...
...ifferent thread. sync(function) creates a synchronized function (in the sense of a java synchronized method) from an existing function. the new function synchronizes on the this object of its invocation. quit() quit shell. the shell will also quit in interactive mode if an end-of-file character is typed at the prompt. version([number]) get or set javascript version number. if no argument is supplied, the current version number is returned. if an argument is supplied, it is expected to be one of 100, 110, 120, 130, 140, 150, 160 or 170 to indicate javascript version 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 or 1.7 respectively. examples invocation here the shell is invoked three times from the command line. (the system command prompt is shown as $.) the first invocation executes a script spec...
FOSS
and native platforms. getting started here. flusspferd - (newer) c++ bindings libjspp - c++ template based library for extending & embedding spidermonkey; works with spidermonkey 1.8.5 and above, has lots of goodies spiderape - the oldest c++ bindings for spidermonkey trixul - (trixul cvs) - trixul xml-based gui toolkit embeds spidermonkey, using javascript to implement logic behind its gui, supporting calls from javascript to c++ objects rust mozjs - rust bindings used by servo gnome gjs - javascript bindings to gnome (broadly, to any library using the gobject introspection mechanism) objective caml http://alain.frisch.fr/soft.html#spider - bindings to embed spidermonkey in ocaml applications perl http://jspl.msg.mx/ - bindings to cross-embed spidermonkey and perl. i...
...nsions http://code.google.com/p/jslibs/ - zlib, sqlite, nspr, ode, libpng, libjpeg, libffi, (...) libraries for spidermonkey http://www.jsdb.org/ - a js shell with native objects for files, networks, databases, compression, email, etc. http://code.google.com/p/gpsee/ - commonjs platform, native-language module interoperability methods, modules, etc. for spidermonkey. designed to supplement existing embeddings, gpsee ships with a sample trivial embedding, a scripting host, and an augmented version of mozilla's js shell. bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more. http://javalikescript.free.fr/ - a general-purpose javascript platform that aims to provide an extensible tooling framework http://www.synchro.net/ - a te...
Hacking Tips
if gdb does not load the unwinder by default, you can force it to, by using the source command with the js-gdb.py file. setting a breakpoint in the generated code (from gdb, x86 / x86-64, arm) to set a breakpoint the generated code of a specific jsscript compiled with ionmonkey. se...
...00000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 … (gdb) frame 3 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1 passes. /* open your png viewer with the result of iongraph */ this gdb instrumentation is supposed to work with debug builds, or with optimized build compiled with --enable-jitspew configure flag. external programs such as iongraph, dot, and your png viewer are search into the path, otherwise custom one can either be configured with environment variables (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting gdb, or with gdb parameters (set iongraph-bin <path>, set dot-bin <path>, set pn...
SpiderMonkey Internals
ult jsopcode.def on its own to figure out where to plant trap instructions to implement functions like step out, but a future jsdbgapi.h will provide convenience interfaces to do these things. at most one trap per bytecode can be set. when a script (jsscript) is destroyed, all traps set in its bytecode are cleared. watchpoints, for intercepting set operations on properties and running a debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set. line number to pc and back mapping functions. the line-to-pc direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the pc of a for-loop update part, if given the line number of the loop body's closing brace...
... 35 => pc 172 => line 33 line 36 => pc 172 => line 33 line 37 => pc 172 => line 33 line 38 => pc 172 => line 33 line 39 => pc 172 => line 33 line 40 => pc 172 => line 33 jsconfig.h various configuration macros defined as 0 or 1 depending on how js_version is defined (as 10 for javascript 1.0, 11 for javascript 1.1, etc.). not all macros are tested around related code yet. in particular, js 1.0 support is missing from spidermonkey. js.cpp, jsshell.msg the "js shell", a simple interpreter program that uses the js api and more than a few internal interfaces (some of these internal interfaces could be replaced by jsapi.h calls). the js program built from this source provides a test vehicle for evaluating scripts and calling functions, trying out new debugger primitives, etc. a look at the p...
JIT Optimization Outcomes
target of the property access doesn't guarantee that it is an simd object. accessnottypedobject the observed type of the target of the property access doesn't guarantee that it is a typedobject. accessnottypedarray accessnotstring statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled. simdtypenotoptimized the type observed as being retrieved from this property access did not match an optimizable type. unknownsimdproperty the property being accessed on the object is not one of the optimizable property names. hascommoninliningpath inlined dom monomorphic polymorphic inline cache outcomes outcomes descr...
...ction call. the interpreted callee is a bound function generated from function.prototype.bind that failed some sub-checks. (expand) cantinlinenativenospecialization unable to inline function call. ion does not have built-in specialization for the native (implemented in c++) callee function. cantinlinenativebadform unable to inline function call. the native callee function was called with an unsupported number of arguments, or calling non-constructing functions with new. cantinlinebadtype unable to inline function call. the native callee function was called with arguments with types that the built-in specialization does not support. for example, calling math functions on objects. cantinlinenativenotemplateobj unable to inline function call. cannot inline a native constructor (e.g., new...
JSAPI Cookbook
copyz(cx, "dave")); if (!name_str) return false; js::autovaluearray<2> args(cx); args[0].setstring(name_str); args[1].setint32(24); /* step 3 - call |new person(...args)|, passing the arguments. */ js::rootedobject obj(cx, js_new(cx, constructor, args)); if (!obj) return false; calling a global js function // javascript var r = foo(); // where f is a global function /* jsapi * * suppose the script defines a global javascript * function foo() and we want to call it from c. */ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * suppose f is a local c variable of type js::value. */ js::autovalu...
... to return false to signal failure to the caller. // javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror(cx, "failed to grow %s: too many greenflies.", varietal); return false; to internationalize your error messages, and to throw other error types, such as syntaxerror or typeerror, use js_reporterrornumber instead. javascript also supports throwing any value at all, not just error objects. use js_setpendingexception to throw an arbitrary js::value from c/c++. // javascript throw exc; /* jsapi */ js_setpendingexception(cx, exc); return false; when js_reporterror creates a new error object, it sets the filename and linenumber properties to the line of javascript code currently at the top of the stack. this is usually the li...
JSFastNative
*cx, unsigned int argc, jsval *vp); name type description cx jscontext * the context in which the fast native is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned int the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec). vp jsval * the arguments, including the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below. description the callback should use the following macros to a...
..._this after calling js_set_rval. (js_this may call js_callee.) js_this_object(cx, vp) returns the this argument as a jsobject *, or null on error. native methods must not call js_this_object after calling js_set_rval. (js_this_object may call js_callee.) js_argv(cx, vp) returns the argv pointer. this points to element 0 of an array of argc jsvals, the arguments supplied by the caller. js_rval(cx, vp) returns the jsval that is currently in the return-value slot. js_set_rval(cx, vp, value) sets the return value of the native function. it is safe to call this multiple times within a single call to a jsfastnative. if the jsfastnative returns js_true, the last value passed to this macro will be returned to the caller. on success, t...
JSObjectOps.getRequiredSlot
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.getrequiredslot and setrequiredslot callbacks get and set a required slot—one that should already have been allocated. ...
...j jsobject * the object whose slot we access. slot uint32 the index of the slot to access. see note below. v jsval the value to store in the slot, for jssetrequiredslotop. description get and set a required slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. the native ops (js_objectops, see js/src/jsobj.cpp) access slots reserved by including a call to the jsclass_has_reserved_slots(n) macro in the jsclass.flags initializer. 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 jsclas...
JS_IsConstructing_PossiblyWithGivenThisObject
obsolete since jsapi 17this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 1.8.5 determine if a special this object was supplied to the constructor. syntax static jsbool js_isconstructing_possiblywithgiventhisobject(jscontext *cx, const jsval *vp, jsobject **maybethis); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp const jsval * maybethis jsobject ** description in the case of a constructor cal...
... vp const jsval * maybethis jsobject ** description in the case of a constructor called from js_constructobject and js_initclass where the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object. in such cases, the following example would provide the additional information of whether a special this was supplied. jsbool foo_native(jscontext *cx, unsigned int argc, jsval *vp) { jsobject *maybethis; if (js_isconstructing_possiblywithgiventhisobject(cx, vp, &maybethis)) { // native called as a constructor if (maybethis) // native called as a constructor with maybethis as 'this' } else { // native called as function, maybethis is still uninitialized } } note: a spidermonkey em...
Parser API
statement. interface letstatement <: statement { type: "letstatement"; head: [ variabledeclarator ]; body: statement; } a let statement. note: the let statement form is spidermonkey-specific. interface debuggerstatement <: statement { type: "debuggerstatement"; } a debugger statement. note: the debugger statement is new in ecmascript 5th edition, although spidermonkey has supported it for years. declarations interface declaration <: statement { } any declaration node. note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the spidermonkey parser. note: declarations in arbitrary nested scopes are spidermonkey-specific. interface functiondeclaration <: function, declaration {...
...ic. enum logicaloperator { "||" | "&&" } a logical operator token. enum assignmentoperator { "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" } an assignment operator token. enum updateoperator { "++" | "--" } an update (increment or decrement) operator token. e4x this section describes node types that are provided for e4x support. e4x has since been removed as of gecko 21. note: e4x is not part of the ecmascript standard (ecma-262), but is a separate standard of its own (ecma-357). declarations interface xmldefaultdeclaration <: declaration { type: "xmldefaultdeclaration"; namespace: expression; } a default xml namespace declaration. expressions interface xmlanyname <: expression { type: "xmlanyn...
Mozilla Projects
ions can verify the integrity of a manifest retrieved over normally insecure channels. midas midas is the code name for gecko's built-in rich text editor. midas can be enabled via javascript on an html document. when midas is enabled, the document becomes editable by the user. scripting for midas is based on the dhtml commands supported by internet explorer. internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko. internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable. once ...
...rovides a platform-independent api for several layers of networking, ranging from transport to presentation layers. this api is used in many mozilla-based client applications (including firefox) and can be used for writing other networking clients. network security services network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. nspr netscape portable runtime (nspr) provides a platform-n...
A Web PKI x509 certificate primer
anssi 2010 4096 200 256 rfc 3766 2358 200 --- bsi 1976 256 256 in other words, sha1 is now deprecated for new uses. we should use at least 3072 key sizes and at least a 256 ecc curve. thus the recommendation here is for the root to be 4096 if using rsa and p384 for the root key. (p384 also chosen for compatibility as most ssl/tls implementations support this part of suite b). error codes in firefox here are some common errors that might be encountered when working with certificates in firefox. error code what it means what can i do sec_error_bad_der a certificate is not properly encoded according to asn.1 (der) encoding re-generate the improperly-encoded certificate sec_error_ca_cert_invalid an en...
...ical that is not handled by mozilla::pkix re-generate the certificate without the extension or with it not marked as critical sec_error_unknown_issuer either a missing intermediate or root certificate is necessary to verify the certificate import the root certificate into firefox or have the server send the intermediate sec_error_invalid_key sec_error_unsupported_keyalg sec_error_expired_issuer_certificate an issuer certificate is too old re-issue the issuer certificate mozilla_pkix_error_ca_cert_used_as_end_entity a certificate with a basic constraints extension with ca:true is being used as an end-entity certificate re-generate the end-entity certificate without the basic constraints extension mozilla...
XForms Accessibility
implementation of accessible objects for xforms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module. xforms elements behavior is implemented in accordance with accessible toolkit checklist. in general, when elements are similar to html elements, they are exposed to msaa/atk in a similar way. get build subsections below explain how you can obtain accessible xforms-enabled build. ...
... some clarification about navindex. he wrote: navindex was in xforms - it was stripped out as it was believed the focus model was dependent on the content which used it. so, yes we don't care about navindex in xforms. if you use xhtml1.x use tabindex. if you use xhtml2 use nextfocus. therefore since mozilla xforms works in xhtml (1.x) or xul documents only then we use tabindex instead. note, we support -moz-user-focus style neither for xhtml or xul. at api accessible properties this section describes common rules how accessibility properties are formed for forms control elements. name it is formed from value of child xforms label element if the element doesn't have labelledby attribute. description it is formed from value of child xforms hint element if the element doesn't have descr...
Places Developer Guide
o access other properties of the visit. // the time is the time at which the visit occurred, in microseconds. }, onitemmoved: function(id, oldparent, oldindex, newparent, newindex) { // oldparent and newparent are the ids of the old and new parent folders of the moved item. }, queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_error_no_interface; }, }; // register the observer with the bookmarks service var bmsvc = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); bmsvc.addobserver(observer, false); // un-register the observer when done. bmsvc.removeobserver(observer); html import/export the nsiplacesimportexpor...
...the service is uri-centric, meaning that consumers can tag uris directly, without first creating a bookmark. the unique identifier is the uri, and all apis require uris as nsiuri objects. // get the tagging s...
The Publicity Stream API
cation usage. the publicity stream is provided as a central place for applications to publicize application usage for the purpose of notifying a user's friends of the applications which their friends are using. it is not meant as a general application messaging system. accessing the api the publicity api can be enabled by including a javascript library. this library will detect whether native api support is enabled by the user's browser, if not it will shim in a pure html implementation. [is this still doable?] the javascript 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. publicity stream api (navigator.apps.publicity.*) the publicity api is exposed as properties on the ...
...ite is not allowed to post to the publicity stream networkerror - if the publicity server is unreachable activityparseerror - if the activity contains syntax errors (not proper json) invalidactivity - if the activity contains semantic errors (i.e. missing required properties) finally, the publicizeactivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. getpublicitystream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <date> ], [ before: <date> ], [ count: <int> ]): provides a means for a web store to receive a list of the current user's socially relevant app activity by being called from an origin which hosts a web store. it is not recommended that applications consume the ...
extIPreferenceBranch
astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root. all readonly attribute nsivariant array of extipreference listing all preferences in this branch. events readonly attribute extievents the events object for the preferences supports: "change" methods has() check to see if a preference exists. boolean has(in astring aname) parameters aname the name of preference return value true if the preference exists, false if not get() gets an object representing a preference extipreference get(in astring aname) parameters aname the name of preference return value a preference object, or null if the pr...
...ue means that to javascript code the value will appear as a value of the same type as is used in the preferences file and no coercion will occur. a quoted string in the preference file will always appear as a string, even if the value of the string is "true" or "false". an integer preference appears as a javascript number, and a boolean appears as a javascript boolean. there are no other types supported by the preference subsystem. setvalue() sets the value of a preference with the given name. void setvalue(in astring aname, in nsivariant avalue) parameters aname the name of a preference avalue the value of a preference return value reset() resets all preferences in a branch back to their default values. note: this function has not been implemented and will raise an excep...
Bundling multiple binary components
gecko is created. if the component uses only "frozen" xpcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example). the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example). possible solutions this article covers two possible ways to make binary components support multiple version of gecko: dynamic method loading stub loader dynamic method loading the idea with this approach is to figure out all the methods imported from gecko and dynamically load the methods. create small wrappers for calling the m...
...ilenames. one for each version of gecko and os platform. the real components are not in the "components" folder, but are in a side folder ("libraries" in the sample). the real components are manually loaded and registered using the stub ("krealcomponent" in the sample). this approach uses one binary component for each version of gecko and platform, plus the stub loader component therefore, to support 2 gecko versions on three platforms, you need seven components (6 real components + 1 stub). on the other hand, this approach is much more simple than the dynamic loading approach. the stub component can be either binary or javascript, but it is far easier in javascript is cross-platform and does not have compile- or load- time compatibility problems. the gears project contains an example of...
XPCOM glue
Mozilla › Tech › XPCOM › Glue
ependent glue. code which wishes to use only frozen symbols but can tolerate a load-time dependency on xpcom.dll should link against xpcomglue_s.lib and xpcom.lib. it should not link against xpcom_core.lib. this is the case for xpcom components, because they are loaded into mozilla which already has full xpcom loaded and initialized. frozen linkage: standalone glue (no dll dependencies) note: support for locating a standalone glue was removed in gecko 6.0. use this when you have a custom application where you want to embed gecko to show webpages in your own window. i.e. this linkage strategy is used when an embedder needs to bootstrap xpcom by finding a compatible gre on disk and loading it. in order to use xpcom, the embedding application first needs to find where the xpcom runtime is...
...endency on xpcom.dll should #define xpcom_glue 1 while compiling, and link against xpcomglue.lib. it should not link against xpcomglue_s.lib or xpcom.lib. embedders using the standalone glue typically also need to avoid linking against nspr as well. however, when using threadsafe together with the glue libraries from gecko 1.8 or later, a special step needs to be taken to use ns_impl_threadsafe_isupportsn. this is because it forces a dependency on the nspr library, which can otherwise be avoided. as described in bug 299664, the preprocessor symbol xpcom_glue_use_nspr needs to be defined. using mozilla internal linkage mozilla internal code defines mozilla_internal_api while compiling and links against xpcom.lib and xpcom_core.lib. in almost all cases embedders should *not* use internal lin...
Using XPCOM Components
frames boolean attribute that indicates whether to search subframes of current document. matchcase boolean attribute that indicates whether to match case in the search. entireword boolean attribute that specifies whether the entire word should be matched or not. once you use the interface to get to the component, you can ask the component what other interfaces it supports. this service, which is defined in the basic nsisupports interface and implemented by all xpcom components, allows you to query and switch interfaces on a component as part of the runtime object typing capabilities of xpcom. it is handled by the queryinterface method, which was introduced in the chapter an overview of xpcom. the xpcom api reference provides a full reference of the xpcom comp...
...t. actually, the getservice() method in the example here calls through to the createinstance() method that is also available from the component object and caches the result, making it a singleton rather than a normal instance. the singleton design pattern that is used to create services is described in xpcom services. remember, queryinterface allows you to query an object for the interfaces it supports. in the case of the snippet in the nsicookiemanager interface, the queryinterface method is being used to get the nsicookie interface from the enumerator so that, for instance, the javascript code can access the value and name attributes for each cookie. note: cookie-manager-ui note that the interface is not part of the component itself. xpcom makes it easy to use components like cookiema...
Creating XPCOM components
ble; however, there may be cases when it's unavoidable. note:this article describes a method that uses xpidl but you should use webidl instead. ...
...tring classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock programming interface defining the weblock interface in xpidl the xpidl syntax scriptable interfaces subclassing nsisupports the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock...
XPCOM hashtable guide
. the first is the hash key and the second is the data to be stored. there are a number of builtin hash keys available in nshashkeys.h, the more useful of which are listed below. key type hashkey class strings nsstringhashkey/nscstringhashkey integers nsuint32hashkey/nsuint64hashkey pointers nsptrhashkey<t> owned interface pointers nsisupportshashkey reference-counted concrete classes nsrefptrhashkey there are a number of more esoteric hashkey classes in nshashkeys.h, and you can always roll your own if none of these fit your needs (make sure you're not duplicating an existing hashkey class though!) once you've determined what hashtable and hashkey classes you need, you can put it all together. a few examples:...
...e not duplicating an existing hashkey class though!) once you've determined what hashtable and hashkey classes you need, you can put it all together. a few examples: a hashtable that maps utf-8 origin names to a dom window - nsinterfacehashtable<nscstringhashkey, nsidomwindow> a hashtable that maps 32 bit integers to floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringhashkey> hashtable api the hashtable classes all expose the same basic api. there are three key methods, get, put, and remove, w...
How to build a binary XPCOM component using Visual Studio
rts: component interface described using idl. the interface defines the methods, including arguments and return types, of the component. component implementation using c++. the implementation is where the methods actually do the work. component factory module, also in c++. the factory is in charge of creating instances of the implementations. let’s specify a simple interface: #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; remember to generate your own guid. the next step is to compile the idl into a type-library (*.xpt) and a c++ header file (*.h), which we can use to define our implementation object. the blank vc++ project has a bat file that ...
...e: #ifndef __specialthing_impl_h__ #define __specialthing_impl_h__ #include "comp.h" #include "nsstringapi.h" #define specialthing_contractid "@starkravingfinkle.org/specialthing;1" #define specialthing_classname "specialthing" #define specialthing_cid { 0x245626, 0x5cc1, 0x11db, { 0x96, 0x73, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispecialthing cspecialthing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cpp file: #include "comp-impl.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code *...
Components.utils.exportFunction
ns that take arguments below. syntax components.utils.exportfunction(func, targetscope[, options]); parameters func : function the function to export. targetscope : object the object to attach the function to. this does not have to be the global window object: it could be any other object in the target window, or an object created by the caller. options : object optional parameter that supplies additional options. the following options are currently defined: defineas: determines the name of the function in targetscope. if this is omitted, you need to assign the return value of exportfunction() to an object in the target scope. allowcallbacks: deprecated/redundant from firefox 34. this option allows the exported function to accept callbacks as arguments. boolean, defaulting to ...
...ents.utils.exportfunction(greetme, contentwindow); either way, code running in the content window's scope can now call the function: // page-script.js var greeting = foo("alice"); console.log(greeting); // "hello alice" export to an existing local object instead of attaching the function to the target's global window object, the caller can attach it to any other object in the target context. suppose the content window defines a local variable bar: // page-script.js var bar = {}; now the add-on script can attach the function to bar: // addon-script.js components.utils.exportfunction(greetme, contentwindow.bar, {defineas: "greetme"}); // page-script.js var value = bar.greetme("bob"); console.log(value); // "hello bob" ...
Components.utils.importGlobalProperties
ort these objects into such a system scope. this function is not intended for sandboxes but for system-privileged scopes. to import these objects into a sandbox, use the wantglobalproperties option in the sandbox constructor. this function is passed an array of strings. each string is the name of an object to import, and will be defined on the importing scope's global. ...
.....] an array of strings. each string is the name of an object to import. example components.utils.import("resource://gre/modules/devtools/console.jsm"); components.utils.importglobalproperties(["atob", "btoa"]); var encoded = btoa("hello"); console.log(encoded); // "sgvsbg8=" console.log(atob(encoded)); // "hello" alternative methods if importglobalproperties does not support the targeted firefox version, here are some alternative methods to import these objects. import from jsm this method worked until blob and file were no longer apart of jsm modules. it is suspected this works up till firefox 35. this imports blob, file, along with the regular services. the reason this works is because js code modules actually have blob and file. cu.import() will return the ...
RefPtr
ariable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class. when should i use nscomptr versus refptr? the rules are simple: use nscomptr to hold pointers to xpcom interfaces, and use refptr to hold pointers to concrete class, even if the concrete class implements one or more xpcom interfaces. ...
...common in implementation details of nscomptr) but not when an instance of the concrete class is assigned directly?). and it's not clear what happens when the compiler does accept this pattern. what goes wrong at runtime - uaf? memory leak? qi failure and null-deref crashes?. note: in the above example, "nscomptr<nsfoo>" might compile and work ok (it won't if your xpcom class multiply-inherits nsisupports). but this is considered bad form, and may soon be made a compile-time error. don't do it! can i queryinterface a refptr to get a nscomptr from the object it points to? sure. instead of using "do_queryinterface()" (which is used for nscomptrs), use "do_queryobject()", which works with refptrs: // let's say nsfoo implements nsifoo and nsibar xpcom interfaces: refptr<nsfoo> foo = new ns...
IAccessibleTable2
other-licenses/ia2/accessibletable2.idlnot scriptable this interface gives access to a two-dimensional table. 1.0 66 introduced gecko 1.9.2 inherits from: iunknown last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) please also refer to the iaccessibletablecell interface. if you want to support older applications you should also support the iaccessibletable interface. method overview [propget] hresult caption([out] iunknown accessible ); [propget] hresult cellat([in] long row, [in] long column, [out] iunknown cell ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult iscolumnselected([in] long column, [out] boolean isselected ); [propget] hresult isrowselected([in] long row, [out] ...
...d. return value e_invalidarg if bad [in] passed. s_ok. summary() returns the summary description of the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult summary( [out] iunknown accessible ); parameters accessible returns a reference to an implementation dependent accessible object representing the table's summary or a null pointer if the table does not support a summary. return value s_false if there is nothing to return, [out] value is null. s_ok. unselectcolumn() unselects one column, leaving other selected columns selected (if any). the behavior should mimic that of the application, but for those applications which do not have a means in the gui to unselect a full column of cells the behavior should be as follows: the entire column of cells for...
imgICache
that means that using getservice in order to obtain it will yield incorrect results. ...
...n nsiuri uri); void removeentry(in nsiuri uri); methods clearcache() evict images from the cache. void clearcache( in boolean chrome ); parameters chrome if true, evict only chrome images. if false, evict everything except 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 empty. nsiproperties findentryproperties( in nsiuri uri ); parameters uri the uri to look up. return value null if the url was not found in the cache.
mozIStorageConnection
storage/public/mozistorageconnection.idlscriptable this interface represents a database connection attached to a specific file or an in-memory database. it is the primary interface for interacting with a database, including creating prepared statements, executing sql, and examining database errors. 1.0 68 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for a general overview on how to use this interface, see storage. method overview void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); ...
...ifficult when you are using the same connection on different threads, or are using a combination of asynchronous and synchronous statement execution. the best way to deal with this is to only execute your statements asynchronously using mozistorageconnection.executeasync(). this method will manage the transactions for you, so you don't have to worry about them. note: the database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception. void begintransactionas( in print32 transactiontype ); parameters transactiontype one of the transaction constants (mozistorageconnection.transaction_deferred, mozistorageconnection.transaction_immediate, mozistorageconnection.transaction_exclusive) clone() clones a dat...
mozIStorageError
the mozistorageerror interface represents errors returned by the storage api, offering attributes to obtain the error code as well as a human-readable error message corresponding to the error that occurred. storage/public/mozistorageerror.idlscriptable 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 attributes attribute type description message autf8string a human readable error string with details; this may be null if no details are available. read only. result long one of the error code values listed under constants on this page. constants constant value description...
...a string or blob exceeds the size limit. constraint 19 aborted due to a constraint violation. internal 2 an internal logic error occurred. mismatch 20 a data type mismatch occurred. misuse 21 library used incorrectly. nolfs 22 attempted to use os features not supported on the host system. auth 23 authorization denied. format 24 auxiliary database format error. notadb 26 the opened file is not a database. perm 3 access permission denied. abort 4 a callback routine requested an abort. busy 5 ...
mozIStorageService
storage/public/mozistorageservice.idlscriptable this interface lets you open a mozistorageconnection to a database file, as well as create backups of an unopened database file. this is the only way to open a database connection. ...
... you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet). each connection uses its own sqlite cache, which is inefficient, so you should use opendatabase() instead of this method unless you need a feature of sqlite that is incompatible with a shared cache, like virtual table and full text indexing support. if cache contention is expected, for instance when operating on a database from multiple threads, using unshared connections may be a performance win. warning: if you have more than one connection to a file, you must use the exact same name for the file each time, including case. the sqlite code uses a simple string comparison to see if there is already a connection. opening a connectio...
mozIStorageStatementWrapper
call the mozistorageconnection interface's createstatement() method, you get a mozistoragestatement which has just direct bindings to sqlite. you can then wrap that statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc. ...
...variables by name as properties, etc. firefox 3.5 note firefox 3.5 adds support for these features directly into the mozistoragestatement interface, so this interface is essentially deprecated. storage/public/mozistoragestatementwrapper.idlscriptable 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 description statement mozistoragestatement the statement that is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently avai...
nsIAbCard
n the addressbook. following a huge refactoring of the address book code, most of the documentation below is out of date. properties aren't stored anymore on the card, except for a handful of them. complex properties are expected to be accessed through a call to getproperty. see //github.com/realityripple/uxp/blob/master//mailnews/addrbook/public/nsiabcard.idl for more details. ...
...arameters agenerateformat the format to present the name in: 0 generated name is displayname 1 lastfirst, formatted following lastfirstformat property in addressbook.properties. 2 firstlast, formatted following firstlastformat property in addressbook.properties. abundle an optional parameter that is a pointer to a string bundle that holds: addressbook.properties. if this bundle is not supplied, then the function will obtain the bundle itself. if cached by the caller and supplied to this function, then performance will be improved over many calls. return value a string containing the generated name. generatephoneticname() generate a phonetic name from the card, using the firstname and lastname values. astring generatephoneticname(in boolean alastnamefirst) parameters ...
nsIAccessible
« gecko at interfaces page summary the nsiaccessible interface is a cross-platform interface that supports platform-specific accessibility apis like msaa and atk. contains the sum of what's needed to support iaccessible as well as atk's generic accessibility objects. can also be used by in-process accessibility clients to get information about objects in the accessible tree. the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text. mozilla creates the implementations of nsiaccessible on demand. [scriptable, uuid=(c7520419-87ec-42bc-98cc-04c0bf173530)] interface nsiaccessible : nsisupports { ... }; accessible/public/nsiaccessible.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / t...
... getstate provides a bit fields of accessible states which describe boolean properties of accessible. groupposition this method returns grouping information. used for tree items, list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible child...
nsIAccessibleHyperLink
is normally 1 for anchors. ...
...is normally 1 for anchors. ...
nsIAsyncInputStream
am. method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream). methods asyncwait() asynchronously wait for the stream to be readable or closed. the notification is one-shot, meaning that each asyncwait call will result in exactly one notification callback. after the oninputstreamready eve...
...vent target. closewithstatus() this method closes the stream and sets its internal status. if the stream is already closed, then this method is ignored. once the stream is closed, the stream's status cannot be changed. any successful status code passed to this method is treated as ns_base_stream_closed, which has an effect equivalent to nsiinputstream.close(). note: this method exists in part to support pipes, which have both an input end and an output end. if the input end of a pipe is closed, then writes to the output end of the pipe will fail. the error code returned when an attempt 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. void closewithstatus( in nsr...
nsIAsyncOutputStream
m. method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underlying stream). methods asyncwait() asynchronously wait for the stream to be writable or closed. the notification is one-shot, meaning that each asyncwait call will result in exactly one notification callback. after the nsioutputstreamcallbac...
...vent target. closewithstatus() this method closes the stream and sets its internal status. if the stream is already closed, then this method is ignored. once the stream is closed, the stream's status cannot be changed. any successful status code passed to this method is treated as ns_base_stream_closed, which has an effect equivalent to nsiinputstream.close(). note: this method exists in part to support pipes, which have both an input end and an output end. if the output end of a pipe is closed, then reads from the input end of the pipe will fail. the error code returned when an attempt 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. void closewithstatus( in ns...
nsIAsyncStreamCopier
netwerk/base/public/nsiasyncstreamcopier.idlscriptable this interface is used to copy the contents of one stream to another. ...
...text); void init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation. the specified observer is notified when the copy completes. void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications. aobservercontext the object to receive notifications with information about the progress of the copy operation. init() initializes the stream copier. note: at least one of the streams must be buffered. void init( in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffere...
nsIAuthPromptCallback
netwerk/base/public/nsiauthpromptcallback.idlscriptable interface for callback methods for the asynchronous nsiauthprompt2 method. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) callers must call exactly one method if nsiauthprompt2.asyncpromptauth() returns successfully. they must not call any method on this interface before nsiauthprompt2.asyncpromptauth() returns. method overview void onauthavailable(in nsisupports acontext, in nsiauthinformation aauthinfo); void onauthcancelled(in nsisupports acontext, in boolean usercancel); methods onauthavailable() authentication information is available. note: any exceptions thrown from this method should be ignored. void onauthavailable( in nsisu...
... usercancel if false, this prompt was cancelled by calling the the cancel method on the nsicancelable; otherwise, it was cancelled by the user. ...
nsICacheEntryDescriptor
32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor. see nsicache for the definitions of the access modes and a thorough description of their corresponding meanings. read only. cacheelement nsisupports get or set the cache data element. this will fail if the cache entry is stream based. the cache entry holds a strong reference to this object. the object will be released when the cache entry is destroyed. file nsifile get the disk file associated with the cache entry. read only. predicteddatasize print64 stores the content-length specified in the http header for this entry. checked befo...
...cache entry is destroyed. file nsifile get the disk file associated with the cache entry. read only. predicteddatasize print64 stores the content-length specified in the http header for this entry. checked before we write to the cache entry, to prevent ever taking up space in the cache for an entry that we know up front is going to have to be evicted anyway. see bug 588507. securityinfo nsisupports get or set security info on the cache entry for this descriptor. this fails if the storage policy is not store_in_memory. storagepolicy nscachestoragepolicy get or set the storage policy of the cache entry. see nsicache for the definitions of the storage policies. methods close() this method explicitly closes the descriptor (optional). void close(); parameters none. doom() this method ...
nsICharsetResolver
intl/chardet/public/nsicharsetresolver.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may request that they be notified when the charset is actually detected. void notifyresolvedcharset( in acstring charset, in nsisupports closure ); parameters charset the detected charset. closure the closure returned by requestcharset(). requestcharset() called to resolve the charset that should be used for parsing the document being loaded fro...
...otified of the final resolved charset when one is available, it can set awantcharset to true. if this is done, the caller of requestcharset is responsible for calling notifyresolvedcharset() and passing it the final resolved charset and the closure that requestcharset set. acstring requestcharset( in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure ); parameters awebnavigation the nsiwebnavigation the document is being loaded in. may be null. achannel the channel the document is coming in from. awantcharset gets set to true if notifyresolvedcharset() should be called with the given aclosure object. aclosure a resulting object which should be passed to notifyresolvedcharset() if awantcharset is set to true. return value the ...
nsIChromeFrameMessageManager
framescript(in astring aurl, in boolean aallowdelayedload); void removedelayedframescript(in astring aurl); methods loadframescript() loads a script into the remote frame. void loadframescript( in astring aurl, in boolean aallowdelayedload ); parameters aurl the url of the script to load into the frame; this must be an absolute url, but data: urls are supported. aallowdelayedload if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available. removedelayedframescript() removes a script from the list of scripts supporting delayed load. void removedelayedframescript( in astring aurl ); parameters aurl the url of the script to rem...
...oad if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available. removedelayedframescript() removes a script from the list of scripts supporting delayed load. void removedelayedframescript( in astring aurl ); parameters aurl the url of the script to remove from the list of scripts supporting delayed load. see also content process event handling nsicontentframemessagemanager nsiframeloader nsiframemessagelistener ...
nsICompositionStringSynthesizer
dom/interfaces/base/nsicompositionstringsynthesizer.idlscriptable this interface is a composition string synthesizer interface that synthesizes composition string with arbitrary clauses and a caret 1.0 66 introduced gecko 26 obsolete gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38. you need to use nsitextinputprocessor instead of this. every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer(). to create an instance for this: var domwindowutils = window.windowutils; var compositionstringsynthesizer = domwindowutils.createcompositionstringsynthesizer(); for example, when you cr...
...sition string set by setstring(). this is optional. i.e., you may not call this before dispatchevent(). void setcaret(in unsigned long aoffset, in unsigned long alength); parameters aoffset caret offset in the composition string. this value must be between 0 and the length of astring of setstring(). alength if you want wide caret, you can set over 0. however, gecko doesn't support wide caret yet. (bug 979112) setstring() sets new composition string. this must be called before every call of dispatchevent(). void setstring(in astring astring); parameters astring new composition string. ...
nsIConsoleMessage
see nsiscripterror for an example. ...
...see nsiscripterror for an example. ...
nsIControllers
windows and text inputs have default controllers that allow commands such as cmd_copy to act on the focused element or window. xul elements can also have controllers, although they do not have any default controllers. implemented by: @mozilla.org/xul/xul-controllers;1. you should not normally need to create an instance, as you normally need to alter the window or element's existing list of controllers. ...
...tions thrown ns_error_failure the id is greater than the number of controllers that have been inserted, or the controller has since been removed. getcontrollercount() returns the current number of controllers. unsigned long getcontrollercount(); parameters none. return value the number of controllers currently in the list of controllers. getcontrollerforcommand() searches for a controller that supports the given command. nsicontroller getcontrollerforcommand( in string command ); parameters command the name of a command, e.g. cmd_copy return value the first controller in the list that supports the given command. getcontrollerid() returns the order of insertion of a controller. unsigned long getcontrollerid( in nsicontroller controller ); parameters controller the controller for wh...
nsICrashReporter
xpcom/system/nsicrashreporter.idlscriptable provides access to crash reporting functionality. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. excepti...
...haracter is '\0'. ns_error_not_initialized if crash reporting not initialized. native code only!appendobjcexceptioninfotoappnotes append note containing an obj-c exception's info. void appendobjcexceptioninfotoappnotes( in voidptr aexception ); parameters aexception nsexception object to append note for. native code only!writeminidumpforexception write a minidump immediately, with the user-supplied exception information. this is implemented on windows only, because seh (structured exception handling) exists on windows only. void writeminidumpforexception( in voidptr aexceptioninfo ); parameters aexceptioninfo exception_info* provided by window's seh. ...
nsICryptoHMAC
netwerk/base/public/nsicryptohmac.idlscriptable this interface provides hmac signature algorithms. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms. these values are to be used by the init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hm...
...d algorithm types. akeyobject object holding a key. to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getservice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed. reset() reinitialize hmac context to be reused with the same settings (the key and hash algorithm) but on different set of data. void reset(); parameters none. update() void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata.
nsIDNSService
to access the service, use: var dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity. this is done by disabling ipv6 on backup connections. ...
... void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read only. constants resolve flag constants various flags that may be ored together to form the aflags parameter passed to asyncresolve() and resolve(). constant value description resolve_bypass_cache (1 << 0) this flag suppresses the internal dns lookup cache. resolve_canonical_name (1 << 1) the canonical name of the specified host will be queried. resolve_priority_medium (1 << 2) the query is given medium priority. if used with low, medium takes precedence. resolve_priority_low (1 << 3) the query is given lower priority. if used with medium, medium takes precedence. ...
nsIDOMChromeWindow
dom/interfaces/base/nsidomchromewindow.idlscriptable this interface is implemented on the window object in chrome. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script. it will be null for domwindows not corresponding to br...
...tems, we must allow the window manager to handle window dragging. this method tells the window manager to start dragging the window. this method will fail unless called while the left mouse button is held down, callers must check this. void beginwindowmove( in nsidomevent mousedownevent ); parameters mousedownevent exceptions thrown ns_error_not_implemented if the operating system does not support this method. getattention() void getattention(); parameters none. getattentionwithcyclecount() same as getattention method excepting that this can specify the maximum number of times to animate the window per system conventions. void getattentionwithcyclecount( in long acyclecount ); parameters acyclecount the maximum number of times to animate the window per system conventions. if set ...
nsIDOMFile
pe "file". this allows the file reference to be saved when the form is submitted while the user is using a web application offline, so that the data can be retrieved and uploaded once the internet connection is restored. this is also used by the datatransfer object to describe files dragged into a web application using drag and drop. ...
...nsisupports, but in the file api specification, it should be a blob. this will likely change in the future, so avoid using any non-standard methods offered by this interface in order to ensure future compatibility. content/base/public/nsidomfile.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports this interface implements the dom file object; for complete documentation, read up on that. see also nsidomfilelist nsidomfileexception datatransfer drag and drop ...
nsIDOMGeoGeolocation
ary the nsidomgeogeolocation interface provides access to geolocation information. you can request a single notification of the user's current position, or you can monitor the position over time. dom/interfaces/geolocation/nsidomgeogeolocation.idlscriptable 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 implemented by: @mozilla.org/geolocation;1. starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geoloca...
... you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); unsigned short watchposition(in nsidomgeopositioncallback successcallb...
nsIDOMGeoPositionCoords
the nsidomgeopositioncoords interface describes a geographical location. dom/interfaces/geolocation/nsidomgeopositioncoords.idlscriptable 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 attributes attribute type description latitude double the user's current latitude, in degrees. read only. longitude double the user's current longitude, in degrees. read only. altitude double the user's current altitude, in meters. zero if the device doesn't support altitude detection. read only. accuracy double the accuracy of position information, in meters. read only. altitudeaccuracy double the accuracy of altitude i...
...read only. heading double the current heading at which the user is moving, in degrees. ...
nsIDOMNode
dom/interfaces/core/nsidomnode.idlscriptable this interface is the primary datatype for the entire document object model. it represents a single node in the document tree. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only. childnodes nsidomnodelist ...
...hild return value clonenode() nsidomnode clonenode( in boolean deep ); parameters deep return value hasattributes() boolean hasattributes(); parameters none. return value haschildnodes() boolean haschildnodes(); parameters none. return value insertbefore() nsidomnode insertbefore( in nsidomnode newchild, in nsidomnode refchild ); parameters newchild refchild return value issupported() boolean issupported( in domstring feature, in domstring version ); parameters feature version return value normalize() void normalize(); parameters none. removechild() nsidomnode removechild( in nsidomnode oldchild ); parameters oldchild return value replacechild() nsidomnode replacechild( in nsidomnode newchild, in nsidomnode oldchild ); parameters newchild oldch...
nsIDOMWindow
dom/interfaces/base/nsidomwindow.idlscriptable this interface is the primary interface for a window object. it represents a single window object that may contain child windows if the document in the window contains an html frameset document, or if the document contains iframe elements. 66 introduced gecko 1.0 deprecated gecko 44 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) starting with firefox 44, this file is empty as its features were either no longer used or are only available from c++ code; see dom/base/nspidomwindow.h for those. while this interface is not officially defined by any standard bodies, it originates from the de-facto dom level 0 standard. starting in firefox 3, dom windo...
... current browsing context. data stored in session storage may be accessed by any site in the browsing context. read only.note: prior to gecko 8.0 this attribute was part of nsidomstoragewindow. textzoom float get or set the document scale factor as a multiplier of the default size. when setting this attribute, an ns_error_not_implemented error may be returned by implementations not supporting zoom. this attribute should always return 1.0 for implementations not supporting text zoom. 1.0 represents normal (unzoomed) size. native code only! top nsidomwindow the root window for the hierarchy of windows that contain this nsidomwindow. this is the window itself if there is no parent, or if the parent is of a different type. the window hierarchy does not cross chrome-c...
nsIDOMWindowInternal
ong xscroll, in long yscroll) nsidomwindow window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. ...
...arprop readonly: returns the window directories toolbar object. closed boolean readonly: this property indicates whether the referenced window is closed or not. crypto nsidomcrypto readonly: returns the browser crypto object, which can then be used to manipulate various browser security features. pkcs11 nsidompkcs11 obsolete: this property is not supported in newer versions of firefox. controllers nsicontrollers readonly: returns the xul controllers of the chrome window. opener nsidomwindowinternal returns a reference to the window that opened this current window. status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text. defaultstatu...
nsIDebug
xpcom/base/nsidebug.idlscriptable provides debugging support for scripted languages, such as javascript, java, python, perl, and so forth. inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/xpcom;1 contract should use ns_debugbreak() from xpcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build. method overview void abort(in string afile, in long aline); void assertion(in string astr, in string aexpr, in string afile, in long aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort() requests the process...
... parameters astr assertion message. aexpr expression that failed. afile file containing assertion. aline line number of assertion. break() requests the software break into a debugger. if no debugger is running then this usually results in a program crash. however, on windows a dialog is first presented giving the user the option of aborting, breaking, or ignoring the request. the dialog can be suppressed by use of the windbgdlg registry key. this allows the debugger to be attached before the software break. void break( in string afile, in long aline ); parameters afile file containing break request. aline line number of break request. warning() shows a warning. void warning( in string astr, in string afile, in long aline ); parameters astr warning message. afile file contain...
nsIDeviceMotion
xpcom/system/nsidevicemotion.idlscriptable this interface is used to implement accelerometer support. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). ...
...rior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only! void removelistener(in nsidevicemotionlistener alistener); void removewindowlistener(in nsidomwindow awindow); native code only! methods addlistener() when called, the accelerometer support implementation must begin to notify the specified nsidevicemotionlistener by calling its nsidevicemotionlistener.onaccelerationchange() method as appropriate to share updated acceleration data. void addlistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object whose nsidevicemotionlistener.onaccelerationchange() method should be called with u...
nsIDirIndexListener
netwerk/streamconv/public/nsidirindexlistener.idlscriptable this interface is used to receive contents of directory index listings from a protocol. they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onindexavailable(in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry. void onindexavailable( in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex ); parameters arequest the request. actxt opaque parameter aindex new index to add. onin...
...rts actxt, in astring ainfo); methods onindexavailable() called for each directory entry. void onindexavailable( in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex ); parameters arequest the request. actxt opaque parameter aindex new index to add. oninformationavailable() called for each information line. void oninformationavailable( in nsirequest arequest, in nsisupports actxt, in astring ainfo ); parameters arequest the request. actxt opaque parameter ainfo new info to add. ...
getFiles
see also nsifile, nsilocalfile, nsisimpleenumerator ...
... see also nsifile, nsilocalfile, nsisimpleenumerator ...
nsIDownloadObserver
netwerk/base/public/nsidownloader.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed. ...
...to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed. ...
nsIEventListenerInfo
content/events/public/nsieventlistenerservice.idlscriptable an instance of this interface describes how an event listener was added to an event target; these are returned by nsieventlistenerservice.getlistenerinfofor, which provides a list of all the listeners to a given event target. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events. read only. capturing boolean indicates whether or not the event listener is in capture ...
...olean indicates whether or not the event listener is in capture mode. read only. insystemeventgroup boolean indicates whether or not the event listener is in the system event group. read only. type astring the type of the event for which the listener was added. read only. methods getdebugobject() returns the debugger object if the debug service is active. nsisupports getdebugobject(); parameters none. return value if jsdidebuggerservice is active and the listener is implemented in js, this returns the listener as a jsdivalue. otherwise null. this is the method you should use if you want to get access to the actual listener, but the debugger service must be already active, which significantly slows down script execution. accordingly, this should probably...
nsIEventTarget
xpcom/threads/nsieventtarget.idlscriptable a target for events. events may be sent to this target from any thread by calling the dispatch method. implement this interface in order to support receiving events from other threads. ...
... xpcom/threads/nsieventtarget.idlscriptable a target for events. events may be sent to this target from any thread by calling the dispatch method. implement this interface in order to support receiving events from other threads. ...
nsIException
read only. filename string filename location. this is the location that caused the error, which may or may not be a source file location. ...
...read only. filename string filename location. this is the location that caused the error, which may or may not be a source file location. ...
nsIExternalProtocolService
and you can ask it to load the url using the default handler. ...
...if neither the application nor the os knows about a handler for the protocol, the object this method returns will represent a default handler for unknown conte...
nsIFTPEventSink
void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. ...
...void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. ...
nsIFeedResult
toolkit/components/feeds/nsifeedresult.idlscriptable this interface provides access to http and parsing metadata for a feed or entry. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing. there may still be feed metadata and entries that were parsed before the error occurred. doc nsifeedcontainer the parsed feed or entry. null if a non-feed was processed. headers nsiproperties the...
...m methods registerextensionprefix() registers a prefix for a namespace used to access an extension in the feed or entry. warning: this method is not implemented at this time. void registerextensionprefix( in astring anamespace, in astring aprefix ); parameters anamespace the namespace for the extension. aprefix the prefix used to access the extension. see also nsisupports nsifeedcontainer nsiuri nsiproperties interwiki link ...
nsIFeedResultListener
toolkit/components/feeds/public/nsifeedlistener.idlscriptable this interface should be implemented by programs to receive events from the feed parser as parsing progresses. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleresult(in nsifeedresult result); methods handleresult() called when feed processing is complete. even if an error occurred during processing, there may be valid data available for feed-level data or entries processed before the error occurred. if you don't care about doing progress display or the like, this is all you need to implement in order to receive the parsed feed. void handleresult( in nsifeedresult result...
...ssing, there may be valid data available for feed-level data or entries processed before the error occurred. if you don't care about doing progress display or the like, this is all you need to implement in order to receive the parsed feed. void handleresult( in nsifeedresult result ); parameters result an nsifeedresult describing the parsed feed. see also nsifeedprogresslistener nsisupports interwiki link ...
nsIGeolocationProvider
after startup() is called, any geo location change should call callback.update(). ...
...startup() is called, any geo location change should call callback.update(). the nsigeolocationprovider interface provides information about the current users location to interested parties via nsigeolocationupdate. after the provider has been initialized, any changes to location should call callback.onrequest(). you may find the wifi access point monitoring service useful if you wish to implement support for wifi-based location services. see dom/src/geolocation/networkgeolocationprovider.js for an example of how to write a geolocation provider. method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fenn...
nsIHttpActivityObserver
netwerk/protocol/http/nsihttpactivityobserver.idlscriptable 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 description isactive boolean true when the interface is active and should observe http activity, otherwise false. if this is false, the observeactivity() method should not be called. read only. note: this attribute is present only for compatibility ...
...as arrived. activity_subtype_response_complete 0x5005 the complete http response has been received. activity_subtype_transaction_close 0x5006 the http transaction has been closed. methods observeactivity() called when activity occurs on the http transport. you should implement this method to perform whatever tasks you wish to perform when http activity occurs. void observeactivity( in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahttpchannel the nsihttpchannel on which the activity occurred. aactivitytype the type of activity that occurred; this will be one of the values specified in activity type constants. aactivitysubtype the subtype that f...
nsIIDNService
netwerk/dns/nsiidnservice.idlscriptable this interface provides support for internationalized domain names, including methods for manipulating idn hostnames according to ietf specification. ...
... netwerk/dns/nsiidnservice.idlscriptable this interface provides support for internationalized domain names, including methods for manipulating idn hostnames according to ietf specification. ...
nsIINIParserWriter
nsiiniparserwriter xpcom/ds/nsiiniparser.idlscriptable allows writing to an ini-format configuration file. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) this interface provides methods that allow writing to ini-format configuration files. ini files contain zero or more sections, denoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. ...
...erface provides methods that allow writing to ini-format configuration files. ini files contain zero or more sections, denoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. to create an nsiiniparserwriter object, you use the nsiiniparserfactory interface to create a parser, then nsisupports.queryinterface() that to get an nsiiniparserwriter, like this: let writer = components.classes["@mozilla.org/xpcom/ini-processor-factory;1"]. .getservice(components.interfaces.nsiiniparserfactory) .createiniparser(somelocalfile) .queryinterface(components.interfaces.nsiiniparserwriter); here, somelocalfile is an nsifile ...
nsIIOService
netwerk/base/public/nsiioservice.idlscriptable this interface provides a set of url parsing utility functions. these are provided as a convenience to the programmer and in some cases to improve performance by eliminating intermediate data structures and interfaces. inherits from: nsisupports last changed in gecko 1.2 this interface duplicates many of the nsiprotocolhandler methods in a protocol handler independent way (for example newuri() inspects the scheme in order to delegate creation of the new uri to the appropriate protocol handler). note: nsiioservice may only be used from the main thread. implemented by @mozilla.org/network/io-service;1 as a service: var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.inte...
...annel newchannelfromuri2( in nsiuri auri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in unsigned long asecurityflags, in unsigned long acontentpolicytype ); please note, if you provide both a loadingnode and a loadingprincipal, then loadingprincipal must be equal to loadingnode->nodeprincipal(). but less error prone is to just supply a loadingnode. keep in mind that uris coming from a webpage should never use the systemprincipal as the loadingprincipal. parameters auri an nsiuri from which to make a channel. aloadingnode the loadingdocument of the channel. the element or document where the result of this request will be used. this is the document/element that will get access to the result of this request. for exam...
nsIJSON
however, you should use native json instead if at all possible. implemented by: @mozilla.org/dom/json;1. ...
...es a javascript object into json format, writing it to a stream. void encodetostream( in nsioutputstream stream, in string charset, in boolean writebom in jsobject value ); parameters stream the nsioutputstream to which to write the json string. charset the string encoding to use. only the five unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported. writebom specify true if you wish to write a byte-order mark (bom) into the stream, otherwise specify false. value the javascript object to encode. legacydecode() decodes a json string. this method accepts slightly more than the exact json syntax; details of extra accepted syntax are deliberately not described. this method is intended for use only by code processing legacy data. ...
nsIJumpListBuilder
modifying an applied jump list is not permitted. callers should begin the creation of a new jump list using initlistbuild(), add sub lists using addlisttobuild(), then commit the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. ...
...additional jump list types. method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host. read only. islistcommitted boolean jumplist management. indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating system. maxlistitems short the maximum number of jump list items the current desktop can support. read only. constants ...
nsIMarkupDocumentViewer
default = true. ...
...l 2 - visual 3 - like the containing document. obsolete since gecko 2.0 bidinumeral octet the type of numerals to display. 1 - depending on context, default is arabic numerals 2 - depending on context, default is hindi numerals 3 - arabic numerals 4 - hindi numerals. bidioptions pruint32 use this attribute to access all the bidi options in one operation. bidisupport octet whether to use platform bidi support or mozilla's bidi support 1 - use mozilla's bidi support 2 - use the platform bidi support 3 - disable bidi support. biditextdirection octet options for bidi presentation. use these attributes to access the individual bidi options. the default direction for the layout of bidirectional text. 1 - left to right 2 - righ...
nsIMemoryMultiReporter
xpcom/base/nsimemoryreporter.idlscriptable reports multiple memory measurements using a callback function that gets called once for each measurement. 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9) if you want to gather multiple measurements in a single operation (such as a single traversal of a large data structure), you can use a multi-reporter to do so. the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. in order for a multi-reporter to gather and generate reports, you need to call collectreports(). this will call the specified callback's nsimemorymultireportercallback.
...of the kind kind_nonheap. note: this is a hack that makes nsimemoryreportermanager.explicit more efficient. this is important; multi-reporters can special-case this operation so it's much faster than gathering all the reports, filtering out the unneeded ones, and adding up the rest. method overview void collectreports(in nsimemorymultireportercallback callback, in nsisupports closure); methods collectreports() void collectreports( in nsimemorymultireportercallback callback, in nsisupports closure ); parameters callback the nsimemorymultireportercallback to call when collection is complete. closure an object containing any additional data your callback might need; this gets passed to the callback. you can specify null if your callback d...
nsIMessageWakeupService
content/base/public/nsimessagewakeupservice.idlscriptable implements the message manager wakeup service; this lets other components be woken up when specific message manager messages arrive. by using this service, you can avoid starting those components until they're needed. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this service was introduced in gecko 5.0 on firefox for android, but was not provided on desktop until gecko 13.0 (firefox 13). there is no idl for this interface. the parentprocessmessagemanager is used for this, so messages send from childprocessmessagemanagers will be heard. requesting wakeups to request a wakeup, a wakeup condition must be registered...
...ate the component as (e.g. "nsimyinterface"). the method to call to instantiate the component (either "getservice" or "createinstance"). a comma-separated list of messages for which your component should be instantiated. alternatively, it is possible to register a wakeup entry programmatically via the nsicategorymanager interface. currently, services must expose a wrappedjsobject in order to support this; however, once bug 593407 is fixed, the service to be woken up must implement nsiframemessagelistener. ...
nsIMicrosummary
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface defines attributes and methods for dealing with microsummaries generated by an nsimicrosummarygenerator. ...
... toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface defines attributes and methods for dealing with microsummaries generated by an nsimicrosummarygenerator. ...
nsIMicrosummaryGenerator
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides access to a microsummary that has been installed in firefox. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded. read only. localuri nsiuri for generators installed by ...
...s( in nsimicrosummarygenerator aother ); parameters aother the generator to compare against. return value a boolean indicating if the two generators are equal. generatemicrosummary() generate a microsummary by processing the generator template against the page content. if a generator doesn't need content, pass null as the parameter to this method. note: in the future, this may be expanded to support rich text content. astring generatemicrosummary( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized. return value the text result of processing the template. see also microsummary topics creating a microsummary ...
nsIModule
xpcom/components/nsimodule.idlscriptable this interface must be implemented by each xpcom component. it is the main entry point by which the system accesses an xpcom component. ...
... parameters acompmgr the global component manager. aclass the classid of object instance requested. aiid the iid of interface requested. aresult the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the requested class is not available. ns_error_no_interface indicates that the requested interface is not supported. registerself() when the nsimodule is discovered, this method will be called so that any setup registration can be preformed. void registerself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype ); parameters acompmgr the global component manager. alocation the location of the nsimodule on disk. aloaderstr opaque ...
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message. ...
... * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool checkcharsetconversion ( out char * fallbackchars...
nsIMsgDatabase
boolean ismdnneeded(in nsmsgkey key); markmdnsent() void markmdnsent(in nsmsgkey key, in boolean...
..., in boolean mark, in nsidbchangelistener instigator); markmdnneeded() mdn (message disposition notification) support. void markmdnneeded(in nsmsgkey key, in boolean bneeded, in nsidbchangelistener instigator); ismdnneeded() markmdnneeded only used when mail server is a pop3 server, or when the imap server does not support user defined permanentflags. boolean ismdnneeded(in nsmsgkey key); markmdnsent() void markmdnsent(in nsmsgkey key, in boolean bneeded, in nsidbchangelistener instigator); ismdnsent() boolean ismdnsent(in nsmsgkey key); markread() methods to get and set docsets for ids. void markread(in nsmsgkey key, in boolean bread, in ...
nsINavHistoryObserver
you can still access the database in this situation but be careful (of what?). ...
...okmarksservice.constants defined in the nsinavbookmarksservice interface. aguid the unique id associated with the page. aadded incremented by query nodes when the visited uri belongs to them. if no such query exists, the history result creates a new query node dynamically. it is used in places views only and can be ignored. using onbeforedeleteuri() in gecko 1.9.1 if you wish to support onbeforedeleteuri() in applications based on gecko 1.9.1, you must implement your observer's queryinterface() method to match on both nsinavhistoryobserver and nsinavhistoryobserver_mozilla_1_9_1_additions, as shown below. queryinterface: function(iid) { if (iid.equals(ci.nsinavhistoryobserver) || iid.equals(ci.nsinavhistoryobserver_mozilla_1_9_1_additions) || iid.equals(ci.nsis...
nsINetworkLinkService
netwerk/base/public/nsinetworklinkservice.idlscriptable network link status monitoring service. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/network/network-link-service;1 as a service: var networklinkservice = components.classes["@mozilla.org/network/network-link-service;1"] .getservice(components.interfaces.nsinetworklinkservice); attributes attribute type description islinkup boolean this is set to true when the system is believed to have a usable network connection. the link is only up when network connections can be established. for example, the link is down during dhcp con...
...us is not currently known, we generally assume that it is up. read only. linkstatusknown boolean this is set to true when we believe that islinkup is accurate. read only. linktype unsigned long the type of network connection, one of the link_type_* constants. read only. note: as of gecko 8.0, all operating systems currently return link_type_unknown. android support was backed out due to perceived security concerns, see bug 691054. as of gecko 28.0 android support is available again, see bug 939680. constants constant value description link_type_unknown 0 we were unable to determine the network connection type. link_type_ethernet 1 a standard wired ethernet connection. link_type_u...
nsIOutputStream
a blocking output stream may suspend the calling thread in order to satisfy a call to close(), flush(), write(), writefrom(), or writesegments(). a non-blocking output stream, on the other hand, must not block the calling thread of execution. note: blocking output streams are often written to on a background thread to avoid locking up the main application thread. ...
...m would block the calling thread for an indeterminate amount of time. this exception may only be thrown if isnonblocking() returns true. ns_error_not_implemented indicates that the stream does not implement this method. typically, output streams that do not have an internal buffer will not implement this method since such an implementation would require an intermediate buffer unless afromstream supported nsiinputstream.readsegments(), but that is not guaranteed. native code only!writesegments low-level write method that has access to the stream's underlying buffer. the reader function may be called multiple times for segmented buffers. this method is expected to keep calling the reader until either there is nothing left to write or the reader returns an error. this method should not call...
nsIParserUtils
parser/html/nsiparserutils.idlscriptable provides non-web html parsing functionality to firefox extensions and xulrunner applications. 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) warning: do not use this from within gecko--use nscontentutils, nstreesanitizer, and so on directly instead. implemented by: @mozilla.org/parserutils;1 as a service: var parserutils = components.classes["@mozilla.org/parserutils;1"] .getservice(components.interfaces.nsiparserutils); method overview astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, ...
...for sanitizer: allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). note: if -moz-binding is absent, properties that might be xss risks in other web engines are preserved! sanitizercidembedsonly (1 << 2) flag for sanitizer: only allow cid: urls for embedded content. at present, sanitizing css backgrounds, and so on., is not supported, so setting this together with sanitizerallowstyle doesn't make sense. at present, sanitizing css syntax in svg presentational attributes is not supported, so this option flattens out svg. sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute. sa...
nsIPipe
read only. ...
... yet been closed, then if that pipe's input end is non-blocking, then the read call will fail immediately with ns_base_stream_would_block as the error condition. however, if that pipe's input end is blocking, then the read call will not return until the pipe has data or until the pipe is closed. this example presumes that the pipe is being filled asynchronously on some background thread. the pipe supports nsiasyncinputstream and nsiasyncoutputstream, which give the user of a non-blocking pipe the ability to wait for the pipe to become ready again. for example, in the case of an empty non-blocking pipe, the user can call nsiasyncinputstream.asyncwait() on the input end of the pipe to be notified when the pipe has data to read (or when the pipe becomes closed). ns_newpipe2() and ns_newpipe() pr...
nsIPlacesImportExportService
the interface name has been kept for compatibility reasons for code using the export service. ...
...just before the import is started. "bookmarks-restore-success" is fired right after the bookmarks are successfully imported. "bookmarks-restore-failed" is fired right after a failure occurs when importing the bookmarks. observers will be passed through their data parameters either "html" if aisinitialimport is false or "html-initial" if aisinitialimport is true. the observer subject will be an nsisupportsprint64 whose value is afolder. void importhtmlfromfiletofolder( in nsilocalfile afile, in print64 afolder, in boolean aisinitialimport ); parameters afile the file to import. afolder the id of the bookmarks folder into which to import the bookmarks. aisinitialimport whether or not this is an initial import. importhtmlfromuri() obsolete since gecko 14.0 (firefox 14.0 / t...
nsIPluginHost
dom/plugins/base/nsipluginhost.idlscriptable please add a summary to this article. ...
...plugintag aresults ); parameters aplugincount optional aresults native code only!handlebadplugin void handlebadplugin( in prlibraryptr alibrary, in nsiplugininstance instance ); parameters alibrary instance native code only!init void init(); parameters none. native code only!instantiatedummyjavaplugin instantiate a "dummy" java plugin if a java plugin that supports npruntime is installed. this plugin is used for exposing window.java and window.packages. if the java plugin supports npruntime and instantiation was successful, aowners instance will be non-null, if not, it will be null. void instantiatedummyjavaplugin( in nsiplugininstanceowner aowner ); parameters aowner native code only!instantiateembeddedplugin void instantiateembeddedpl...
nsIPrefBranch2
adomain the preference on which to listen for changes. this can be the name of an entire branch to observe. for example holding the "root" prefbranch and calling addobserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. aholdweak true holds a weak reference to aobserver. the object must implement the nsisupportsweakreference interface or this will fail. false holds a strong reference to aobserver. removeobserver() remove a preference change observer. note: you must call removeobserver method on the same nsiprefbranch2 instance on which you called addobserver() method in order to remove aobserver; otherwise, the observer will not be removed. void removeobserver( in string adomain, in...
... references which will cause memory leaks. these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be held as a weak reference when it is registered. this insures that sh...
nsIPrivateBrowsingService
the nsiprivatebrowsingservice interface provides access to information about the state of the private browsing feature offered in firefox 3.5 and later. ...
...bases are thrown away when private browsing mode is turned off, and the regular databases are re-activated. the temporary cookie and local storage databases start out empty. extensions that record potentially private information should use this interface to detect whether private browsing mode is enabled, and if it is, avoid saving that information. for details on how to do this, see the article supporting private browsing mode. similarly, plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable. implemented by: @mozilla.org/privatebrowsing;1. to get access to the service from javascript, use: var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .get...
nsIPropertyBag
read only. methods getproperty() get a property value for the given name. nsivariant getproperty( in astring name ); parameters name the name to return the matching property. return value the property matching the given name. ...
...also pay attention to their platform-specific meaning (e.g. on android there is version and kernel_version). ...
nsIProxyInfo
this interface identifies a proxy server. netwerk/base/public/nsiproxyinfo.idlscriptable 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 attributes attribute type description failoverproxy nsiproxyinfo this attribute specifies the proxy to failover to when this proxy fails. failovertimeout unsigned long this attribute specifies the failover timeout in seconds for this proxy. if a nsiproxyinfo is reported as failed via nsiprotocolproxyservice.getfailoverforproxy(), then the failed proxy will not be used again for this many seconds. read only. flags unsigned long this attribute...
...ny undefined bits are reserved for future use. read only. host autf8string this attribute specifies the hostname of the proxy server. read only. note: prior to gecko 1.8 host was available by the host method. next nsiproxyinfo proxy info objects may be chained if several proxies could be treated equivalently. this is used to support proxy failover. read only. obsolete since gecko 1.8 port long this attribute specifies the port number of the proxy server. read only. note: prior to gecko 1.8 port was available by the port method. type acstring this attribute specifies the type of the proxy server as a case insensitive ascii string. som...
nsIPushSubscription
sending a post request to this url routes the message to the instance of firefox that created the subscription. a subscription also has a public key and secret; these are used to encrypt message payloads. this interface resembles pushsubscription from the push api. ...
...t time a message was sent to this subscription, in milliseconds since the epoch. quota long the number of remaining background messages for this subscription, or -1 if exempt. methods getkey() returns a byte array containing the key material for this subscription. the remote server can use these keys to encrypt and authenticate message payloads. the following key names are supported: p256dh the ecdh public key, used as the input keying material in the hkdf invocation during encryption. auth the shared authentication secret, used as the salt in the hkdf invocation. void getkey( in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key ); parameters name the encryption key name. keylen...
nsIRequestObserver
netwerk/base/public/nsirequestobserver.idlscriptable this interface is used by various streams (such as nsichannel ) to indicate the start and end of a request. inherits from: nsisupports last changed in gecko 1.0 method overview void onstartrequest(in nsirequest arequest, in nsisupports acontext); void onstoprequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatuscode); methods onstartrequest() called to signify the beginning of an asynchronous request. note: an exception thrown from onstartrequest has the side-effect of causing the request to be canceled. void onstartrequest( in nsirequest arequest, in nsisupports acontext ); parameters arequest request being observed. acontext user de...
... acontext user defined context. ...
nsISSLErrorListener
method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error. ...
...see also nsisockettransport ...
nsIScreen
widget/nsiscreen.idlscriptable this interface provides information about a display screen. inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) use nsiscreenmanager to obtain references to screens. implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screen = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreen); method overview void getavailrect(out long left, out long top, out long width, out long height); void getrect(out long left, out long top, out long width, out long height); void lockminimumbrightness(in unsigned long brightness); void unlockminimumbrightness(in unsigned long brightness); attributes ...
...creen's color depth; this is the number of bits used to represent a color. read only. pixeldepth long the screen's pixel depth; this is the number of bits used to represent a pixel. read only. rotation unsigned long the screen's current rotation; you may set this to any of the values listed in screen rotation constants. this will only have an effect on platforms that support screen rotation. gecko 1.9.2 note starting in gecko 1.9.2, gecko running on microsoft windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for. constants screen brightness constants constant value description brightness_dim 0 the screen is fu...
nsIScriptableUnicodeConverter
cript string. if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript via components.utils.importglobalproperties) instead of this api. intl/uconv/idl/nsiscriptableuconv.idlscriptable this interface is a unicode encoder for use by scripts. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/scriptableunicodeconverter. to create an instance, use: var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); method overview acstring convertfromunicode(in...
...n unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinputstream converttoinputstream(in astring astring); attributes attribute type description charset string current character set. throws ns_error_uconv_noconv if the requested charset is not supported. methods convertfromunicode() converts the data from unicode to one charset. returns the converted string. after converting, finish should be called and its return value appended to this return value. acstring convertfromunicode( in astring asrc ); finish() returns the terminator string. should be called after convertfromunicode() and appended to that function's return value.
nsISearchEngine
netwerk/base/public/nsibrowsersearchservice.idlscriptable 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, [optional] in astring responsetype, [optional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine. when non-null, this is a unique identifier. description astring a text description describing the...
...sponse to this submission. if null, will default to "text/html". purpose [optional] a string meant to indicate the context of the search request. this allows the search service to provide a different nsisearchsubmission depending on e.g. where the search is triggered in the ui. possible values depend on the application's installed search engines. return value an nsisearchsubmission supportsresponsetype() determines whether the engine can return responses in the given mime type. boolean supportsresponsetype( in astring responsetype ); parameters responsetype the mime type to check for. return value returns true if the engine spec has a url with the given responsetype, false otherwise. see also nsisearchsubmission nsibrowsersearchservice ...
nsISocketTransport
host autf8string get the host for the underlying socket connection. read only. port long get the port for the underlying socket connection. read only. securitycallbacks nsiinterfacerequestor security notification callbacks passed to the secure socket provider via nsisslsocketcontrol at socket creation time. ...
...backs nsiinterfacerequestor security notification callbacks passed to the secure socket provider via nsisslsocketcontrol at socket creation time. this object supports nsibadcertlistener2 and nsisslerrorlistener for ssl connections, and possibly other interfaces. note: this attribute cannot be changed once a stream has been opened. securityinfo nsisupports security info object returned from the secure socket provider. this object supports nsisslsocketcontrol, nsitransportsecurityinfo, and possibly other interfaces. this attribute is only available once the socket is connected. read only. constants timeout type this constants are used by gettransport() and settransport() to specify socket timeouts ...
nsISound
please use the html 5 <audio> tag instead. note that nsisound instances may play the sounds using another thread; however, this is not controlled by the caller. implemented by: @mozilla.org/sound;1. ...
...ould not be used in modern code. please use the html 5 <audio> tag instead. void playeventsound( in unsigned long aeventid ); parameters aeventid an event id which is defined in the constants. playsystemsound() plays the system sound whose name is specified. if the user's system is configured to not play system sound effects, this will do nothing. note: this function is not supported on the macintosh. void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound provided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows. similarly, if you specify "blow", you ...
nsIStreamListener
from: nsirequestobserver last changed in gecko 1.0 classes which want to consume data from a nsichannel need to implement this interface. nsirequestobserver contains two methods. so, in all the three methods - ondataavailable(), nsirequestobserver.onstartrequest() and nsirequestobserver.onstoprequest() have to be implemented. method overview void ondataavailable(in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread. the data can be read from the nsiinputstream object passed as the argument to this method. note: your implementation of this method must read exactl...
...); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread. the data can be read from the nsiinputstream object passed as the argument to this method. note: your implementation of this method must read exactly acount bytes of data before returning. void ondataavailable( in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount ); parameters arequest an nsirequest indicating the source of the data. acontext a user-defined context value. ainputstream an nsiinputstream from which the data is to be read. aoffset number of bytes that were sent in previous ondataavailable() calls for this request. in other words, the sum ...
nsITaskbarPreviewController
widget/public/nsitaskbarpreviewcontroller.idlscriptable this interface is used on microsoft windows to provide the behavior of taskbar previews. its methods and properties are used by the nsitaskbarpreview interface. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) clients should provide their own implementation of this interface. depending on whether the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes need to be implemented. method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsign...
.... see drawthumbnail() for more information. read only. width unsigned long the width in pixels of the preview image. this value may change at any time. see drawpreview() for more information. read only. note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values. the controller and its supporting code, however, may change this values at any time. methods drawpreview() invoked by nsitaskbarpreview when it needs to render the preview. the specified context is attached to a surface with the controller's width and height, the values of which are obtained immediately prior to calling this method. boolean drawpreview( in nsidomcanvasrenderingcontext2d ctx ); parameters ctx an...
nsITaskbarProgress
widget/public/nsitaskbarprogress.idlscriptable starting in windows 7, applications can display a progress notification in the taskbar. this class wraps around the native functionality to do this. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void setprogressstate(in nstaskbarprogressstate state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value description state_no_progress 0 stop displaying progress on the taskbar button. this should be used when the operation is complete or canceled. state_indeterminate 1 display a cycling, indeterminate progress bar. state_normal 2 display a determi...
... indeterminate progress bar. state_normal 2 display a determinate, normal progress bar. state_error 3 display a determinate, error progress bar. state_paused 4 display a determinate progress bar indicating that the operation has paused. methods setprogressstate() sets the taskbar progress state and value for this window. the currentvalue and maxvalue parameters are optional and should be supplied when state is one of state_normal, state_error or state_paused. void setprogressstate( in nstaskbarprogressstate state, in unsigned long long currentvalue, optional in unsigned long long maxvalue optional ); parameters state one of the state constants. currentvalue the current progress value. maxvalue the maximum progress value. exceptions thrown ns_error_illegal_value if currentva...
nsITextInputProcessorNotification
so, nsitextinputprocessorcallback won't be changed for keeping backward compatibility. ...
...so, nsitextinputprocessorcallback won't be changed for keeping backward compatibility. ...
nsITraceableChannel
netwerk/base/public/nsitraceablechannel.idlscriptable this interface is used to allow intercepting of http traffic. it is implemented by nsihttpchannel. 1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g. to xmlhttprequest or to the browser tab that made the request) with your own implementati...
...t, acontext); }, onstoprequest: function(arequest, acontext, astatuscode) { this.responsebody = this.receivedchunks.join(""); delete this.receivedchunks; this.responsestatus = astatuscode; this.originallistener.onstoprequest(arequest, acontext, astatuscode); this.deferreddone.resolve(); }, queryinterface: function(aiid) { if (aiid.equals(ci.nsistreamlistener) || aiid.equals(ci.nsisupports)) { return this; } throw cr.ns_nointerface; } }; var httpresponseobserver = { observe: function(asubject, atopic, adata) { var newlistener = new tracinglistener(); asubject.queryinterface(ci.nsitraceablechannel); newlistener.originallistener = asubject.setnewlistener(newlistener); /////// end - do not edit newlistener.promisedone.then( function() { // no error happen...
nsITreeBoxObject
the nsitreeboxobject interface contains information about the size and layout of a tree. further information about trees is given in the xul tutorial. /layout/xul/base/src/tree/public/nsitreeboxobject.idlscriptable please add a summary to this article. ...
... long row, in nsitreecolumn col); void rowcountchanged(in long index, in long count); void beginupdatebatch(); void endupdatebatch(); void clearstyleandimagecaches(); attributes attribute type description columns nsitreecolumns readonly: obtain the columns. view nsitreeview the view that backs the tree and that supplies it with its data. it is dynamically settable, either using a view attribute on the tree tag or by setting this attribute to a new value. focused boolean whether or not we are currently focused. treebody nsidomelement readonly: obtain the treebody content node. this is a node that corresponds to the treechildren tag. rowheight long readonly: obtai...
nsITreeSelection
layout/xul/base/src/tree/public/nsitreeselection.idlscriptable this interface is used by the tree widget to get information about what is selected. ...
... currentcolumn nsitreecolumn the current column. currentindex long the current item (the one with focus). note: this property indicates only the index of the row with tree cursor around it. this is not a reliable method of determining the selected row, as the selection may include multiple rows, or the focused row may not even be selected. selecteventssuppressed boolean this attribute is a boolean indicating whether or not the "select" event should fire when the selection is changed using one of our methods. a view can use this to temporarily suppress the selection while manipulating all of the indices, for example, on a sort. note: setting this attribute to false will fire a select event. shiftselectpivot long the se...
nsIURI
netwerk/base/public/nsiuri.idlscriptable this is an interface for an uniform resource identifier with internationalization support, offering attributes that allow setting and querying the basic components of a uri, and methods for performing basic operations on uris. inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uniform resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsiurl, impose further structure on the uri. to create an nsiuri object, you should use nsiioservice.newuri(), like this: function makeuri(aurl, aorigincharset, abaseuri) {...
... portion follows the idna draft spec. other parts are url-escaped per the rules of rfc3986. the result is strictly ascii. read only. hasref boolean returns if there is a reference portion (the part after the "#") of the uri. host autf8string the host is the internet domain name to which this uri refers. it could be an ipv4 (or ipv6) address literal. if supported, it could be a non-ascii internationalized domain name. exceptions thrown ns_error_failure if host is not applicable to the uri scheme (e.g. about:blank) note: characters are not escaped. ipv6 addresses are not enclosed in square brackets. hostport autf8string the "host:port" part of the uri (or simply the host, if port is -1). exc...
nsIURLParser
netwerk/base/public/nsiurlparser.idlscriptable specifies the interface to an url parser that attempts to follow the definitions of rfc 2396. ...
...this makes urls with semicolons in them work correctly. ...
nsIUpdate
ample we might select a binary difference patch first and attempt to apply that, then if the application process fails fall back to downloading a complete file-replace patch. this object also contains information about the update that the front end and other application services can use to learn more about what is going on. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update. billboardurl astring the url to a page that is typically localized to display in the upda...
... the update to the user. licenseurl astring the url to an html fragment that contains a license for the update. if this is specified, the user is shown the license file after they choose to install the update, and they must agree to it before the download begins. name astring the name of the update, in the form "application_name update_version" patchcount unsigned long the number of patches supplied by this update. read only. platformversion astring the toolkit version of this update. previousappversion astring the application version prior to the application being updated. selectedpatch nsiupdatepatch the currently selected patch for this update. read only. serviceurl astring the url to the update service that supplied this update. showneverforversion boolean whether to sho...
nsIUpdateItem
toolkit/mozapps/extensions/public/nsiextensionmanager.idlscriptable describes an item managed by the extension system, providing metadata describing the item. 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is obsolete; instead of using the extension manager, you should use the addon manager. method overview void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes ...
...ey to verify updates for this item. this must be the public part of the key that was used to sign update manifests for this add-on. read only. updaterdf astring the url of the update rdf file for this item. read only. version astring the version of the item, in fvf format. read only. xpihash astring the string hash for the xpi file. can be null and if supplied must be in the format of "type:hash" (see the types in nsicryptohash and nsixpinstallmanager.initmanagerwithhashes(). read only. xpiurl astring the url of the xpi where this item can be downloaded. read only. constants item type constants constants representing types of update checks. constants that callers can use to indicate the reason for an add-on update check. in...
nsIUserInfo
toolkit/components/startup/public/nsiuserinfo.idlscriptable these are things the system may know about the current user. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/userinfo;1. to get the service, use: var userinfo = components.classes["@mozilla.org/userinfo;1"] .getservice(components.interfaces.nsiuserinfo); you can then look at the userinfo object's attributes to learn what the system knows about the user. attributes attribute type description linux mac osx os/2 windows domain string read only. the computer's domain, or the domain of its hostname. the domain portion of the email address, if available. not supported. not supported. emailaddress string rea...
... os/2 windows domain string read only. the computer's domain, or the domain of its hostname. the domain portion of the email address, if available. not supported. not supported. emailaddress string read only. the concatenation of the user's login name and the computer's domain. the user's email address as saved in the system address book. not supported. not supported. fullname wstring read only. the user's full name. the user's full name. not supported. not supported. username string read only. the user's login name. the user's login name. not supported. the user's login name. ...
nsIWebBrowserChrome2
embedding/browser/webbrowser/nsiwebbrowserchrome2.idlscriptable an extension to nsiwebbrowserchrome. ...
... statustext status string. null is an acceptable value meaning no status. statuscontext an object that provides context pertaining to the status type. if statustype is status_link, then this may be a dom node corresponding to the source of the link. ...
nsIWebProgress
n some implementations. a nsiwebprogresslistener instance receives notifications for the nsiwebprogress instance to which it added itself, and it may also receive notifications from any nsiwebprogress instances that are children of that nsiwebprogress instance. uriloader/base/nsiwebprogress.idlscriptable 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 description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance. read only. exceptions thrown ns_error_failure indicates that there is no associated...
...ll 0x000000ff <= gecko 1.8.1 0x000001ff > gecko 1.8.1 this flag enables all notifications. methods addprogresslistener() registers a listener to receive web progress events. void addprogresslistener( in nsiwebprogresslistener alistener, in unsigned long anotifymask ); parameters alistener the listener interface to be called when a progress event occurs. this object must also implement nsisupportsweakreference. anotifymask the types of notifications to receive. exceptions thrown ns_error_invalid_arg indicates that alistener was either null or that it does not support weak references. ns_error_failure indicates that alistener was already registered. removeprogresslistener() removes a previously registered listener of progress events. void removeprogresslistener( in nsiwebprogressl...
nsIWinAppHelper
toolkit/xre/nsiwinapphelper.idlscriptable used on windows only to do some work from a special process that gets created with elevated privileges. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsiwinapphelper); the nsixulappinfo and nsixulruntime interfaces are also implemented by "xre/app-info". method overview void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type description usercanelevate b...
...are all true at once: the operating system is at least windows vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it returns false. methods fixreg() obsolete since gecko 1.9 (firefox 3) invokes helper.exe with the /fixreg parameter. note that this parameter was never actually supported. void fixreg(); parameters none. postupdate() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) invokes helper.exe with the /postupdate parameter. this updates the uninstallation log so that the application can be uninstalled correctly after an update. void postupdate( in nsilocalfile logfile ); parameters logfile the file to use for the...
nsIWinTaskbar
by default, there is a single taskbar preview per top level window (excluding pop-ups). this preview is represented by an nsitaskbarwindowpreview object. ...
...read only. defaultgroupid astring the default application user model id the application registers with the system. this id is used by the taskbar for grouping windows and when associating pinned shortcuts with running instances and jump lists. read only. for xulrunner applicatio...
nsIWindowsRegKey
this interface is highly win32 specific. ...
...f a registry value. the numeric values of these constants are taken directly from winnt.h in the ms platform sdk. the microsoft documentation should be consulted for the exact meaning of these value types. this interface is somewhat restricted to using only these value types. there is no method that is directly equivalent to regqueryvalueex or regsetvalueex. in particular, this interface does not support the reg_multi_sz and reg_expand_sz value types. it is still possible to enumerate values that have other types (that is, getvaluetype() may return a type not defined below). constant value description type_none 0 reg_none type_string 1 reg_sz type_binary 3 reg_binary type_int 4 reg_dword type_int64 11 re...
nsIWorkerMessageEvent
erface represents an event in a web worker thread's event queue. 1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data. read only. origin domstring the event's origin. read only. source nsisupports the event's source. read only. methods initmessageevent() initializes the message event. void initmessageevent( in domstring atypearg, in boolean acan...
... acanbubblearg whether or not the event can bubble. acancelablearg whether or not the event can be canceled. adataarg the data to place into the data attribute. ...
nsIWritablePropertyBag2
value value to set the property to. setpropertyasastring() void setprop...
...g prop, in print32 value ); parameters prop property to set the value of. value value to set the property to. setpropertyasint64() void setpropertyasint64( in astring prop, in print64 value ); parameters prop property to set the value of. value value to set the property to. setpropertyasinterface() void setpropertyasinterface( in astring prop, in nsisupports value ); parameters prop property to set the value of. value value to set the property to. setpropertyasuint32() void setpropertyasuint32( in astring prop, in pruint32 value ); parameters prop property to set the value of. value value to set the property to. setpropertyasuint64() void setpropertyasuint64( in astring prop, in pruint64 value ); pa...
nsIXPCException
js/src/xpconnect/idl/xpcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing xpcom interfaces in javascript. ...
...string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only! void stowjsval(in xpcexjscontextptr cx, in xpcexjsval val); native code only! methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval xpcexjsval stealjsval(); parameters none. return value native code only!stowjsval void stowjsval( in xpcexjscontextptr cx, in xpcexjsval val ); parameters cx val remarks components.exception is a javascript constructor to create nsixpcexception objects...
nsIXULBuilderListener
void didrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that has rebuilt the content. ...
... template builder rebuilds its content. void willrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that rebuilds the content. ...
nsIZipEntry
read only. crc32 unsigned long the crc-32 hash of the file in the entry. read only. isdirectory boolean true if the name of the entry ends with '/' and false otherwise. read only. ...
...read only. crc32 unsigned long the crc-32 hash of the file in the entry. read only. isdirectory boolean true if the name of the entry ends with '/' and false otherwise. read only. ...
nsIZipReader
modules/libjar/nsizipreader.idlscriptable this interface provides methods for reading compressed (zip) files. inherits from: nsisupports last changed in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) implemented by: @mozilla.org/libjar/zip-reader;1. to create an instance, use: var zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); about character sets and code pages note: nsizipreader has a code page problem; that is, in the zip specification, filenames are supposed to use 7-bit ascii; however, most modern filesystems use 8 bit code pages, such as utf-8. this can mismatch characters in the nsizipreader api. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey ...
...all functions now pass the filenames (both in and out) as autf8string. so you can now read and extract what you wrote with nsizipwriter. ...
nsIAbCard/Thunderbird3
ace has been overhauled completely for thunderbird 3. documentation for the old nsiabcard interface is currently at nsiabcard. the nsiabcard interface is used to represent and manipulate cards in the address book. in a big change from the original nsiabcard, properties are now stored in a hash table instead of as attributes on the interface, allowing it to be more flexible. properties currently supported on the card: names: firstname, lastname phoneticfirstname, phoneticlastname displayname, nickname spousename, familyname primaryemail, secondemail home contact: homeaddress, homeaddress2, homecity, homestate, homezipcode, homecountry homephone, homephonetype work contact. same as home, but with `work' instead of `home' other contact: faxnumbe...
...ties may not be deleted. however, the implementation will not check this constraint at this method. if such a property is deleted, an error may be thrown when the card is modified at the database level. void deleteproperty(in autf8string name); parameters name the case-sensitive name of the property to set. translateto() translates a card into a specific format. the following types are supported: base64xml xml vcard autf8string translateto(in autf8string atype); parameters atype the type of item to translate the card into. return value a string containing the translated card. exceptions thrown ns_error_illegal_value type not recognized. copy() this function will copy all values from one card to another. void copy(in nsiabcard srccard) parameters srcca...
The Thread Manager
the thread manager, introduced in firefox 3, offers an easy to use mechanism for creating threads and dispatching events to them for processing. only c++ code may use the thread manager and xpcom thread. application/extension javascript should consider using a chromeworker instead.") interfaces there are several interfaces that provide threading support: nsithreadmanager the thread manager itself lets you create threads. nsithread the nsithread interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code. nsithreadpool a thread pool provides a limited set of worker threads. when you dispatch an event to the pool, the pool selects an available worker thread to process the event. nsithreadinternal a subclass of nsithread th...
...ead interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code. nsithreadpool a thread pool provides a limited set of worker threads. when you dispatch an event to the pool, the pool selects an available worker thread to process the event. nsithreadinternal a subclass of nsithread that is implemented by the xpcom thread object to add support for observing dispatch activity on a thread. nsithreadobserver provides the ability to monitor a thread, to receive notifications when events are dispatched to it and when they're finished being processed. nsithreadeventfilter this interface is used by the nsithreadinternal.pusheventqueue() method in nsithreadinternal to allow event filtering. nsirunnable this interface is the base for ...
Troubleshooting XPCOM components registration
n components make sure you are compiling against the right version. if you are testing with a release from mozilla.org, use the gecko sdk (and not your own compile of trunk firefox, etc.). if you are compiling your own firefox (or xulrunner, etc.), use the artifacts from that compilation to build your component. if you are testing a build from your linux distribution (or other vendor-supplied build), look for -dev packages from them. remember to check that the directory the component is in is named correctly i.e. $profile/extensions/$plugindirectory/components! double check your guids in your install.rdf with your sourcecode, and then check them again. windows-specific hints use dependency walker to check that your dependent libraries are loaded correctly. ...
...delete compreg.dat from your profile before doing this. note that even your version of msvc may matter; your test machine may not have the c runtime libraries (msvcr70.dll / msvcp70.dll for msvc 7.0, and similarly named files for 7.1 and 8.0) available. this even means that if you are using a component stub, the stub needs to be compiled using a version which the machine does support; most likely this means msvc 6.0. it may then be necessary for the stub to locate the newer runtime libraries for the other files it loads. if you compiled the component with msvc 8.0 (2005) and are attempting to use it on a windows xp machine or later, it will need a manifest embedded to find the runtime. please refer to msdn for details. if you have the option, you can manually copy t...
XPCOM ABI
pu architectures and compiler abis. newest information can always be found by exploring the build system. note: target_xpcom_abi in the mozilla build system, the variable storing the xpcom abi is named target_xpcom_abi. (this is an internals detail and should be of no concern to an extension developer.) extension installation when the application (e.g. ...
...at extension installation time, the application will choose the most fitting component build for its own abi. if no such build is found, the extension will be deemed incompatible and the application will refuse to install it. ...
XPIDL Syntax
Mozilla › Tech › XPIDL › Syntax
purpose of this document this document is not an introduction to xpidl or idl in general. it is more focused on xpidl syntax and grammar. see xpidl main page for more links and introductory content. simplifications, conventions and notation the syntax is specified according to abnf as defined by rfc 5234, although a few productions use prose for clarity of understanding. ...
...gs ident = (%x41-5a / %x61-7a / "_") *(%x41-5a / %x61-7a / %x30-39 / "_") parens = "(" 1*(any char except ")") ")" 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) exception declarations module declarations variable arguments (that makes the abnf get more wonky) sequence types max-length strings fixed-point numbers "any" and "long double" types. pyxpidl syntax idlfile = *(cdata / include / interface / typedef / native) typedef = "typedef" identifer identifier ";" native = [attributes] "native" ide...
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0. for users saxon-ce no extensions are required, saxon-ce runs whenever a html page is loaded that links to the saxon-ce javascript library. saxon-b the xsl results extension uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for having xslt performed automatically when visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 transform from a web page. error and diag...
...d diagnostics output from saxon-ce can be reviewed in the firefox developer console or in firebug. saxon-b the extension demonstrates how one can use liveconnect code to communicate with the saxon-b library, but one might find the javascript code module approach used inside the extension xquseme as a more reusable approach. the code does not currently work on the mac (except for server edition supporting java 1.6) due to its lagging java support (and thus liveconnect support). ...
Xray vision
be a security risk for chrome code. javascript's a highly malleable language. scripts running in web pages can add extra properties to dom objects (also known as expando properties) and even redefine standard dom objects to do something unexpected. if chrome code relies on such modified objects, it can be tricked into doing things it shouldn't. for example: window.confirm() is a dom api that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "ok" or "cancel". a web page could redefine it to return true: window.confirm = function() { return true; } any privileged code calling this function and expecting its result to represent user confirmation would be deceived. this would be very naive, of course, but there are more subtle ways in w...
... string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date and promise: since webidl definition is the basis of dom xrays, not having xrays for these javascript types starts to seem arbitrary. so, in gecko 31 and 32 we've added xray support for most javascript built-in objects. like dom objects, most javascript built-in objects have an underlying c++ state that is separate from their javascript representation, so the xray implementation can go straight to the c++ state and guarantee that the object will behave as its specification defines: // chrome code var sandboxscript = 'date.prototype.getfullyear = function() {return 100...
The Valgrind Test Job
ble-valgrind ac_add_options --disable-jemalloc running to run the valgrind test job locally, run the following command. mach valgrind-test see also the general instructions for using valgrind with mozilla code. understanding errors for each problem that valgrind finds, it emits a message describing the problem, along with a stack trace indicating where the problem occurs. it also prints a suppression, which is a sequence of text that can be put in a suppression file (and specified via valgrind's --suppressions option) if you want valgrind to ignore such errors in future runs. for example, we have a small number of deliberate but inconsequential memory leaks in the codebase that have corresponding suppressions. but generally errors should be fixed rather than suppressed. when runnin...
... errors in mozilla code should probably be reported in bugs! if you need help or experience problems if you need help with the valgrind test job, please contact nicholas nethercote or gary kwong. ...
Building a Thunderbird extension 3: install manifest
is defined by mozilla. a list of valid application ids can be found here. normally the id does not change and is always the same even for different versions of thunderbird. <em:minversion>1.5</em:minversion>: this element indicates the earliest version of thunderbird for which the extension is intended to work. do not use a wildcard (such as "*"). ...
... there are more optional elements that can be specified in install.rdf. these are described on the install manifests page. note that elements can be specified in any order, as long as they are children of the <description> node. ...
Add Option to Context Menu
this can be reached by adding these lines to the chrome.manifest file: overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myaddon/content/tboverlay-tb2.xul appversion<3.0 overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myaddon/content/tboverlay-tb3.xul appversion=>3.0 than we need two over...
...n. this can be reached by adding these lines to the chrome.manifest file: overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myaddon/content/tboverlay-tb2.xul appversion<3.0 overlay chrome://messenger/content/mailwindowoverlay.xul chrome://myaddon/content/tboverlay-tb3.xul appversion=>3.0 than we need two overlay xul files with content from examples above. note: if our extension supports more mozilla applications (for example mozilla firefox and mozilla thunderbird) we need also specify application flag. for more details see chrome registration. ...
Thunderbird
mail protocols.. database views backend information about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... ...
... views backend information about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... ...
Using tab-modal prompts
then apply it, like in the example below, here we apply the prompt with a checkbox: var window = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt...
...fact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); promptbag.setpropertyasbool('allowtabmodal', true); var check = {value: false}; //initial state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here', input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['title not shown in modal', 'user clicked ok: ' + ok + '\n' + 'checked: ' + chec...
Add to iPhoto
g these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. initializing core foundation the init() method, which sets everything up, looks like this: init: function() { this.lib = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); // declaring all the apis goes here } shutting down core foundation while the core foundation system framework itself doesn't need to be shut down, we do need to c...
...d once they've been created. however, obviously there are cases in which you'll want to be able to manipulate the contents of an array by adding and removing items, sorting them, and so forth. that's where the cfmutablearray type comes into play. all cfarray functions accept cfmutablearray objects, so you can use cfmutablearray with any routine that accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array. there's nothing particularly interesting about how we declare this api, but it will be noteworthy when we look at how we use cfmutablearray objects with methods that accept a cfarray as input, so i introduce this concept here. carbon the carbon api is the core operating system api derived from the classic mac operating sy...
ctypes
. uint16_t unsigned 16-bit integer. int32_t signed 32-bit integer. uint32_t unsigned 32-bit integer. int64_t signed 64-bit integer. uint64_t unsigned 64-bit integer. float32_t 32-bit floating-point value. float64_t 64-bit floating-point value. note: some 64-bit values are outside the range of numeric values supported by javascript. because of this, ctypes.int64 and ctypes.uint64 do not automatically convert to javascript numbers. instead, they convert to objects of the wrapper types ctypes.int64 and ctypes.uint64, which are javascript objects rather than cdata objects. see 64-bit integers for details. types that act like specific c types these types are designed to work exactly like the corresponding ...
...esent c types that have special meanings. type description void_t the special c type void. this can only be used as a return value type. note: you must use void_t, not void, since void is a keyword in javascript. voidptr_t the c type void *. this is a pointer to an indeterminate type of data. large integer types because javascript doesn't support large (64-bit) integers, js-ctypes provides two data types allowing access to 64-bit integer data. type description int64 a javascript object representing a 64-bit signed integer. uint64 a javascript object representing a 64-bit unsigned integer. methods cast() casts the specified cdata object to a new type, returning a new cdata object representi...
js-ctypes reference
n c, and are thus represented by ctype objects. these objects have two main purposes. first, they provide a concrete representation of different data types, allowing the programmer to describe the arguments and return type of a native function (see library.declare()). second, they serve as constructors to create concrete instances of the given type, i.e. cdata objects. out of the box, js-ctypes supports a number of predefined types. type constructors these are functions that define new types, and thus return a ctype object. these include ctypes.pointertype(type) and the .ptr property, which creates a new type describing a pointer to an existing type. ctypes.arraytype(type, [length]) and the .array() method, which creates a new type describing an array of objects of an existing type. ...
...e objects as functions. these distinctions are crucial, and understanding them will alleviate much of the confusion surrounding js-ctypes. calling a type constructor will return a ctype. calling a ctype will return a cdata. you declare the arguments and return value of a native function with ctype objects. you call a native function with cdata objects. other features error-handling js-ctypes supports both errno (on all platforms) and getlasterror (on windows platforms). callbacks you can pass regular javascript functions as callbacks to native functions. see the callbacks page for details. 64-bit integer handling because javascript number objects can't directly represent every possible 64-bit integer value, js-ctypes provides new types for these. see int64 and uint64. ...
URLs - Plugins
an http server, uploading files to an ftp server, and sending mail. uniform resource locator (url) protocols provide a means for locating and accessing resources that are available on the internet and on intranets. plug-ins can request and receive the data associated with urls of any type that the browser can handle, including http, ftp, news, mailto, and gopher. the table below summarizes urls supported by gecko. in addition, gecko may support urls not listed on this table. url scheme description about locates browser information or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather than an internet resource. ftp (file transfer protocol) locates files and directories on internet hosts for file downlo...
...lank line, then the body. if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer. note: you cannot use npn_posturl to specify headers (even a blank line) in a memory buffer. to do this, use npn_posturlnotify for this purpose. § the npn_posturlnotify function has all the same capabilities and works like npn_posturl in most ways except that (1) it supports specifying headers when posting a memory buffer, and (2) it calls npp_urlnotify upon successful or unsuccessful completion of the request. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. nperror npn_posturlnotify( npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool fil...
Plugins
plugins are shared libraries that users can install to display content that the browser can't display natively. important: plugins are a legacy technology that are a security and performance problem for firefox (and other browser) users. they may not be supported in the future. new content should not be written using flash or any other plugin technology. roadmap plugin roadmap information about the roadmap for adobe flash and other plugin support in firefox. roadmap highlights since firefox 52, plugins other than flash are not loaded by firefox. starting in firefox 55, users will be asked to choose which sites may use flash content. this feature will be rolled out gradually to firefox users. also from firefox 55 onwards, flash and other plugins can no longer be loade...
...sites may use flash content. this feature will be rolled out gradually to firefox users. also from firefox 55 onwards, flash and other plugins can no longer be loaded from any url scheme except for http:// and https:// (bug 1335475). see also flash can now be loaded only from http/https for more useful information. starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916). tutorials and references the articles below are developer information about the developing for click-to-play, and plugin blocking. flash activation: browser comparison each browser activates flash slightly differently, which can be confusing for users and web authors. plugin blocking by domain in order to improve security and performance for firefox user...
Debugger.Source - Firefox Developer Tools
embly for a debugger.source instance representing the serialized text of a block of webassembly code, its properties provide the serialized text as a string. currently only entire modules evaluated via new webassembly.module are represented. spidermonkey constructs exactly one debugger.source for each underlying webassembly module per debugger instance. please note at the time of this writing, support for webassembly is very preliminary. many properties below return placeholder values. convention for descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to javascript source or to a block of webassembly code, the text will be split into two sections, headed by “if the instance refers to javascript source” and “...
...t’s event handler idl attributes as a string. (note that one may assign both strings and functions to dom elements’ event handler idl attributes. if one assigns a function, that function’s script’s source doesnot belong to the dom element; the function’s definition must appear elsewhere.) (if the sources attached to a dom element change, the debugger.source instances representing superceded code still refer to the dom element; this accessor only reflects origins, not current relationships.) elementattributename if this source belongs to a dom element because it is an event handler content attribute or an event handler idl attribute, this is the name of that attribute, a string. otherwise, this is undefined. introductiontype if the instance refers to javascript source,...
Deprecated tools - Firefox Developer Tools
md + o on macos), as well as saving the console input content to a file using ctrl + s (cmd + s on macos). webide and connect page webide was deprecated as of firefox 69 disabled as of firefox 70 (bug 1539451). removed as of firefox 71 (bug 1539462). description webide allowed you to connect the firefox developer tools to remote browsers, such as firefox for android. it was also intended to support application development for firefox os. alternatives remote debugging is available in about:debugging as of firefox 68. features not ported to about:debugging are: wifi debugging for firefox for android, application development. features that are planned but not ported yet: remote browser screenshots and edit remote browser configuration. more details on the mailing-list thread. canvas d...
...currently only the babylon library does. ...
Index - Firefox Developer Tools
nspect a document. 8 dom inspector internals code, tools, internals, organisation, source there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). 9 introduction to dom inspector dom_inspector the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, or by using ctrl/cmd+shift+i in either application. dom inspector is standalone; it s...
... working with iframes debugging, devtools, developer tools, frames, tools you can point the developer tools at a specific iframe within a document. 157 about:debugging debugger, remote debugging, about:debugging the about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. 158 about:debugging (before firefox 68) the about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. ...
Migrating from Firebug - Firefox Developer Tools
t execution there, you need to set a breakpoint on the line with the modification within the debugger panel. search for elements via css selectors or xpaths firebug allows to search for elements within the html panel via css selectors or xpaths. also the devtools' inspector panel allows to search for css selectors. it even displays a list with matching ids or classes. searching by xpaths is not supported though (see bug 963933. debugger what's the script panel in firebug, is the debugger panel in the devtools. both allow you to debug javascript code executed on a website. switch between sources firebug has a script location menu listing all javascript sources related to the website. those sources can be static, i.e. files, or they can be dynamically generated (i.e. scripts executed via ...
...f breakpoints, which are all listed within the breakpoints side panel. in the devtools the breakpoints are shown below each script source within the sources side panel. those panels allow you to enable and disable single or all breakpoints and to remove single breakpoints or all of them at once. they do currently only allow to set script breakpoints. xhr, dom, cookie and error breakpoints are not supported yet (see bug 821610, bug 1004678, bug 895893 and bug 1165010). while there are no breakpoints for single javascript errors, there is a setting pause on exceptions within the debugger panel options. step through code once the script execution is stopped, you can step through the code using the continue (f8), step over (f10), step into (f11) and step out (shift+f11) options. they work the s...
Examine and edit CSS - Firefox Developer Tools
play of certain css and rules view features. you can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the configuration editor to enable this feature); change the display based on print media rules. a warning icon appears next to unsupported css properties or rules that have invalid values. this can help you understand why certain styles are not being applied. in the following example, a spelling error, "background-colour" instead of "background-color" has made the rule invalid: rule display it displays each rule as in a stylesheet, with a list of selectors followed by a list of property:value; declarations. highlight ...
...ting classes are suggested as you type. link to css file at the top right of each rule, the source filename and line number is displayed as a link: clicking it opens the file in the style editor. you can copy the location of the source file: right-click the link and select "copy location". the inspector understands css source maps. that means that if you are using a css preprocessor that has support for source maps, and you've enabled source map support in the style editor settings, then the link will take you to the original source, not the generated css. read more about css source map support in the style editor documentation. overridden declarations if a css declaration is overridden by some other css rule with a greater weight, then the declaration is shown with a line through it. ...
Waterfall - Firefox Developer Tools
ls. adding markers with the console api two markers are directly controlled by console api calls: "console" and "timestamp". console markers these enable you to mark a specific section of the recording. to make a console marker, call console.time() at the start of the section, and console.timeend() at the end. these functions take an argument which is used to name the section. ...
...nction(resolve) { settimeout(resolve, t); }); } the waterfall will display a marker for the period between time() and timeend(), and if you select it, you'll see the async stack in the sidebar: timestamp markers timestamps enable you to mark an instant in the recording. to make a timestamp marker, call console.timestamp(). you can pass an argument to label the timestamp. ...
Console messages - Firefox Developer Tools
ource is an image, the image will be opened in a new tab. if the resource is a stylesheet, you will see the css rules, etc. js javascript errors contain a "learn more" link that takes you to the javascript error reference containing additional advice for fixing issues: source maps the web console understands source maps. this means that if your javascript sources are compressed, you can supply a source map for them. then any messages or errors your source generates will show up in the web console with a link back to the original source, not the compressed version. async stack frames stack traces show stack frames for async functions separately from those for synchronous functions. when you run code containing an async function, its traces (console.trace or thrown error) are shown ...
... if you have more ideas for useful features like the ones discussed here, or are interested in contributing, check out the metabug and its dependencies. logging messages logged from shared workers, service workers, add-ons, and chrome workers are not shown by default. use the filtering feature to show them. the logging category includes messages logged using the console api. ...
AudioContext() - Web APIs
r a double-precision floating-point value indicating the preferred maximum latency of the context in seconds. the user agent may or may not choose to meet this request; check the value of audiocontext.baselatency to determine the true latency after creating the context. samplerate optional the samplerate to be used by the audiocontext, specified in samples per second. the value may be any value supported by audiobuffer. if not specified, the preferred sample rate for the context's output device is used by default. return value the newly constructed audiocontext instance. exceptions notsupportederror the specified samplerate isn't supported by the context. usage notes the specification doesn't go into a lot of detail about things like how many audio contexts a user agent should s...
...se details can vary from browser to browser. be sure to check the values if they matter to you. in particular, the specification doesn't indicate a maximum or minimum number of audio contexts that must be able to be open at the same time, so this is left up to the browser implementations to decide. google chrome per-tab audio context limitation in chrome prior to version 66 google chrome only supported up to six audio contexts per tab at a time. non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the provided value '...' is not a valid enum value of type audiocontextlatencycategory". example this example creates a new audiocontext for interactive audio (optimizing for latency) and a sample rate ...
AudioContext.createMediaStreamSource() - Web APIs
g live, or view the source. ...
...so playing/pausing the stream can still be done through the media element api and the player controls. specifications specific...
AudioWorkletGlobalScope - Web APIs
each baseaudiocontext has a single audioworklet available under the audioworklet property, which runs its code in a single audioworkletglobalscope. as the global execution context is shared across the current baseaudiocontext, it's possible to define any other variables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes. ...
... by creating an audioworkletnode, providing its registered name. examples in this example we output all global properties into the console in the constructor of a custom audioworkletprocessor. first we need to define the processor, and register it. note that this should be done in a separate file. ...
AudioWorkletProcessor() - Web APIs
instead, they are created only internally by the creation of an associated audioworkletnodes. ...
...in this example we pass custom options to the audioworkletnode constructor and observe how a structured clone of them gets passed to our audioworkletprocessor constructor. first, we need to define a custom audioworkletprocessor and register it. note that this should be done in a separate file. // test-processor.js class testprocessor extends audioworkletprocessor { constructor (options) { super() console.log(options.numberofinputs) console.log(options.processoroptions.someusefulvariable) } process (inputs, outputs, parameters) { return true } } registerprocessor('test-processor', testprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor and options object. in the options obje...
BaseAudioContext.createBuffer() - Web APIs
ffer = baseaudiocontext.createbuffer(numofchannels, length, samplerate); parameters note: for an in-depth explanation of how audio buffers work, and what these parameters mean, read audio buffers: frames, samples and channels from our basic concepts guide. numofchannels an integer representing the number of channels this buffer should have. ...
...must support at least 32 channels. length an integer representing the size of the buffer in sample-frames (where each sample-frame is the size of a sample in bytes multiplied by numofchannels). to determine the length to use for a specific number of seconds of audio, use numseconds * samplerate. samplerate the sample rate of the linear audio data in sample-frames per second. all browsers must support sample rates in at least the range 8,000 hz to 96,000 hz. returns an audiobuffer configured based on the specified options. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range). rangeerror there isn't enough memory available to allocate ...
CSSRule - Web APIs
Web › API › CSSRule
6 csspagerule cssrule.keyframes_rule 7 csskeyframesrule cssrule.keyframe_rule 8 csskeyframerule reserved for future use 9 should be used to define color profiles in the future cssrule.namespace_rule 10 cssnamespacerule cssrule.counter_style_rule 11 csscounterstylerule cssrule.supports_rule 12 csssupportsrule cssrule.document_rule 13 cssdocumentrule cssrule.font_feature_values_rule 14 cssfontfeaturevaluesrule cssrule.viewport_rule 15 cssviewportrule cssrule.region_style_rule 16 cssregionstylerule cssrule.unknown_rule 0 cssunknownrule cssrule.charset_rul...
...l 4the definition of 'cssrule' in that specification. working draft added value font_feature_values_rule. css counter styles level 3the definition of 'cssrule' in that specification. candidate recommendation added value counter_style_rule. css conditional rules module level 3the definition of 'cssrule' in that specification. candidate recommendation added value supports_rule. (document_rule has been pushed to css conditional rules level 4) document object model (dom) level 2 style specificationthe definition of 'cssrule' in that specification. obsolete initial definition. ...
CSSStyleDeclaration - Web APIs
the declaration block. setting this attribute changes the style. cssstyledeclaration.lengthread only the number of properties. see the item() method below. cssstyledeclaration.parentruleread only the containing cssrule. css properties cssstyledeclaration.cssfloat special alias for the float css property. cssstyledeclaration named properties dashed and camel-cased attributes for all supported css properties. methods cssstyledeclaration.getpropertypriority() returns the optional priority, "important". cssstyledeclaration.getpropertyvalue() returns the property value given a property name. cssstyledeclaration.item() returns a css property name by its index, or the empty string if the index is out-of-bounds. an alternative to accessing nodelist[i] (which instead returns ...
...nodelist[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. cssstyledeclaration.removeproperty() removes a property from the css declaration block. cssstyledeclaration.setproperty() modifies an existing css property or creates a new css property in the declaration block. cssstyledeclaration.getpropertycssvalue() only supported via getcomputedstyle in firefox. returns the property value as a cssprimitivevalue or null for shorthand properties. example var styleobj = document.stylesheets[0].cssrules[0].style; console.log(styleobj.csstext); for (var i = styleobj.length; i--;) { var namestring = styleobj[i]; styleobj.removeproperty(namestring); } console.log(styleobj.csstext); specifications specif...
Using the CSS Painting API - Web APIs
e would any other <image> type, using the same string identifier we used in the paintworklet's registerpaint() function. .fancy { background-image: paint(headerhighlight); } putting it together we can then add the fancy class to any element on the page to add a yellow box as a background: <h1 class="fancy">my cool header</h1> the following example will look like the image above in browsers supporting the css painting api. while you can't play with the worklet's script, you can alter the background-size and background-position to change the size and location of the background image. paintsize in the example above, we created a 20x200 unit box, painted 15 units from the top of the element it is the same regardless of the size of the element. if the text is small, the yellow box lo...
.../02parttwo/header-highlight.js'); .fancy { background-image: paint(headerhighlight); } .half { width: 50%; } <h1 class="fancy">largest header</h1> <h6 class="fancy">smallest header</h6> <h3 class="fancy half">50% width header</h3> while you can't play with the worklet's script, you can alter the element's font-size and width to change the size of the background image. in browsers that support the css paint api, the example below should appear like the image above. custom properties in addition to accessing the size of the element, the worklet can also have access to css custom properties and regular css properties. registerpaint('csspaintfunctionname', class { static get inputproperties() { return ['propertyname1', '--custompropertyname2']; } static get inputargumen...
Using the CSS Typed Object Model - Web APIs
e = document.createelement('dd'); cssvalue.appendchild(document.createtextnode(val)); styleslist.appendchild(cssvalue); } the computedstylemap() method returns a stylepropertymapreadonly object containing the size property, which indicates how many properties are in the map. we iterate through the style map, creating a <dt> and <dd> for each property and value respectively. in browsers that support computedstylemap(), you'll see a list of all the css properties and values. in other browsers, you'll just see a link. did you realize how many default css properties a link had? update the javascript on line 2 to select the <p> rather than the <a>. you'll notice a difference in the margin-top and margin-bottom default computed values. .get() method / custom properties let's update our ...
...ue.appendchild(document.createtextnode( propval )); row.appendchild( cssvalue ); // and the type of unit const cssunit = document.createelement( 'td' ); cssunit.appendchild( document.createtextnode( allcomputedstyles.get( ofinterest[i] ).unit )); row.appendchild( cssunit ); //add the row to the table stylestable.appendchild( row ); } for those of you using a non-supporting browser, the above output should looks something like this: property value unit padding-top 0 px margin-bottom 16 px font-size 16 px font-stretch 100 percent animation-duration 0 s animation-iteration-count 1 number width auto undefined height auto und...
CSS Typed Object Model API - Web APIs
ce allows a cssnumericvalue to be constructed from a css string. it sets a specific css property to the specified values and returns the first value as a cssstylevalue object. cssstylevalue.parseall() the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values. stylepropertymap the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration. stylepropertymap.set() method of stylepropertymap interface that changes the css declaration with the given property to the value given. stylepropertymap.append() method that adds a new css d...
...mage, for example background-image, list-style-image, or border-image-source. csskeywordvalue an interface which creates an object to represent css keywords and other identifiers. when used where a string is expected, it will return the value of csskeyword.value. cssnumericvalue an interface representing operations that all numeric values can perform, including: cssnumericvalue.add - adds supplied numbers to the cssnumericvalue. cssnumericvalue.sub - subtracts supplied numbers to the cssnumericvalue. cssnumericvalue.mul - multiplies supplied numbers to the cssnumericvalue. cssnumericvalue.div - divides a supplied number by other numbers, throwing an error if 0. cssnumericvalue.min - returns the minimum value passed cssnumericvalue.max - returns the maximum value passed css...
CustomElementRegistry - Web APIs
s already defined, the returned promise is immediately fulfilled. examples the following code is taken from our word-count-web-component example (see it live also). note how we use the customelementregistry.define() method to define the custom element after creating its class. ...
... promise is immediately fulfilled. examples the following code is taken from our word-count-web-component example (see it live also). note how we use the customelementregistry.define() method to define the custom element after creating its class. ...
DOMError - Web APIs
Web › API › DOMError
d range (e.g. thrown in a range object). hierarchyrequesterror the node tree hierarchy is not correct. wrongdocumenterror the object is in the wrong document. invalidcharactererror the string contains invalid characters. nomodificationallowederror the object can not be modified. notfounderror the object can not be found here. ...
.... hierarchyrequesterror the node tree hierarchy is not correct. wrongdocumenterror the object is in the wrong document. invalidcharactererror the string contains invalid characters. nomodificationallowederror the object can not be modified. notfounderror the object can not be found here. notsupportederror the operation is not supported invalidstateerror the object is in an invalid state. syntaxerror the string did not match the expected pattern. invalidmodificationerror the object can not be modified in this way. namespaceerror the operation is not allowed by namespaces in xml invalidaccesserror the object does not support the operation or argument. type...
DOMException - Web APIs
cument_err) invalidcharactererror the string contains invalid characters. (legacy code value: 5 and legacy constant name: invalid_character_err) nomodificationallowederror the object cannot be modified. (legacy code value: 7 and legacy constant name: no_modification_allowed_err) notfounderror the object cannot be found here. (legacy code value: 8 and legacy constant name: not_found_err) notsupportederror the operation is not supported. (legacy code value: 9 and legacy constant name: not_supported_err) invalidstateerror the object is in an invalid state. (legacy code value: 11 and legacy constant name: invalid_state_err) syntaxerror the string did not match the expected pattern. (legacy code value: 12 and legacy constant name: syntax_err) invalidmodificationerror the object canno...
...he expected pattern. (legacy code value: 12 and legacy constant name: syntax_err) invalidmodificationerror the object cannot be modified in this way. (legacy code value: 13 and legacy constant name: invalid_modification_err) namespaceerror the operation is not allowed by namespaces in xml. (legacy code value: 14 and legacy constant name: namespace_err) invalidaccesserror the object does not support the operation or argument. (legacy code value: 15 and legacy constant name: invalid_access_err) typemismatcherror the type of the object does not match the expected type. (legacy code value: 17 and legacy constant name: type_mismatch_err) this value is deprecated; the javascript typeerror exception is now raised instead of a domexception with this value. securityerror the operation is i...
Detecting device orientation - Web APIs
ving storage devices. deviceorientationevent is more commonly found in mobile devices. processing orientation events all you need to do in order to begin receiving orientation change is to listen to the deviceorientation event: note: gyronorm.js is a polyfill for normalizing the accelerometer and gyroscope data on mobile devices. this is useful for overcoming some of the differences in device support for device orientation. window.addeventlistener("deviceorientation", handleorientation, true); after registering your event listener (in this case, a javascript function called handleorientation()), your listener function periodically gets called with updated orientation data. the orientation event contains four values: deviceorientationevent.absolute deviceorientationevent.alpha de...
...und the x axis, represented in degrees with values ranging from -180 to 180. this represents a front to back motion of the device. the deviceorientationevent.gamma value represents the motion of the device around the y axis, represented in degrees with values ranging from -90 to 90. this represents a left to right motion of the device. orientation example this example will work on any browser supporting the deviceorientation event and running on a device able to detect its orientation. so let's imagine a ball in a garden: <div class="garden"> <div class="ball"></div> </div> <pre class="output"></pre> this garden is 200 pixel wide (yes, it's a tiny one), and the ball is in the center: .garden { position: relative; width : 200px; height: 200px; border: 5px solid #ccc; bord...
DisplayMediaStreamConstraints.audio - Web APIs
constraints.audio = mediatrackconstraints; displaymediastreamconstraints = { audio: allowaudioflag|mediatrackconstraints; } value the value may be either a boolean or a mediatrackconstraints object. ...
...the audio track is always considered optional. example specifications specification status comment unknownthe definition of 'displaymediastreamconstraints.audio' in that specification. ...
Document.cookie - Web APIs
Web › API › Document › cookie
n when following a regular link. the none value explicitly states no restrictions will be applied. the cookie will be sent in all requests—both cross-site and same-site. the cookie value string can use encodeuricomponent() to ensure that the string does not contain any commas, semicolons, or whitespace (which are disallowed in cookie values). some user agent implementations support the following cookie prefixes: __secure- signals to the browser that it should only include the cookie in requests transmitted over a secure channel. __host- signals to the browser that in addition to the restriction to only use the cookie from a secure origin, the scope of the cookie is limited to a path attribute passed down by the server. if the server omits the path attribute the...
...ou have, the more data will be transferred between the server and the client for each request. this will make each request slower. it is highly recommended for you to use whatwg dom storage if you are going to keep "client-only" data. rfc 2965 (section 5.3, "implementation limits") specifies that there should be no maximum length of a cookie's key or value size, and encourages implementations to support arbitrarily large cookies. each browser's implementation maximum will necessarily be different, so consult individual browser documentation. the reason for the syntax of the document.cookie accessor property is due to the client-server nature of cookies, which differs from other client-client storage methods (like, for instance, localstorage): the server tells the client to store a cookie ...
Document.createCDATASection() - Web APIs
will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place). specifications ...
...ata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err. will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place). specifications specification status comment domthe definition of '...
Document.createEvent() - Web APIs
function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget. elem.dispatchevent(event); notes event type strings suitable for passing to createevent() are listed in the dom standard — see the table in step 2. bear in mind that most event objects now have constructors, which are the modern recommended way to create event object instances. ...
... notes event type strings suitable for passing to createevent() are listed in the dom standard — see the table in step 2. bear in mind that most event objects now have constructors, which are the modern recommended way to create event object instances. gecko supports some non-standard event object aliases, which are listed below. event module standard event object gecko also supports text event module textevent textevents keyboard event module keyboardevent keyevents basic events module event events specifications specification status comment domthe definition of 'document.createevent' in that specification. living standard ...
Introduction to the DOM - Web APIs
ssing html tables, and so forth). this documentation provides an object-by-object reference to the dom. the modern dom is built using multiple apis that work together. the core dom defines the objects that fundamentally describe a document and the objects within it. this is expanded upon as needed by other apis that add new features and capabilities to the dom. for example, the html dom api adds support for representing html documents to the core dom. dom and javascript the short example above, like nearly all of the examples in this reference, is javascript. that is to say, it's written in javascript, but it uses the dom to access the document and its elements. the dom is not a programming language, but without it, the javascript language wouldn't have any model or notion of web pages, ht...
... similar one to test the dom interfaces you are interested in and see how they work on the browser platform. you can update the contents of the test() function as needed, create more buttons, or add elements as necessary. ...
Using the W3C DOM Level 1 Core - Web APIs
what is a dom tree? a dom tree is a kind of tree whose nodes represent an html or xml document's contents. each html or xml document has a unique dom tree representation. ...
...any way you want. this implies the ability to create any html or xml document from scratch, or to change any contents of a given html or xml document. the easiest way for web page authors to edit the dom of a document is to use javascript to access the document property of the global object. this document object implements the document interface from the w3c's dom level 1 spec. a simple example suppose the author wants to change the header of the above document and write two paragraphs instead of one. the following script would do the job: html content <body> <input type="button" value="change this document." onclick="change()"> <h2>header</h2> <p>paragraph</p> </body> javascript content function change() { // document.getelementsbytagname("h2") returns a nodelist of the <h2> ...
Element.setCapture() - Web APIs
syntax element.setcapture(retargettoelement); retargettoelement if true, all events are targeted directly to this element; if false, events can also fire at descendants of this element. ...
... 2px; } </style> <script type="text/javascript"> function init() { var btn = document.getelementbyid("mybutton"); if (btn.setcapture) { btn.addeventlistener("mousedown", mousedown, false); btn.addeventlistener("mouseup", mouseup, false); } else { document.getelementbyid("output").innerhtml = "sorry, there appears to be no setcapture support on this browser"; } } function mousedown(e) { e.target.setcapture(); e.target.addeventlistener("mousemove", mousemoved, false); } function mouseup(e) { e.target.removeeventlistener("mousemove", mousemoved, false); } function mousemoved(e) { var output = document.getelementbyid("output"); output.innerhtml = "position: " + e.clientx...
ExtendableEvent - Web APIs
specifications specification status comment service workersthe definition of 'extendableevent' in that specification. working draft initial definition. ...
... specifications specification status comment service workersthe definition of 'extendableevent' in that specification. working draft initial definition. ...
FeaturePolicy.features() - Web APIs
the features() method of the featurepolicy interface returns a list of names of all features supported by the user agent. feature whose name appears on the list might not be allowed by the feature policy of the current execution context and/or might not be accessible because of user's permissions. syntax const supportedfeatures = featurepolicy.features() parameters none. return value a list of strings that represent names of all feature policy directives supported by the user agent. example the followin example logs all the supported directives in the console. ...
...s permissions. syntax const supportedfeatures = featurepolicy.features() parameters none. return value a list of strings that represent names of all feature policy directives supported by the user agent. example the followin example logs all the supported directives in the console. // get the feature policy object const featurepolicy = document.featurepolicy // retreive the list of all supported feature policy directives const supporteddirectives = featurepolicy.features() // print out each directive into the console for (const directive of supporteddirectives){ console.log(directive) } specification specification status comment feature policythe definition of 'features' in that specification. editor's draft initial definition. ...
Fetch API - Web APIs
Web › API › Fetch API
ey are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions). it also defines related concepts such as cors and the http origin header semantics, supplanting their separate definitions elsewhere. for making a request and fetching a resource, use the windoworworkerglobalscope.fetch() method. it is implemented in multiple interfaces, specifically window and workerglobalscope. this makes it available in pretty much any context you might want to fetch resources in. the fetch() method takes one mandatory argument, the path to the resource you wan...
...chrome version 68. if you are targetting older versions of these browsers, be sure to include credentials: 'same-origin' init option on all api requests that may be affected by cookies/user login state. note: find out more about using the fetch api features in using fetch, and study concepts in fetch basic concepts. aborting a fetch browsers have started to add experimental support for the abortcontroller and abortsignal interfaces (aka the abort api), which allow operations like fetch and xhr to be aborted if they have not already completed. see the interface pages for more details. fetch interfaces windoworworkerglobalscope.fetch() the fetch() method used to fetch a resource. headers represents response/request headers, allowing you to query them and take diffe...
Introduction to the File and Directory Entries API - Web APIs
d since november18, 2010), and appcache. the api is a better choice for apps that deal with blobs for the following reasons: the file and directory entries api offers client-side storage for use cases that are not addressed by databases. if you want to have large mutable chunks of data, the file and directory entries api is a much more efficient storage solution than a database. while firefox supports blob storage for indexeddb, chrome currently does not (chrome is still implementing support for blob storage in indexeddb). if you are targeting chrome for your app and you want to store blobs, the file and directory entries api and app cache are your only choices. however, appcache storage isn't locally mutable, and doesn't allow for fine-grained client-side management. in chrome, you can ...
... a web app from using up the entire disk, browsers might impose a quota for each app and allocate storage among web apps. how storage space is granted or allocated and how you can manage storage are idiosyncratic to the browser, so you need to check the respective documentation of the browser. google chrome, for example, allows temporary storage beyond the 5 mb required in the specifications and supports the quota management api. to learn more about the chrome-specific implementation, see managing html5 offline storage. the file and directory entries api has asynchronous and synchronous versions the file and directory entries api comes with asynchronous and synchronous versions. both versions of the api offer the same capabilities and features. in fact, they are almost alike, except for a ...
File and Directory Entries API - Web APIs
implement only small portions of it. check the browser compatibility section for details. two very similar apis exist depending on whether you desire asynchronous or synchronous behavior. the synchronous api is intended to be used inside a worker and will return the values you desire. the asynchronous api will not block and functions and the api will not return values; instead, you will need to supply a callback function to handle the response whenever it arrives. the firefox implementation of the file and directory entries api is very limited; there is no support for creating files. only for accessing files which are selected by the user in a file <input> element (see htmlinputelement as well) or when a file or directory is provided to the web site or app using drag and drop. firefox als...
... getting access to a file system there are two ways to get access to file systems defined in the current specification draft: when handling a drop event for drag and drop, you can call datatransferitem.webkitgetasentry() to get the filesystementry for a dropped item. ...
Using FormData Objects - Web APIs
named "username", "accountnum", "userfile" and "webmasterfile", then uses the xmlhttprequest method send() to send the form's data. the field "webmasterfile" is a blob. a blob object represents a file-like object of immutable, raw data. blobs represent data that isn't necessarily in a javascript-native format. the file interface is based on blob, inheriting blob functionality and expanding it to support files on the user's system. in order to build a blob you can invoke the blob() constructor. retrieving a formdata object from an html form to construct a formdata object that contains the data from an existing <form>, specify that form element when creating the formdata object: note: formdata will only use input fields that use the name attribute. var formdata = new formdata(someformele...
...d over the method specified in the open() call. 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 optional parameter to pass a filename inside the content-disposition header that is sent to the server. when no filename is specified (or the parameter isn't supported), the name "blob" is used. using a formdata event a more recent addition to the platform than the formdata object is the formdata event — this is fired on an htmlformelement object after the entry list representing the form's data is constructed. this happens when the form is submitted, but can also be triggered by the invocation of a formdata() constructor. this allows a formdata obje...
HTMLCanvasElement.toBlob() - Web APIs
thing else, the default values 0.92 and 0.80 are used for image/jpeg and image/webp respectively. other arguments are ignored. return value none. exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents come from secure examples getting a file representing the canvas once you have drawn content into a canvas, you can convert it into a file of any supported image format. the code snippet below, for example, takes the image in the <canvas> element whose id is "canvas", obtains a copy of it as a png image, then appends a new <img> element to the document, whose source image is the one created using the canvas. var canvas = document.getelementbyid('canvas'); canvas.toblob(function(blob) { var newimg = document.createelement('img'), url ...
...dchild(newimg); }); note that here we're creating a png image; if you add a second parameter to the toblob() call, you can specify the image type. for example, to get the image in jpeg format: canvas.toblob(function(blob){...}, 'image/jpeg', 0.95); // jpeg at 95% quality a way to convert a canvas to an ico (mozilla only) this uses -moz-parse to convert the canvas to ico. windows xp doesn't support converting from png to ico, so it uses bmp instead. a download link is created by setting the download attribute. the value of the download attribute is the name it will use as the file name. var canvas = document.getelementbyid('canvas'); var d = canvas.width; ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(d / 2, 0); ctx.lineto(d, d); ctx.lineto(0, d); ctx.closepath(); ctx.fills...
HTMLCanvasElement - Web APIs
is assigned to the <canvas>, then this value will also be used as the width of the canvas in the length-unit css pixel. htmlcanvaselement.mozopaque is a boolean reflecting the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting performance can be optimized. this is only supported in mozilla-based browsers; use the standardized canvas.getcontext('2d', { alpha: false }) instead. htmlcanvaselement.mozprintcallback is a function that is initially null. web content can set this to a javascript function that will be called when the canvas is to be redrawn while the page is being printed. when called, the callback is passed a "printstate" object that implements the mozc...
...lution rendering of the canvas at the resolution of the printer being used. see this blog post. methods inherits methods from its parent, htmlelement. htmlcanvaselement.capturestream() returns a canvascapturemediastream that is a real-time video capture of the surface of the canvas. htmlcanvaselement.getcontext() returns a drawing context on the canvas, or null if the context id is not supported. a drawing context lets you draw on the canvas. calling getcontext with "2d" returns a canvasrenderingcontext2d object, whereas calling it with "webgl" (or "experimental-webgl") returns a webglrenderingcontext object. this context is only available on browsers that implement webgl. htmlcanvaselement.todataurl() returns a data-url containing a representation of the image in the format spec...
HTMLFontElement.face - Web APIs
if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
... ...
HTMLInputElement.stepDown() - Web APIs
ecrements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter. the method, when invoked, decrements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. valid on all numeric, date, and time input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range. given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, decrementing the time by 3 * 900, or 45 minutes. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to 1. <!-- decrements by intervals of 900 se...
...for n will increment the value, but will not increment beyond the max value. if the value before invoking the stepdown() method is invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepdown() method will return a value that does match the form controls constraints. 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 exception is thrown. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not specified. throws an invalid_state_err exception: if the method is not applicable to for the current type value, if the element has...
HTMLScriptElement - Web APIs
synchronously as soon as it downloads. if the async attribute is absent but the defer attribute is present, then the script is executed when the page has finished parsing. if neither attribute is present, then the script is fetched and executed immediately, blocking further parsing of the page. the defer attribute may be specified with the async attribute, so legacy browsers that only support defer (and not async) fall back to the defer behavior instead of the default blocking behavior. note: the exact processing details for these attributes are complex, involving many different aspects of html, and therefore are scattered throughout the specification. these algorithms describe the core ideas, but they rely on the parsing rules for <script> start and end tags in html, in foreig...
...ther nodes like comments) in tree order. on setting, it acts the same way as the textcontent idl attribute. note: when inserted using the document.write() method, <script> elements execute (typically synchronously), but when inserted using innerhtml or outerhtml, they do not execute at all. htmlscriptelement.nomodule is a boolean that if true, stops the script's execution in browsers that support es2015 modules — used to run fallback scripts in older browsers that do not support javascript modules. htmlscriptelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use when fetching the script, and fetches done by that script. methods no specific methods; inherits methods from its parent, htmlelement. examples dynamica...
File drag and drop - Web APIs
e. the main steps to drag and drop are to define a drop zone (i.e. a target element for the file drop) and to define event handlers for the drop and dragover events. these steps are described below, including example code snippets. the full source code is available in mdn's drag-and-drop repository (pull requests and/or issues are welcome). note: html drag and drop defines two different apis to support dragging and dropping files. one api is the datatransfer interface and the second api is the datatransferitem and datatransferitemlist interfaces. this example illustrates the use of both apis (and does not use any gecko specific interfaces). define the drop zone the target element of the drop event needs an ondrop global event handler. the following code snippet shows how this is done with...
... element is a drop zone. in this example, the drop target element uses the following styling: #drop_zone { border: 5px solid blue; width: 200px; height: 100px; } note that dragstart and dragend events are not fired when dragging a file into the browser from the os. process the drop the drop event is fired when the user drops the file(s). in the following drop handler, if the browser supports datatransferitemlist interface, the getasfile() method is used to access each file; otherwise the datatransfer interface's files property is used to access each file. this example shows how to write the name of each dragged file to the console. in a real application, an application may want to process a file using the file api. note that in this example, any drag item that is not a file i...
History.replaceState() - Web APIs
l. title most browsers currently ignore this parameter, although they may use it in the future. passing the empty string here should be safe against future changes to the method. alternatively, you could pass a short title for the state. url optional the url of the history entry. the new url must be of the same origin as the current url; otherwise replacestate throws an exception. ...
...of the same origin as the current url; otherwise replacestate throws an exception. examples suppose https://www.mozilla.org/foo.html executes the following javascript: const stateobj = { foo: 'bar' }; history.pushstate(stateobj, '', 'bar.html'); the explanation of these two lines above can be found in the example of pushstate() method section of the working with the history api article. then suppose https://www.mozilla.org/bar.html executes the following javascript: history.replacestate(stateobj, '', 'bar2.html'); this will cause the url bar to display https://www.mozilla.org/bar2.html, but won't cause the browser to load bar2.html or even check that bar2.html exists. suppose now that the user navigates to https://www.microsoft.com, then clicks the back button. at this point, the url ...
IDBCursorSync - Web APIs
on. value any the value for the record at the cursor's position. setting this attribute can raise an idbdatabaseexception with the following codes: data_err if the underlying object store uses in-line keys and the property at the key path does not match the key in this cursor's position. not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode, or if an index record cannot be changed because the underlying index is auto-populated. serial_err if the data being stored could not be serialized by the internal structured cloning algorithm. constants constant value description next 0 this cursor inclu...
...continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this method can raise an idbdatabaseexception with the following code: not_allowed_err if the underlying index or object store does not support updating the record because it is open in the read_only or snapshot_read mode. ...
Basic concepts - Web APIs
one version at any given time. durable in firefox, indexeddb used to be durable, meaning that in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. in this case the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since su...
...example, you can iterate over all values of a key between x and y. for the reference documentation on key range, see idbkeyrange. limitations indexeddb is designed to cover most cases that need client-side storage. however, it is not designed for a few cases like the following: internationalized sorting. not all languages sort strings in the same way, so internationalized sorting is not supported. while the database can't store data in a specific internationalized order, you can sort the data that you've read out of the database yourself. note, however, that locale-aware sorting has been allowed with an experimental flag enabled (currently for firefox only) since firefox 43. synchronizing. the api is not designed to take care of synchronizing with a server-side database. you have t...
Browser storage limits and eviction criteria - Web APIs
er data storage? in firefox, the following technologies make use of browser data storage to store data when required. we term them "quota clients" in this context: indexeddb asm.js caching cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document. note: in private browsing mode, most data storage is not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last access time" of origins is updated when any of these are activated/deactivated — origin eviction will delete data for all these quota clients. in chrome/opera, the quota management api handles quota management for appcache, indexedd...
...age/default — default data storage repository note: after introducing storage api, the "permanent" folder can be considered obsolete; the "permanent" folder only stores indexeddb persistent-type databases. it doesn't matter if box mode is "best-effort" or "persistent" — data is stored under <profile>/storage/default. note: in firefox, you can find your profile folder by entering about:support in the url bar, and pressing the show in... button (e.g., show in finder on mac os x) next to the profile folder title. note: if you are looking around in your profile at the data stored, you might see a fourth folder: persistent. basically, the persistent folder was renamed to permanent a while ago to keep upgrades/migration simpler. note: users shouldn’t add their own directories or...
Checking when a deadline is due - Web APIs
rent, with a number of different representations. recording the date information to provide a reasonable user experience on mobile devices, and to cut down on ambiguities, i decided to create an html form with: a text input for entering a title for your to-do list. this is the least avoidable bit of user typing. number inputs for the hour and minute parts of the deadline. on browsers that support type="number", you get a nice little up and down arrow number picker. on mobile platforms you tend to get a numeric keypad for entering data, which is helpful. on others you just get a standard text input, which is okay. <select> elements for inputting the day, month and year of the deadline. because these values are the most ambiguous for users to enter (7, sunday, sun? 04, 4, april, apr? 2...
...year.value == null) { note.innerhtml += '<li>data not submitted — form incomplete.</li>'; return; } in this segment, we check to see if the form fields have all been filled in. if not, we drop a message into our developer notifications pane (see the bottom left of the app ui) to tell the user what is going on, and exit out of the function. ...
IndexedDB API - Web APIs
data, including files/blobs. this api uses indexes to enable high-performance searches of this data. while web storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. indexeddb provides a solution. this is the main landing page for mdn's indexeddb coverage — here we provide links to the full api reference and usage guides, browser support details, and some explanation of key concepts. note: this feature is available in web workers. note: indexeddb api is powerful, but may seem too complicated for simple cases. if you'd prefer a simple api, try libraries such as localforage, dexie.js, zangodb, pouchdb, idb, idb-keyval, jsstore and lovefield that make indexeddb more programmer-friendly. key concepts and usage indexeddb is ...
...uchdb, idb, idb-keyval, jsstore and lovefield that make indexeddb more programmer-friendly. key concepts and usage indexeddb is a transactional database system, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables, indexeddb is a javascript-based object-oriented database. indexeddb lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. read more about the concepts behind indexeddb. learn to use indexeddb asynchronously from first principles with our using indexeddb guide. combine indexeddb for storing data offline with service ...
KeyboardEvent.keyCode - Web APIs
key. this is usually the decimal ascii (rfc 20) or windows 1252 code corresponding to the key. if the key can't be identified, this value is 0. you should avoid using this if possible; it's been deprecated for some time. instead, you should use keyboardevent.code, if it's implemented. unfortunately, some browsers still don't have it, so you'll have to be careful to make sure you use one which is supported on all target browsers. web developers shouldn't use the keycode attribute for printable characters when handling keydown and keyup events. as described above, the keycode attribute is not useful for printable characters, especially those input with the shift or alt key pressed. when implementing a shortcut key handler, the keypress event is usually better (at least when gecko is the runt...
...unction (event) { if (event.defaultprevented) { return; // should do nothing if the default action has been cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true. } else if (event.keycode !== undefined) { // handle the event with keyboardevent.keycode and set handled true. } if (handled) { // suppress "double action" if event handled event.preventdefault(); } }, true); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.keycode' in that specification. obsolete initial definition; specified as deprecated ...
MediaDecodingConfiguration - Web APIs
properties a mediadecodingconfiguration dictionary takes two properties: type — the type of media being tested. this takes one of two values: file: represents a configuration that is meant to be used for a plain file playback. ...
...ested const mediaconfig = { type : 'file', // or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediadecodingconfiguration' in that specification. draft initial definition ...
MediaDevices.getDisplayMedia() - Web APIs
ct specifying requirements for the returned mediastream. since getdisplaymedia() requires a video track, the returned stream will have one even if no video track is expressly requested by the constraints object. return value a promise that resolves to a mediastream containing a video track whose contents come from a user-selected screen area, as well as an optional audio track. note: browser support for audio tracks varies, both in terms of whether or not they're supported at all by the media recorder and in terms of the which audio source or sourcoes are supported. check the compatibility table for details for each browser. exceptions rejections of the returned promise are made by passing a domexception error object to the promise's failure handler. possible errors are: aborterror...
...source of screen data, but a hardware or operating system level error or lockout occurred, preventing the sharing of the selected source. overconstrainederror after creating the stream, applying the specified constraints fails because no compatible stream could be generated. typeerror the specified constraints include constraints which are not permitted when calling getdisplaymedia(). these unsupported constraints are advanced and any constraints which in turn have a member named min or exact. usage notes privacy and security because getdisplaymedia() could be used in nefarious ways, it can be a source of significant privacy and security concerns. for that reason, the specification details measures browsers are required to take in order to fully support getdisplaymedia(). the speci...
MediaDevices - Web APIs
rom its parent interface, eventtarget. events devicechange fired when a media input or output device is attached to or removed from the user's computer. also available via the ondevicechange property. methods inherits methods from its parent interface, eventtarget. enumeratedevices() obtains an array of information about the media input and output devices available on the system. getsupportedconstraints() returns an object conforming to mediatracksupportedconstraints indicating which constrainable properties are supported on the mediastreamtrack interface. see capabilities and constraints in media capture and streams api (media stream) to learn more about constraints and how to use them. getdisplaymedia() prompts the user to select a display or portion of a display (such as a...
...tracks[0].label); stream.onremovetrack = function() { console.log('stream ended'); }; window.stream = stream; // make variable available to browser console video.srcobject = stream; }) .catch(function(error) { if (error.name === 'constraintnotsatisfiederror') { errormsg('the resolution ' + constraints.video.width.exact + 'x' + constraints.video.height.exact + ' px is not supported by your device.'); } else if (error.name === 'permissiondeniederror') { errormsg('permissions have not been granted to use your camera and ' + 'microphone, 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>'...
MediaEncodingConfiguration - Web APIs
properties a mediaencodingconfiguration dictionary takes two properties: type — the type of media being tested; takes one of two values: record — represents a configuration for recording of media, e.g. using mediarecorder. ...
...ted const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediaencodingconfiguration' in that specification. draft initial definition ...
MediaRecorder() - Web APIs
perties: mimetype: a mime type specifying the format for the resulting media; you may simply specify the container format (the browser will select its preferred codecs for audio and/or video), or you may use the codecs parameter and/or the profiles parameter to provide detailed information about which codecs to use and how to configure them. applications can check in advance if a mimetype is supported by the user agent by calling mediarecorder.istypesupported(). audiobitspersecond: the chosen bitrate for the audio component of the media. videobitspersecond: the chosen bitrate for the video component of the media. bitspersecond: the chosen bitrate for the audio and video components of the media. this can be specified instead of the above two properties. if this is specified along wi...
...d instead of the above two properties. if this is specified along with one or the other of the above properties, this will be used for the one that isn't specified. if bits per second values are not specified for video and/or audio, the default adopted for video is 2.5mbps, while the audio default is adaptive, depending upon the sample rate and the number of channels. exceptions notsupportederror the specified mime type is not supported by the user agent. example this example shows how to create a media recorder for a specified stream, whose audio bit rate is set to 128 kbit/sec and whose video bit rate is set to 2.5 mbit/sec. the recorded media data will be stored in an mp4 wrapper (so if you gather the chunks of media data and save them to disk, they will be in an mp4 fil...
MediaRecorder.mimeType - Web APIs
the mimetype read-only property returns the mime media type that was specified when creating the mediarecorder object, or, if none was specified, which was chosen by the browser. this is the file format of the file that would result from writing all of the recorded data to disk. keep in mind that not all codecs are supported by a given container; if you write media using a codec that is not supported by a given media container, the resulting file may not work reliably if at all when you try to play it back. see our media type and format guide for information about container and codec support across browsers. note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types. mdn web docs content uses the terms interchangeably. syn...
...d by the media recorder. the media type strings are standardized by the internet assigned numbers authority (iana). for their official list of defined media type strings, see the article media types on the iana site. see also media types to learn more about media types and how they're used in web content and by web browers. example ... ...
MediaSession.setActionHandler() - Web APIs
the mediasessionactiondetails dictionary, which provides both the action type (so the same function can handle multiple action types), as well as data needed in order to perform the action. media session actions a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the medi...
...iasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon. audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); }); navigator.mediasession.setactionhandler('seekbackward', evt => { // user clicked "seek backward" media notification icon. ...
MediaSessionActionDetails - Web APIs
g-point value indicating the absolute time within the media to move the playback position to, where 0 indicates the beginning of the media. this property is not present for other action types. media action types a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the medi...
...iasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon. audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); }); navigator.mediasession.setactionhandler('seekbackward', evt => { // user clicked "seek backward" media notification icon. ...
MediaSource.MediaSource() - Web APIs
...
... ...
MediaSource.readyState - Web APIs
the source is attached to a media element but the stream has been ended via a call to mediasource.endofstream(). syntax var myreadystate = mediasource.readystate; value a domstring. ...
...ritten by nick desaulniers (view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ...
MediaSource - Web APIs
eseekablerange() clears a seekable range previously set with a call to setliveseekablerange(). mediasource.endofstream() signals the end of the stream. mediasource.removesourcebuffer() removes the given sourcebuffer from the mediasource.sourcebuffers list. mediasource.setliveseekablerange() sets the range that the user can seek to in the media element. static methods mediasource.istypesupported() returns a boolean value indicating if the given mime type is supported by the current user agent — this is, if it can successfully create sourcebuffer objects for that mime type. examples the following simple example loads a video with xmlhttprequest, playing it as soon as it can. this example was written by nick desaulniers and can be viewed live here (you can also download the sou...
...ritten by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourceb...
MediaStreamAudioSourceNode - Web APIs
g live, or view the source. ...
...so playing/pausing the stream can still be done through the media element api and the player controls. specification specifica...
MediaStreamTrackAudioSourceNode() - Web APIs
h. options a mediastreamtrackaudiosourceoptions object defining the properties you want the mediastreamtrackaudiosourcenode to have: mediastreamtrack the mediastreamtrack from which to take audio data for this node's output. return value a new mediastreamtrackaudiosourcenode object representing the audio node whose media is obtained from the specified media track. exceptions notsupportederror the specified context is not an audiocontext. invalidstateerror the specified mediastreamtrack isn't an audio track (that is, its kind property isn't audio. example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio track provided by the device. let audioctx = new (window.audiocontext || wind...
... working draft ...
MediaStreamTrackAudioSourceNode - Web APIs
g live, or view the source. ...
...so playing/pausing the stream can still be done through the media element api and the player controls. specification specifica...
MediaStream Image Capture API - Web APIs
treamtrack objects to select the one you need. const track = mediastream.getvideotracks()[0]; at this point, you might want to configure the device capabilities before capturing an image. you can do this by calling applyconstraints() on the track object before doing anything else. ...
... let imagecapture = new imagecapture(track); interfaces imagecapture an interface for capturing images from a photographic device referenced through a valid mediastreamtrack. photocapabilities provides available configuration options for an attached photographic device. ...
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured video. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.cursor as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the v...
...are used. example: cursor always visible this example sets up the constraints to request that the cursor always be visible. let displaymediaoptions = { 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 displaymediaoptions = { 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 displaymediaoptions = { cursor: { exact: "none" } }; specifications specification status comment screen cap...
MediaTrackConstraints - Web APIs
ble values, and/or a value which you'd like to be as close to as possible. the specifics vary somewhat depending on the type of the constrainable property. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. this may be because a given browser doesn't support the property, or because it doesn't apply. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are accepta...
... control is preferred and/or required. channelcount a constrainlong specifying the channel count or range of channel counts which are acceptable and/or required. echocancellation a constrainboolean object specifying whether or not echo cancellation is preferred and/or required. latency a constraindouble specifying the latency or range of latencies which are acceptable and/or required. noisesuppression a constrainboolean which specifies whether noise suppression is preferred and/or required. samplerate a constrainlong specifying the sample rate or range of sample rates which are acceptable and/or required. samplesize a constrainlong specifying the sample size or range of sample sizes which are acceptable and/or required. volume a constraindouble specifying the volume or range of ...
Navigator.mediaCapabilities - Web APIs
s api. syntax mediacapabilitiesobj = globalobj.navigator.mediacapabilities value a mediacapabilities object. ...
...itiesobj = globalobj.navigator.mediacapabilities value a mediacapabilities object. ...
Navigator.share() - Web APIs
Web › API › Navigator › share
shared successfully' } catch(err) { resultpara.textcontent = 'error: ' + err } }); sharing files to share files, first test for and call navigator.canshare(). then include an array of files in the call to navigator.share(): notice: that the sample handles feature detection by testing for navigator.canshare() rather than for navigator.share(). the data object passed to canshare() only supports the files property. image, video, audio, and text files can be shared. if (navigator.canshare && navigator.canshare({ files: filesarray })) { navigator.share({ files: filesarray, title: 'pictures', text: 'our pictures.', }) .then(() => console.log('share was successful.')) .catch((error) => console.log('sharing failed', error)); } else { console.log(`your system doesn...
...ts the files property. image, video, audio, and text files can be shared. if (navigator.canshare && navigator.canshare({ files: filesarray })) { navigator.share({ files: filesarray, title: 'pictures', text: 'our pictures.', }) .then(() => console.log('share was successful.')) .catch((error) => console.log('sharing failed', error)); } else { console.log(`your system doesn't support sharing files.`); } specifications specification status comment web share apithe definition of 'share()' in that specification. draft ...
NetworkInformation.downlinkMax - Web APIs
ilable in web workers. syntax var max = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. ...
...ax = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. ...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
ementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when it loads: siblings of div-03 1. li 2. li 3. div 4. ...
...hile (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when it loads: siblings of div-03 1. li 2. li 3. div 4. ...
PaintWorklet - Web APIs
ter); load a paintworklet the following example demonstrates loading the above worklet from its js file and does so by feature detection. ...
...s) { css.paintworklet.addmodule('checkerboard.js'); } </script> use a paintworklet this example shows how to use a paintworklet in a stylesheet, including the simplest way to provide a fallback if paintworklet isn't supported. <style> textarea { background-image: url(checkerboard); background-image: paint(checkerboard); } </style> <textarea></textarea> you can also use the @supports at-rule. @supports (background: paint(id)) { background-image: paint(checkerboard); } specifications specification status comment css painting api level 1the definition of 'paintworkletglobalscope' in that specification. working draft initial definition. ...
PaymentDetailsBase - Web APIs
it is never directly used by developers and is included here only to be used as the basis for those documents. properties displayitemsoptional an array of paymentitem objects, each describing one line item for the payment request. these represent the line items on a receipt or invoice. modifiersoptional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). ...
... based on the selected payment method ("5% cash discount!"). shippingoptionsoptional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. derived dictionaries the following dictionaries include paymentdetailsbase. paymentdetailsinit provides payment information when calling the paymentrequest() constructor. paymentdetailsupdate provides updated payment details while the payment user interface is being handled. this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise provided to the paymentrequest.show() call that begins the user interaction. specifications specification status comment paym...
Payment Request API - Web APIs
erchant hopefully without requiring a html form. advantages of using the payment request api with "basic-card" (card-based payments): fast purchase experience: users enter their details once into the browser and are then ready to pay for goods and services on the web. they no longer have to fill out the same details repeatedly across different sites. consistent experience on every site (that supports the api): as the payment sheet is controlled by the browser, it can tailor the experience to the user. this can include localizing the ui into the user's preferred language. accessibility: as the browser controls the input elements of the payment sheet, it can assure consistent keyboard and screen reader accessibility on every website without developers needing to do anything. a browser cou...
...t handler (e.g., registered as allowed to use apple pay). dictionaries addresserrors a dictionary containing strings providing descriptive explanations of any errors in any paymentaddress entries which have errors. payererrors a dictionary containing strings providing descriptive explanations of any errors in related to paymentresponse's email, phone, and name attributes. paymentdetailsupdate an object describing changes that need to be made to the payment details in the event that the server needs to update information following the instantiation of the payment interface but before the user begins to interact with it. related dictionaries for the basic card specification basiccardchangedetails an object providing redacted address information that is provided as the methodd...
PerformanceEntry.entryType - Web APIs
sure was created by calling performance.measure(). paint performancepainttiming domstring either 'first-paint' or 'first-contentful-paint'. longtask performancelongtasktiming domstring reports instances of long tasks example the following example shows the use of the entrytype property. ...
... either 'first-paint' or 'first-contentful-paint'. longtask performancelongtasktiming domstring reports instances of long tasks example the following example shows the use of the entrytype property. ...
PerformanceEntry - Web APIs
hrestimestamp representing the starting time for the performance metric. performanceentry.duration read only a domhighrestimestamp representing the time value of the duration of the performance event. methods performanceentry.tojson() returns a json representation of the performanceentry object. example the following example checks all performanceentry properties to see if the browser supports them and if so, write their values to the console. function print_performanceentries() { // use getentries() to get a list of all performance entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { console.log("performanceentry[" + i + "]"); print_performanceentry(p[i]); } } function print_performanceentry(perfentry) { var properties = ["name", ...
...rmance.getentries(); for (var i=0; i < p.length; i++) { console.log("performanceentry[" + i + "]"); print_performanceentry(p[i]); } } function print_performanceentry(perfentry) { var properties = ["name", "entrytype", "starttime", "duration"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " is not supported"); } } } specifications specification status comment resource timing level 3 editor's draft resource timing level ...
PerformanceEventTiming - Web APIs
lytics`; you can replace it with your own url. function sendtoanalytics(data) { const body = json.stringify(data); // use `navigator.sendbeacon()` if available, falling back to `fetch()`. (navigator.sendbeacon && navigator.sendbeacon('/analytics', body)) || fetch('/analytics', {body, method: 'post', keepalive: true}); } // use a try/catch instead of feature detecting `first-input` // support, since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { function onfirstinputentry(entry) { // only report fid if the page wasn't hidden prior to // the entry being dispatched. this typically happens when a // page is loaded in a background tab. if (entry.starttime < firsthiddentime) { const fid = entry.proce...
...nputentry` for each entry. const po = new performanceobserver((entrylist) => { entrylist.getentries().foreach(onfirstinputentry); }); // observe entries of type `first-input`, including buffered entries, // i.e. entries that occurred before calling `observe()` below. po.observe({ type: 'first-input', buffered: true, }); } catch (e) { // do nothing if the browser doesn't support this api. } specifications specification status comment unknownthe definition of '[[member]]' in that specification. unknown initial definition. ...
Permissions.query() - Web APIs
Web › API › Permissions › query
onstatus) { ... }) parameters permissiondescriptor an object that sets options for the query operation consisting of a comma-separated list of name-value pairs. the available options are: name: the name of the api whose permissions you want to query. an up-to-date list of permission names can be found in the spec under the permissionname enum, but bear in mind that the actual permissions supported by browsers is currently much smaller than this. firefox for example currently supports geolocation, notifications, push, and persistent-storage (see our permissions.webidl file). uservisibleonly: (push only, not supported in firefox — see the browser support section below) indicates whether you want to show a notification for every message or be able to send silent push notifications. ...
...e: the persistent-storage permission allows an origin to use a persistent box (i.e persistent storage) for its storage, as per the storage api. returns a promise that resolves to a permissionstatus object. exceptions exception explanation typeerror retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g. midi, or push with uservisibleonly). example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state == 'granted') { showlocalnewswithgeolocation(); } else if (result.state == 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied. }); specification specification status commen...
Permissions.revoke() - Web APIs
ions.revoke(descriptor); parameters descriptor an object based on the permissiondescriptor dictionary that sets options for the operation consisting of a comma-separated list of name-value pairs. the available options are: name: the name of the api whose permissions you want to query. valid values are 'geolocation', 'midi', 'notifications', and 'push'. uservisibleonly: (push only, not supported in firefox — see the browser compatibility section below) indicates whether you want to show a notification for every message or be able to send silent push notifications. the default is false. sysex: (midi only) indicates whether you need and/or receive system exclusive messages. the default is false. note: as of firefox 44, the permissions for notifications and push have been m...
...tent-storage permission allows an origin to use a persistent box (i.e persistent storage) for its storage, as per the storage api. returns a promise that calls its fulfillment handler with a permissionstatus object indicating the result of the request. exceptions typeerror retrieving the permissiondescriptor information failed in some way, or the permission doesn't exist or is currently unsupported (e.g. midi, or push with uservisibleonly). example this function can be used by an app to request that its own geolocation api permission be revoked. function revokepermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.state); }); } ...
PointerEvent.pointerType - Web APIs
the pointertype read-only property of the pointerevent interface indicates the device type (mouse, pen, or touch) that caused a given pointer event. syntax var ptype = pointerevent.pointertype; return value ptype the event's pointer type. the supported values are the following strings: "mouse" the event was generated by a mouse device. "pen" the event was generated by a pen or stylus device. "touch" the event was generated by a touch, such as a finger. if the device type cannot be detected by the browser, the value can be an empty string (""). if the browser supports pointer device types other than those listed above, the value should be vendor-prefixed to avoid conflicting names for different types of devices. example this example illustrates using the value o...
... obsolete initial definition. pointer events – level 2the definition of 'pointertype' in that specification. recommendation non-stable version. css object model (cssom) view modulethe definition of 'mousee...
PointerEvent - Web APIs
hould call event.preventdefault() to keep the mouse event from being sent as well. pointerover this event is fired when a pointing device is moved into an element's hit test boundaries. pointerenter this event is fired when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown). this event type is similar to pointerover, but differs in that it does not bubble. pointerdown the event is fired when a pointer becomes active. for mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. for touch, it is fired when physical contact is made with the digitizer. for pen, it is fired when the stylus ma...
...event is fired when a pointer is no longer active. pointercancel a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the related device is deactived). pointerout this event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. pointerleave this event is fired when a pointing device is moved out of the hit test boundaries of an element. for pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. gotpointercapture this e...
Using Pointer Events - Web APIs
build a multi-touch enabled drawing application. this example is based on the one in the touch events overview, except it uses the pointer events input event model. another difference is that because pointer events are pointer device agnostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code. this application will only work on a browser that supports pointer events. a live version of this application is available on github. the source code is available on github and pull requests and bug reports are welcome. definitions surface a touch-sensitive surface. this may be a trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mousepad) with the physical screen. touch point a point of contact with the surf...
...n describing the contact with the surface, but it could, of course, also be a stylus, mouse, or other method of pointing at a location. create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application. <canvas id="canvas" width="600" height="600" style="border:solid black 1px; touch-action:none"> your browser does not support canvas element. </canvas> <br> <button onclick="startup()">initialize</button> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system). fu...
RTCDtlsTransport - Web APIs
e has no methods. description allocation of dtls transports rtcdtlstransport objects are created when an app calls either setlocaldescription() or setremotedescription(). the number of dtls transports created and how they're used depends on the bundling mode used when creating the rtcpeerconnection. whether bundling is used depends on what the other endpoint is able to negotiate. all browsers support bundling, so when both endpoints are browsers, you can rest assured that bundling will be used. some non-browser legacy endpoints, however, may not support bundle. to be able to negotiate with such endpoints (or to exclude them entirely), the rtcconfiguration property bundlepolicy may be provided when creating the connection. the bundlepolicy lets you control how to negotiate with these lega...
...of the communications for a given type of media (audio, video, or data channel). thus, a connection that has any number of audio and video channels will always have exactly one dtls transport for audio and one for video communications. because transports are established early in the negotiation process, it's likely that it won't be known until after they're created whether or not the remote peer supports bundling or not. for this reason, you'll sometimes see separate transports created at first, one for each track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receivers updated t...
RTCIceCandidateStats.address - Web APIs
s as separators, the value is interpreted as an ipv4 address. if the value is entirely comprised of hexadecimal digits and colon (":") characters, it is interpreted as an ipv6 address. ...
...record (assuming ipv6 is available), then using an a record (if no result is found or the device onlu supports ipv4). if multiple ip addresses are returned in response to the query, the user agent selects one, which is then used for the duration of ice processing. usage notes the address property was previously known as ip, and only permitted ipv4 and ipv6 addresses to be used. the addition of support for fully-qualified domain names to be used for the address brought about the renaming of the property. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats.address' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
es returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates. ice trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer. this property is only set after having called rtcpeerconnection.setremotedescription(). ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. if trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegatheringstate changes to "completed" before creating and sending the initial offer. that way, the offer contains all of the candidates. syntax var ...
...ickleicecandidates; value a boolean that is true if the remote peer can accept trickled ice candidates and false if it cannot. if no remote peer has been established, this value is null. note: this property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates. example var pc = new rtcpeerconnection(); // the following code might be used to handle an offer from a peer when // it isn't known whether it supports trickle ice. pc.setremotedescription(remoteoffer) .then(_ => pc.createanswer()) .then(answer => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescriptio...
RTCRtpCapabilities - Web APIs
escribe the capabilities of an rtcrtpsender or rtcrtpreceiver in response to a call to the rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities() static functions, both of which return an array of rtcrtpcapabilities objects. an rtcrtpcapabilities object contains an array of objects conforming to rtcrtpcodeccapability (each describing the capabilities of one codec) and an array of the supported rtp header extensions for that codec. properties codecs an array of rtcrtpcodeccapability objects, each describing one of the codecs supported by the rtcrtpsender or rtcrtpreceiver. there are some special entries in this array, described below in the section the codecs array. headerextensions an array of objects conforming to the rtcrtpheaderextensioncapability dictionary. each objec...
...l entries that should always be present, representing underlying components of the transport. those components are: red (redundant audio data) the media type of an red entry may vary due to there being several versions of it, but it will end with red, such as video/red or video/fwdred. the base red standard can be found in rfc 2198. there may be multiple entries for red if different forms are supported; each will have a unique media type in that case. fec (forward error correction) an fec component handles error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec. one possible value is video/ulpfec (a generic error connection model). there may also be multiple fec entries if more than one form is s...
RTCRtpSender.getCapabilities() static function - Web APIs
the static function rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by the rtcrtpsender. you can, similarly, obtain the capabilities of rtcrtpreceivers by calling the static function rtcrtpreceiver.getcapabilities(). syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as...
...codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user. for that reason, in privacy-sensitive contexts, the browser may choose to obscure the capabilities; this might be done, for example, by leaving out rarely-used codec configurations. example the function below returns a boolean indicating whether or not the device supports sending h.264 video on an rtcrtpsender. since rtcrtpsender.getcapabilities() actually only indicates probable support, h.264 support might still fail even after getting a positive response from this function. function cansendh264() { let capabilities = rtcrtpsender.getcapabilities("video"); capabilities.codecs.foreach((codec) => { if (codec.mimetype === "video/h264") { ret...
ReadableStreamBYOBReader - Web APIs
the readablestreambyobreader interface of the streams api represents a byob ("bring your own buffer") reader that can be used to read stream data supplied by the developer (e.g. a custom readablestream() constructor). constructor readablestreambyobreader() creates and returns a readablestreambyobreader object instance. properties readablestreambyobreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. ...
...tance. properties readablestreambyobreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreambyobreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestreambyobreader.read() returns a promise providing access to the next chunk in the stream's internal queue. readablestreambyobreader.releaselock() releases the reader's lock on the stream. examples tbd. specifications specification status comment streamsthe definitio...
ResizeObserverEntry.contentRect - Web APIs
the contentrect read-only property of the resizeobserverentry interface returns a domrectreadonly object containing the new size of the observed element when the callback is run. note that this is better supported than resizeobserverentry.borderboxsize or resizeobserverentry.contentboxsize, but it is left over from an earlier implementation of the resize observer api, is still included in the spec for web compat reasons, and may be deprecated in future versions. syntax var contentrect = resizeobserverentry.contentrect; value a domrectreadonly object containing the new size of the element indicated by the target property. if the target is an html element, the returned contentrect is the element's content box. if the target is an svgelement, the returned contentrect is the svg's bounding ...
... the new size of the element indicated by the target property. if the target is an html element, the returned contentrect is the element's content box. if the target is an svgelement, the returned contentrect is the svg's bounding box. examples the following snippet is taken from the resize-observer-text.html (see source) example. this uses a simple feature detection test to see if the browser supports the newer resizeobserverentry.contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it uses contentrect. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry...
ResizeObserverEntry - Web APIs
t containing the new border box size of the observed element when the callback is run. resizeobserverentry.contentboxsize read only an object containing the new content box size of the observed element when the callback is run. resizeobserverentry.contentrect read only a domrectreadonly object containing the new size of the observed element when the callback is run. note that this is better supported than the above two properties, but it is left over from an earlier implementation of the resize observer api, is still included in the spec for web compat reasons, and may be deprecated in future versions. resizeobserverentry.target read only a reference to the element or svgelement being observed. note: the content box is the box in which content can be placed, meaning the border box...
...e content box is the box in which content can be placed, meaning the border box minus the padding and border width. the border box encompasses the content, padding, and border. see the box model for further explanation. methods none. examples the following snippet is taken from the resize-observer-text.html (see source) example. this uses a simple feature detection test to see if the browser supports the newer contentboxsize property — if so, it uses that to get the sizing data it needs. if not, it uses the older contentrect property. const resizeobserver = new resizeobserver(entries => { for (let entry of entries) { if(entry.contentboxsize) { h1elem.style.fontsize = math.max(1.5, entry.contentboxsize.inlinesize/200) + 'rem'; pelem.style.fontsize = math.max(1, entry.
Sensor APIs - Web APIs
rors gracefully so that the user experience is enhanced rather than degraded. the code example below illustrates these principles. the try...catch block catches errors thrown during sensor instantiation. it implements a handler for sensor.onerror to catch errors thrown during use. the only time anything is shown to the user is when permissions need to be requested and when the sensor type isn't supported by the device. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. let accelerometer = null; try { accelerometer = new accelerometer({ referenceframe: 'device' }); accelerometer.addeventlistener('error...
...ddeventlistener('reading', () => reloadonshake(accelerometer)); accelerometer.start(); } catch (error) { // handle construction errors. if (error.name === 'securityerror') { // see the note above about feature policy. console.log('sensor construction was blocked by a feature policy.'); } else if (error.name === 'referenceerror') { console.log('sensor is not supported by the user agent.'); } else { throw error; } } permissions and feature policy sensor readings may not be taken unless the user grants permission to a specific sensor type. do this using the permissions api. a brief example, shown below, requests permission before attempting to use the sensor. navigator.permissions.query({ name: 'accelerometer' }) .then(result => { if (...
ServiceWorkerContainer - Web APIs
s to an array of serviceworkerregistration. serviceworkercontainer.startmessages() explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g. sent via client.postmessage()). this can be used to react to sent messages earlier, even before that page's content has finished loading. examples the example below first checks to see if the browser supports service workers. if supported, the code registers the service worker and determines if the page is actively controlled by the service worker. if it isn't, it prompts the user to reload the page so the service worker can take control. the code also reports any registration failures. if ('serviceworker' in navigator) { // register a service worker hosted at the root of the // site using t...
... { console.log('this page is currently controlled by:', navigator.serviceworker.controller); } // then, register a handler to detect when a new or // updated service worker takes control. navigator.serviceworker.oncontrollerchange = function() { console.log('this page is now controlled by:', navigator.serviceworker.controller); }; } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkercontainer' in that specification. working draft initial definition. ...
ServiceWorkerRegistration - Web APIs
ested title. serviceworkerregistration.update() checks the server for an updated version of the service worker without consulting caches. serviceworkerregistration.unregister() unregisters the service worker registration and returns a promise. the service worker will finish any ongoing operations before it is unregistered. examples in this example, the code first checks whether the browser supports service workers and if so registers one. next, it adds an updatefound listener in which it uses the service worker registration to listen for further changes to the service worker's state. if the service worker hasn't changed since the last time it was registered, then the updatefound event will not be fired. if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw.js') ...
... working draft initial definition. push apithe definition of 'pushmanager' in that specification. working draft adds the pushmanager property. notifications api living standard adds the shownotifica...
SourceBuffer.changeType() - Web APIs
the changetype() method of the sourcebuffer interface sets the mime type that future calls to appendbuffer() should expect the new media data to conform to. this makes it possible to change codecs or container type mid-stream. one scenario in which this is helpful is to support adapting the media source to changing bandwidth availability, by transitioning from one codec to another as resource constraints change. syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to. return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buff...
...ime type that future buffers will conform to. return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed. notsupportederror the specified mime type is not supported, or is not supported with the types of sourcebuffer objects present in the mediasource.sourcebuffers list. usage notes if the parent mediasource is in its "ended" readystate, calling changetype() will transition the media source to the "open" readystate and fire a simple event named sourceopen at the parent media source. ...
Streams API - Web APIs
streams api concepts, using readable streams, and using writable streams. stream interfaces readable streams readablestream represents a readable stream of data. it can be used to handle response streams of the fetch api, or developer-defined streams (e.g. a custom readablestream() constructor). readablestreamdefaultreader represents a default reader that can be used to read stream data supplied from a network (e.g. a fetch request). readablestreamdefaultcontroller represents a controller allowing control of a readablestream's state and internal queue. default controllers are for streams that are not byte streams. writable streams writablestream provides a standard abstraction for writing streaming data to a destination, known as a sink. this object comes with built-in backp...
...m, and can have a reader attached to it, etc. bytestream-related interfaces important: these are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough state for them to be implemented. this may change over time. readablestreambyobreader represents a byob ("bring your own buffer") reader that can be used to read stream data supplied by the developer (e.g. a custom readablestream() constructor). readablebytestreamcontroller represents a controller allowing control of a readablestream's state and internal queue. byte stream controllers are for byte streams. readablestreambyobrequest represents a pull into request in a readablebytestreamcontroller. examples we have created a directory of examples to go along with th...
SubtleCrypto.digest() - Web APIs
istance, meaning that it's hard to come up with two different inputs that have the same digest value. it takes as its arguments an identifier for the digest algorithm to use and the data to digest. it returns a promise which will be fulfilled with the digest. syntax const digest = crypto.subtle.digest(algorithm, data); parameters algorithm is a domstring defining the hash function to use. ...
...they have a variety of applications in cryptography. ...
SubtleCrypto.encrypt() - Web APIs
exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or aes-gcm plaintext longer than 2³ā¹−256 bytes). supported algorithms the web crypto api provides four algorithms that support the encrypt() and decrypt() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem. the other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard). the difference between them is the mode. the web ...
...rithms the web crypto api provides four algorithms that support the encrypt() and decrypt() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem. the other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard). the difference between them is the mode. the web crypto api supports three different aes modes: ctr (counter mode) cbc (cipher block chaining) gcm (galois/counter mode) it's strongly recommended to use authenticated encryption, which includes checks that the ciphertext has not been modified by an attacker. authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the r...
SubtleCrypto.exportKey() - Web APIs
keys are not exported in an encrypted format: to encrypt keys when exporting them use the subtlecrypto.wrapkey() api instead. ...
...cryptokey to export. return value result is a promise. if format was jwk, then the promise fulfills with a json object containing the key. otherwise the promise fulfills with an arraybuffer containing the key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when trying to export a non-extractable key. notsupported raised when trying to export in an unknown format. typeerror raised when trying to use an invalid format. examples note: you can try the working examples out on github. raw export this example exports an aes key as an arraybuffer containing the bytes for the key. see the complete code on github. /* export the given key and write it into the "exported-key" space. */ async function...
SubtleCrypto.importKey() - Web APIs
syntax const result = crypto.subtle.importkey( format, keydata, algorithm, extractable, usages ); parameters format is a string describing the data format of the key to import. ...
... return value result is a promise that fulfills with the imported key as a cryptokey object. exceptions the promise is rejected when one of the following exceptions is encountered: syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised when trying to use an invalid format or if the keydata is not suited for that format. supported formats this api supports four different key import/export formats: raw, pkcs #8, subjectpublickeyinfo, and json web key. raw you can use this format to import or export aes or hmac secret keys, or elliptic curve public keys. in this format the key is supplied as an arraybuffer containing the raw bytes for the key. pkcs #8 you can use this format to import or export rsa or elliptic cu...
SubtleCrypto - Web APIs
ou want to derive an encryption key from a password and later derive the same key from the same password to decrypt the data. importing and exporting keys to make keys available outside your app, you need to export the key, and that's what exportkey() is for. you can choose one of a number of export formats. the inverse of exportkey() is importkey(). you can import keys from other systems, and support for standard formats like pkcs #8 and json web key helps you do this. the exportkey() function exports the key in an unencrypted format. if the key is sensitive you should use wrapkey(), which exports the key and then encrypts it using another key; the api calls a "key-wrapping key". the inverse of wrapkey() is unwrapkey(), which decrypts then imports the key. storing keys cryptokey objec...
...using another key; the api calls a "key-wrapping key". the inverse of wrapkey() is unwrapkey(), which decrypts then imports the key. storing keys cryptokey objects can be stored using the structured clone algorithm, meaning that you can store and retrieve them using standard web storage apis. the specification expects that most developers will use the indexeddb api to store cryptokey objects. supported algorithms the cryptographic functions provided by the web crypto api can be performed by one or more different cryptographic algorithms: the algorithm argument to the function indicates which algorithm to use. some algorithms need extra parameters: in these cases the algorithm argument is a dictionary object that includes the extra parameters. the table below summarises which algorithms ...
TextEncoder - Web APIs
example const encoder = new textencoder() const view = encoder.encode('€') console.log(view); // uint8array(3) [226, 130, 172] constructor textencoder() returns a newly constructed textencoder that will generate a byte stream with utf-8 encoding. properties the textencoder interface doesn't inherit any property. textencoder.prototype.encodingread only always returns "utf-8". methods the textencoder interface doesn't inherit any method. ...
...uint8array containing utf-8 encoded text. textencoder.prototype.encodeinto() takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding. this is potentially more performant than the older encode() method. polyfill the below polyfill is compliant with the standard and therefore only supports utf-8. it is designed to work in ie5 "out of the box". however, in ie5-ie9, it will return a regular array instead of a typedarray. in those cases a polyfill might be impractical for large strings. finally, note that you should run the below code through a minifier (especially closure compiler) to turn sequences like 0x1e << 3 into 0xf0. these sequences are not already precomputed because th...
TouchEvent - Web APIs
touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. ...
...and the exact reasons will vary from device to device, as well as browser to browser): an event of some kind occurred that canceled the touch; this might happen if a modal alert pops up during the interaction. the touch point has left the document window and moved into the browser's ui area, a plug-in, or other external content. the user has placed more touch points on the screen than can be supported, in which case the earliest touch in the touchlist gets canceled. using with addeventlistener() and preventdefault() it's important to note that in many cases, both touch and mouse events get sent (in order to let non-touch-specific code still interact with the user). if you use touch events, you should call preventdefault() to keep the mouse event from being sent as well. the exception...
URL.createObjectURL() - Web APIs
when the document is unloaded; however, for optimal performance and memory usage, if there are safe times when you can explicitly unload them, you should do so. using object urls for media streams in older versions of the media source specification, attaching a stream to a <video> element required creating an object url for the mediastream. this is no longer necessary, and browsers are removing support for doing this. important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly. specifications specification status comment file apithe definition of 'createobjecturl()' in that specification. working draft initial definition. me...
... ...
USBConfiguration - Web APIs
constructor usbconfiguration.usbconfiguration() creates a new usbconfiguration object which contains information about the configuration on the provided usbdevice with the given configuration value. properties usbconfiguration.configurationvalueread only returns the configuration value of this configuration. this is equal to the bconfigurationvalue field of the configuration descriptor provided by the device defining this configuration. ...
...iguration.configurationnameread only returns the name provided by the device to describe this configuration. this is equal to the value of the string descriptor with the index provided in the iconfiguration field of the configuration descriptor defining this configuration. usbconfiguration.interfacesread only returns an array containing instances of the usbinterface describing each interface supported by this configuration. specifications specification status comment webusbthe definition of 'usbconfiguration' in that specification. draft initial definition. ...
USBDevice - Web APIs
Web › API › USBDevice
evice. usbdevice.productid read only the manufacturer-defined code that identifies a usb device. usbdevice.productname read only the manufacturer-defined name that identifies a usb device. usbdevice.serialnumber read only the manufacturer-defined serial number for the specific usb device. usbdevice.usbversionmajor read only one of three properties that declare the usb protocol version supported by the device. the other two properties are usbdevice.usbversionminor and usbdevice.usbversionsubminor. usbdevice.usbversionminor read only one of three properties that declare the usb protocol version supported by the device. the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionsubminor. usbdevice.usbversionsubminor read only one of three properties that dec...
...the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionminor. usbdevice.vendorid read only the official usg.org-assigned vendor id. ...
UserDataHandler - Web APIs
stination node (if any, or null). ...
...ants 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_adopted 5 document.adoptnode() (node_renamed is currently not supported since node.renamenode() is not supported.) specification dom level 3 core: userdatahandler ...
VRStageParameters - Web APIs
this interface is accessible through the vrdisplay.stageparameters property. properties vrstageparameters.sittingtostandingtransform read only contains a matrix that transforms the sitting-space view matrices of vrframedata to standing-space. vrstageparameters.sizex read only returns the width of the play-area bounds in meters. vrstageparameters.sizey read only returns the depth of the play-area bounds in meters. ...
...ameters.sizey read only returns the depth of the play-area bounds in meters. ...
WebGL2RenderingContext - Web APIs
the webgl2renderingcontext interface implements all members of the webglrenderingcontext interface. ...
...ebuffer() invalidates the contents of attachments in a framebuffer. webgl2renderingcontext.invalidatesubframebuffer() invalidates portions of the contents of attachments in a framebuffer webgl2renderingcontext.readbuffer() selects a color buffer as the source for pixels. renderbuffers webgl2renderingcontext.getinternalformatparameter() returns information about implementation-dependent support for internal formats. webgl2renderingcontext.renderbufferstoragemultisample() creates and initializes a renderbuffer object's data store and allows specifying the number of samples to be used. textures webgl2renderingcontext.texstorage2d() specifies all levels of two-dimensional texture storage. webgl2renderingcontext.texstorage3d() specifies all levels of a three-dimensional textur...
Basic scissoring - Web APIs
the typical order of commands in webgl. we first tweak webgl state. in this case, enabling the scissor test and establishing a rectangular mask. only when the webgl state has been satisfactorily tweaked, we execute the drawing command (in this case, clear()) that starts the processing of fragments down the graphics pipeline. ...
...(in css pixels) of // the drawing buffer to be identical to the size of the // canvas html element, as determined by css. canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // enable scissoring operation and define the position and // size of the scissoring area. gl.enable(gl.scissor_test); gl.scissor(40, 20, 60, 130); // clear the drawing buffer solid yellow. gl.clearcolor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); }, false); the source co...
Boilerplate 1 - Web APIs
ext. in case of error, it displays an error message and returns null. finally, all javascript code will run within an immediate function, which is a common javascript technique (see function). the function declaration and invocation will also be hidden. html <p>[ some descriptive text about the example. ]</p> <button>[ optional button element. ...
... « previousnext » ...
Clearing by clicking - Web APIs
s the canvas or the button, the canvas is cleared with a new randomly chosen color. note how we embed the webgl function calls inside the event handler function. ...
...efined gl variable. // if undefined, try to obtain the webglrenderingcontext. // if failed, alert user of failure. // otherwise, initialize the drawing buffer (the viewport). if (!gl) { gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function. var color = getrandomcolor(); // set the clear color to the random color. gl.clearcolor(color[0], color[1], color[2], 1.0); // clear the context with the newly set color. this is // the function cal...
Color masking - Web APIs
each operation serves as the input of the next. so, for example, clearing operation sets the value of each pixel to the chosen clear color. masking occurs later in the pipeline, and modifies the pixel color value, so the final result on the screen is that of the clear color, tinted by the color mask. ...
...tlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.queryselector("#blue-toggle"); redtoggle.addeventlistener("click", setc...
Detect WebGL - Web APIs
to that end we will try to obtain the webgl rendering context from a canvas element. the webgl rendering context is an interface, through which you can set and query the state of the graphics machine, send data to the webgl, and execute draw commands. ...
...lf, so it is never displayed in the // browser window. var canvas = document.createelement("canvas"); // get webglrenderingcontext from canvas element. var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); // report the result. if (gl && gl instanceof webglrenderingcontext) { paragraph.innerhtml = "congratulations! your browser supports webgl."; } else { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; } } }, false); the source code of this example is also available on github. « previousnext » ...
Hello GLSL - Web APIs
not work in some mobile or older browsers. if the canvas remains blank, you can check the output of the next example, which draws exactly the same thing. but remember to read through the explanations and code on this page, before moving on to the next. hello world program in glsl a very simple first shader program. ...
... « previousnext » ...
Hello vertex attributes - Web APIs
ates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes. hello world program in glsl how to send input to a shader program by saving data in gpu memory. <p>first encounter with attributes and sending data to gpu. ...
... « previousnext » ...
Raining rectangles - Web APIs
nd state machine. in addition, the example demonstrates how to integrate the webgl function calls within a game loop. the game loop is responsible for drawing the animation frames, and keeping the animation responsive to user input. here, the game loop is implemented using timeouts. <p>you caught <strong>0</strong>. ...
... « previousnext » ...
Scissor animation - Web APIs
en update only its position every frame. the clear color state of webgl remains at the set value, until we change it again when a new square is created. ...
... « previousnext » ...
Simple color animation - Web APIs
imation. the timer and the timer handler function establish the animation loop, a set of drawing commands that are executed at a regular period (typically, every frame; in this case, once per second). ...
... for canvas and button. stopanimation({type: "click"}); var gl; function drawanimation () { if (!gl) { var canvas = document.getelementbyid("canvas-view"); gl = canvas.getcontext("webgl") ||canvas.getcontext("experimental-webgl"); if (!gl) { clearinterval(timer); alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function. var color = getrandomcolor(); // set the webglrenderingcontext clear color to the // random color. gl.clearcolor(color[0], color[1], color[2], 1.0); // clear the context with the newly set color. ...
Textures from code - Web APIs
bgl example provides a simple demonstration of procedural texturing with fragment shaders. that is, using code to generate textures for use in shading webgl objects. drawing textures with code texturing a point sprite with calculations done per-pixel in the fragment shader. <p>texture from code. ...
... « previousnext » ...
Using textures in WebGL - Web APIs
ed from secure contexts, you can't use textures loaded from file:/// urls in webgl. that means that you'll need a secure web server to test and deploy your code. for local testing, see our guide how do you set up a local testing server? for help. see this hacks.mozilla.org article for an explanation of how to use cors-approved images as webgl textures, with a self-contained example. note: cors support for webgl textures and the crossorigin attribute for image elements is implemented in gecko 8.0. tainted (write-only) 2d canvases can't be used as webgl textures. a 2d <canvas> becomes tainted, for example, when a cross-domain image is drawn on it. note: cors support for canvas 2d drawimage is implemented in gecko 9.0. this means that using a cross-domain image with cors approval does no ...
...ted (write-only) 2d canvases can't be used as webgl textures. a 2d <canvas> becomes tainted, for example, when a cross-domain image is drawn on it. note: cors support for canvas 2d drawimage is implemented in gecko 9.0. this means that using a cross-domain image with cors approval does no longer taint the 2d canvas, so the 2d canvas remains usable as the source of a webgl texture. note: cors support for cross-domain videos and the crossorigin attribute for <video> elements is implemented in gecko 12.0. « previousnext » ...
WebGL tutorial - Web APIs
webgl programs consist of control code written in javascript and special effects code (shader code) that is executed on a computer's graphics processing unit (gpu). webgl elements can be mixed with other html elements and composited with other parts of the page or page background. this tutorial describes how to use the <canvas> element to draw webgl graphics, starting with the basics. ...
...as> element to draw webgl graphics, starting with the basics. the examples provided should give you some clear ideas what you can do with webgl and will provide code snippets that may get you started in building your own content. before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascript. the <canvas> element and webgl are not supported in some older browsers, but are supported in recent versions of all major browsers. in order to draw graphics on the canvas we use a javascript context object, which creates graphics on the fly. in this tutorial getting started with webgl how to set up a webgl context. adding 2d content to a webgl context how to render simple flat shapes using webgl. using shaders to apply color in ...
WebRTC connectivity - Web APIs
r consideration, but any local ice candidates which have already been gathered since the offer or answer was created. similarly, pendingremotedescription includes any remote ice candidates which have been provided by calls to rtcpeerconnection.addicecandidate(). see the individual articles on these properties and methods for more specifics, and codecs used by webrtc for information about codecs supported by webrtc and which are compatible with which browsers. the codecs guide also offers guidance to help you choose the best codecs for your needs. ice candidates as well as exchanging information about the media (discussed above in offer/answer and sdp), peers must exchange information about the network connection. this is known as an ice candidate and details the available methods the peer...
...the line toward their worse candidates. ideally, candidates are udp (since it's faster, and media streams are able to recover from interruptions relatively easily), but the ice standard does allow tcp candidates as well. generally, ice candidates using tcp are only going to be used when udp is not available or is restricted in ways that make it not suitable for media streaming. not all browsers support ice over tcp, however. ice allows candidates to represent connections over either tcp or udp, with udp generally being preferred (and being more widely supported). each protocol supports a few types of candidate, with the candidate types defining how the data makes its way from peer to peer. udp candidate types udp candidates (candidates with their protocol set to udp) can be one of these...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
rtc include: generally low latency. packets are sequence-numbered and time-stamped for reassembly if they arrive out of order. this lets data sent using rtp be delivered on transports that don't guarantee ordering or even guarantee delivery at all. this means rtp can be — but is not required to be — used atop udp for its performance as well as its multiplexing and checksum features. rtp supports multicast; while this isn't yet important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations. rtp isn't limited to use in audiovisual communication. it can be used for any form of continuous or active data transfer, including data streaming, active badges or status display updates, or control and measurement information t...
...of resources that may be needed. where it matters for webrtc purposes, these are dealt with in a variety of places within the webrtc infrastructure. for example, rtcp handles qos monitoring. rtcpeerconnection and rtp each rtcpeerconnection has methods which provide access to the list of rtp transports that service the peer connection. these correspond to the following three types of transport supported by rtcpeerconnection: rtcrtpsender rtcrtpsenders handle the encoding and transmission of mediastreamtrack data to a remote peer. the senders for a given connection can be obtained by calling rtcpeerconnection.getsenders(). rtcrtpreceiver rtcrtpreceivers provide the ability to inspect and obtain information about incoming mediastreamtrack data. a connection's receivers can be obtained ...
Lifetime of a WebRTC session - Web APIs
d that something had to be done before we ran out of addresses to use, so they started working on designing a new 64-bit addressing system. but they realized that it would take longer to complete the transition than 32-bit addresses would last, so other smart people came up with a way to let multiple computers share the same 32-bit ip address. network address translation (nat) is a standard which supports this address sharing by handling routing of data inbound and outbound to and from devices on a lan, all of which are sharing a single wan (global) ip address. the problem for users is that each individual computer on the internet no longer necessarily has a unique ip address, and, in fact, each device’s ip address may change not only if they move from one network to another, but if their ...
...he ice agent may choose to perform ice restart. this is a process by which the network connection is renegotiated, exactly the same way the initial ice negotiation is performed, with one exception: media continues to flow across the original network connection until the new one is up and running. then media shifts to the new network connection and the old one is closed. note: different browsers support ice restart under different sets of conditions. not all browsers will perform ice restart due to network congestion, for example. if you need to change the configuration of the connection in some way (such as changing to a different set of ice servers), you can do so before restarting ice by calling rtcpeerconnection.setconfiguration() with an updated rtcconfiguration dictionary before rest...
A simple RTCDataChannel sample - Web APIs
atch(handlecreatedescriptionerror); let's go through this line by line and decipher what it means. first, we call rtcpeerconnection.createoffer() method to create an sdp (session description protocol) blob describing the connection we want to make. this method accepts, optionally, an object with constraints to be met for the connection to meet your needs, such as whether the connection should support audio, video, or both. in our simple example, we don't have any constraints. if the offer is created successfully, we pass the blob along to the local connection's rtcpeerconnection.setlocaldescription() method. this configures the local end of the connection. the next step is to connect the local peer to the remote by telling the remote peer about it. this is done by calling remoteconnecti...
... being built. in a real application, this would require a signaling server to exchange the description object. that means it's time for the remote peer to reply. it does so by calling its createanswer() method. this generates a blob of sdp which describes the connection the remote peer is willing and able to establish. this configuration lies somewhere in the union of options that both peers can support. once the answer has been created, it's passed into the remoteconnection by calling rtcpeerconnection.setlocaldescription(). that establishes the remote's end of the connection (which, to the remote peer, is its local end. this stuff can be confusing, but you get used to it). again, this would normally be exchanged through a signalling server. finally, the local connection's remote descript...
Writing WebSocket client applications - Web APIs
ol of "protocolone" is named in the request for the socket in this example, though this can be omitted. var examplesocket = new websocket("wss://www.example.com/socketserver", "protocolone"); on return, examplesocket.readystate is connecting. the readystate will become open once the connection is ready to transfer data. if you want to open a connection and are flexible about the protocols you support, you can specify an array of protocols: var examplesocket = new websocket("wss://www.example.com/socketserver", ["protocolone", "protocoltwo"]); once the connection is established (that is, readystate is open), examplesocket.protocol will tell you which protocol the server selected. establishing a websocket relies on the http upgrade mechanism, so the request for the protocol upgrade is i...
...nsmitted on the network. if this value isn't 0, there's pending data still, so you may wish to wait before closing the connection. security considerations websockets should not be used in a mixed content environment; that is, you shouldn't open a non-secure websocket connection from a page loaded using https or vice-versa. most browsers now only allow secure websocket connections, and no longer support using them in insecure contexts. ...
Lighting a WebXR setting - Web APIs
ly expensive it becomes. increased shadow detail, volumetric light (that is, lighting that you can see in the air, such as sunbeams or the beams of spotlights in the sky), and other lighting effects can add realism and beauty to your scene, but caution needs to be taken to ensure the scene doesn't overwhelm the gpu. computing the color of a lighted pixel although some graphics libraries include support for light source objects and automatically calculate and apply lighting effect for you, webgl does not. fortunately, lighting isn't overly difficult to apply in your own vertex and fragment shaders. for each polygon in the scene, the vertex shader program determines the vertices' colors, and then the fragment shader generates each pixel in the polygon by combining the appropriate texel from ...
...rld surrounding the viewer. this involves the collection of data that may come from various sensors (including the accelerometer and compass, if available), cameras, and potentially others. other data is collected using the geolocation api, and then all this data is put through algorithms and machine learning engines to generate the estimated lighting information. at present, webxr doesn't offer support for lighting estimation. however, a specification is currently being drafted under the auspices of the w3c. you can learn all about the proposed api and a fair amount about the concept of lighting estimation in the explainer documnent that's included in the specification's github repository. in essence, lighting estimation collects this information about the light sources and the shape and o...
Basic concepts behind Web Audio API - Web APIs
you enough background to understand why the web audio api works like it does. audio graphs the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing. basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. several sources — with different types of channel layout — are supported even within a single context. this modular design provides the flexibility to create complex audio functions with dynamic effects. audio nodes are linked via their inputs and outputs, forming a chain that starts with one or more sources, goes through one or more nodes, then ends up at a destination. although, you don't have to provide a destination if you, say, just want to visualize some ...
...is the number of full frequency range audio channels that the signal includes. the number after the period indicates the number of those channels which are reserved for low-frequency effect (lfe) outputs; these are often referred to as subwoofers. each input or output is composed of one or more audio channels, which together represent a specific audio layout. any discrete channel structure is supported, including mono, stereo, quad, 5.1, and so on. audio sources can be obtained in a number of ways: sound can be generated directly in javascript by an audio node (such as an oscillator). created from raw pcm data (the audio context has methods to decode supported audio formats). taken from html media elements (such as <video> or <audio>). taken directly from a webrtc mediastream (su...
Web Audio API - Web APIs
ations, apply spatial effects (such as panning) and much more. web audio concepts and usage the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing. basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph. several sources — with different types of channel layout — are supported even within a single context. this modular design provides the flexibility to create complex audio functions with dynamic effects. audio nodes are linked into chains and simple webs by their inputs and outputs. they typically start with one or more sources. sources provide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second. these coul...
...nto different streams. a common modification is multiplying the samples by a value to make them louder or quieter (as is the case with gainnode). once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (audiocontext.destination), which sends the sound to the speakers or headphones. this last connection is only necessary if the user is supposed to hear the audio. a simple, typical workflow for web audio would look something like this: create audio context inside the context, create sources — such as <audio>, oscillator, stream create effects nodes, such as reverb, biquad filter, panner, compressor choose final destination of audio, for example your system speakers connect the sources up to the effects, and the effects to ...
Web NFC API - Web APIs
interfaces ndefmessage interface that represents ndef messages that can be received from or sent to a compatible device or tag via ndefreader and ndefwriter objects respectively. a message is composed of metadata and ndef records. ...
... interfaces ndefmessage interface that represents ndef messages that can be received from or sent to a compatible device or tag via ndefreader and ndefwriter objects respectively. a message is composed of metadata and ndef records. ...
Privileged features - Web APIs
ignored. the dependent feature is currently under revision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method. chrome if on, the page is loaded as window's only content, without any of the browser's interface elements. there will be no context menu defined by default and none of the standard keyboard shortcuts will work. the page is supposed to provide a user interface of its own, usually this feature is used to open xul documents (standard dialogs like the javascript console are opened this way). dialog the dialog feature removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button. mozilla 1.2+ and netscape 7.1 will render the other menu system commands (in ff 1.0 and in ns 7.0x...
...aid to be modal. the user cannot return to the main window until the modal window is closed. a typical modal window is created by the alert() function. the exact behavior of modal windows depends on the platform and on the mozilla release version. note: as of gecko 1.9, the internet explorer equivalent to this feature is the window.showmodaldialog() method. for compatibility reasons, it's now supported in firefox. note also that starting in gecko 2.0, you can use window.showmodaldialog() without universalbrowserwrite privileges. titlebar by default, all new secondary windows have a titlebar. if set to no or 0, this feature removes the titlebar from the new secondary window. mozilla and firefox users can force new windows to always render the titlebar by setting dom.disable_window_...
Window.screenLeft - Web APIs
Web › API › Window › screenLeft
syntax leftwindowpos = window.screenleft returns a number equal to the number of css pixels from the left edge of the browser viewport to the left edge of the screen. ...
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screenleft' in that specification. working draft initial definit...
Window.screenTop - Web APIs
Web › API › Window › screenTop
syntax topwindowpos = window.screentop returns a number equal to the number of css pixels from the top edge of the browser viewport to the top edge of the screen. ...
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screentop' in that specification. working draft initial definiti...
Window.screenX - Web APIs
Web › API › Window › screenX
the window.screenx read-only property returns the horizontal distance, in css pixels, of the left border of the user's browser viewport to the left side of the screen. note: an alias of screenx was implemented across modern browsers in more recent times — window.screenleft. this was originally supported only in ie but was introduced everywhere due to popularity. syntax leftwindowpos = window.screenx returns a number equal to the number of css pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop (source code) example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same ...
...ht/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); these work in exactly the same way as screenx/screeny. also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using screenx/screeny. if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screenx' in that specification. working draft initial definition. ...
Window.screenY - Web APIs
Web › API › Window › screenY
the window.screeny read-only property returns the vertical distance, in css pixels, of the top border of the user's browser viewport to the top edge of the screen. note: an alias of screeny was implemented across modern browsers in more recent times — window.screentop. this was originally supported only in ie but was introduced everywhere due to popularity. syntax topwindowpos = window.screeny returns a number equal to the number of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on t...
...ht/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.requestanimationframe(positionelem); } window.requestanimationframe(positionelem); these work in exactly the same way as screenx/screeny. also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using screenx/screeny. if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom) view modulethe definition of 'window.screeny' in that specification. working draft initial definition. ...
WritableStream.WritableStream() - Web APIs
the total number of chunks that can be contained in the internal queue before backpressure is applied. size(chunk) a method containing a parameter chunk — this indicates the size to use for each chunk, in bytes. note: you could define your own custom queuingstrategy, or use an instance of bytelengthqueuingstrategy or countqueuingstrategy for this object value. if no queuingstrategy is supplied, the default used is the same as a countqueuingstrategy with a high water mark of 1. return value an instance of the writablestream object. examples the following example illustrates several features of this interface. it shows the creation of the writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly...
...; }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example. backpressure because of how backpressure is supported in the api, its implementation in code may be less than obvious. to see how backpressure is implemented look for three things. the highwatermark property, which is set when creating the counting strategy (line 35), sets the maximum amount of data that the writablestream instance will handle in a single write() operation. in this example, it's the maximum amount of data that can be sent t...
XMLHttpRequest.responseType - Web APIs
tring taken from the xmlhttprequestresponsetype enum which specifies what type of data the response contains. when setting responsetype to a particular value, the author should make sure that the server is actually sending a response compatible with that format. if the server returns data that is not compatible with the responsetype that was set, the value of response will be null. the values supported by responsetype are the following: "" an empty responsetype string is treated the same as "text", the default type. arraybuffer the response is a javascript arraybuffer containing binary data. blob the response is a blob object containing the binary data. document the response is an html document or xml xmldocument, as appropriate based on the mime type of the received data. see h...
...the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. exceptions invalidaccesserror an attempt was made to change the value of responsetype on anxmlhttprequest which is in synchronous mode but not in a worker. for additional details, see synchronous xhr restrictions below. usage notes synchronous xhr restrictions you cannot change the value of responsetype in a synchronous xmlhttprequest except when the request ...
XRPermissionDescriptor.requiredFeatures - Web APIs
this ensures that permissions are checked as applicable to ensure that those features are available upon request. ...
...om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace usage notes examples in this example, permissions ...
XRReferenceSpace - Web APIs
the webxr device api's xrreferencespace interface describes the coordinate system for a specific tracked entity or object within the virtual world using a specified tracking behavior. the tracking behavior is defined by the selected reference space type. it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world. all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. these are special spaces which let you establish a perimeter within which it's "safe" for the viewer to mov...
...om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace usage notes creating an xrreferencespace there are...
XRReferenceSpaceType - Web APIs
this type is used when calling the requestreferencespace() method to obtain a reference space for an xrsession. values the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief information about their use cases and which interface is used to implement them. ...
...om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace specifications specification status ...
XRSession.requestReferenceSpace() - Web APIs
om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace return value a promise that resolves with an xrrefe...
...an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace return value a promise that resolves with an xrreferencespace object. exceptions rather than throwing true exceptions, requestreferencespace() rejects the returned promise with a domexception whose name is found in the list below: notsupportederror the requested reference space is not supported. specifications specification status comment webxr device apithe definition of 'requestreferencespace()' in that specification. working draft initial definition. ...
XRSession - Web APIs
Web › API › XRSession
rsession interface represents an ongoing xr session, providing methods and properties used to interact with and control the session. to open a webxr session, use the xrsystem interface's requestsession() method. with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather information about the user's environment, and present imagery to the user. xrsession supports both inline and immersive virtual and augmented reality modes. properties in addition to the properties listed below, xrsession inherits properties from its parent interface, eventtarget. environmentblendmode read only returns this session's blend mode which denotes how much of the real-world environment is visible through the xr device and how the device will blend the device ima...
...can be used to identify the request for the purposes of canceling the callback using cancelanimationframe(). this method is comparable to the window.requestanimationframe() method. requestreferencespace() requests that a new xrreferencespace of the specified type be created. returns a promise which resolves with the xrreferencespace or xrboundedreferencespace which was requested, or throws a notsupportederror if the requested space type isn't supported by the device. updaterenderstate() updates the properties of the session's render state to match the values specified in the specified xrrenderstateinit dictionary. any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. ev...
XRSessionInit - Web APIs
ssioninit specifies required and/or optional features when requesting a new xrsession by calling the navigator.xr.requestsession() method. properties the following parameters are all optional. if none are included, the device will use a default feature configuration for all options. optionalfeatures optional an array of values identifying features which the returned xrsession may optionally support. at this time, all features are identified using strings from the xrreferencespacetype enumeration, but future updates to the webxr standard may add more features. requiredfeatures optional an array of values which the returned xrsession must support. these values currently must come from the enumerated type xrreferencespacetype. more features may be added in future updates to the webxr sta...
... future updates to the webxr standard may add more features. requiredfeatures optional an array of values which the returned xrsession must support. these values currently must come from the enumerated type xrreferencespacetype. more features may be added in future updates to the webxr standard. default features immersive sessions all immersive (both immersive-vr and immersive-ar) sessions support both the viewer and local reference spaces. because immersive sessions are required to support the local reference space, any request to open an immersive xrsession is required to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requirements each reference space or feature type has minimum safety requirements...
XRWebGLLayer - Web APIs
the xrwebgllayer interface of the webxr device api provides a linkage between the webxr device (or simulated xr device, in the case of an inline session) and a webgl context used to render the scene for display on the device. in particular, it provides access to the webgl framebuffer and viewport to ease access to the context. although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources. constructor new xrwebgllayer() creates and returns a new xrwebgllayer object for use by the specified xrsession, using a particular webglrenderingcontext or webgl2renderingcontext as the destination context. properties antialias read only...
...ification may allow for other layer types and corresponding image sources. constructor new xrwebgllayer() creates and returns a new xrwebgllayer object for use by the specified xrsession, using a particular webglrenderingcontext or webgl2renderingcontext as the destination context. properties antialias read only a boolean value indicating whether or not the webgl context's framebuffer supports anti-aliasing. the specific type of anti-aliasing is determined by the user agent. framebuffer read only returns a webglframebuffer suitable for passing into the bindframebuffer() method. framebufferwidth read only returns the width of the xrwebgllayer's framebuffer. framebufferheight read only returns the height of the layer's framebuffer. ignoredepthvalues read only a boolean w...
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayerinit object provided as the xrwebgllayer() constructor's layerinit parameter, requests that the new webgl rendering layer support anti-aliasing. if this property is missing or is false, anti-aliasing is not desired. there is no way to request a specific anti-aliasing format or level; this decision is left up to the user agent. syntax let layerinit = { antialias: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { antialias: boolvalue }); value a boolean value which can be set to true to request anti-aliasing support in the new webgl rendering layer. if false, anti-aliasing is not desired. usage notes the state of anti-aliasing for the c...
...sage notes the state of anti-aliasing for the context after being created can be read from the xrwebgllayer property antialias. example in this example, before creating a new xrwebgllayer to use for rendering, the value of a user preference from a configuration interface is obtained using a function called getpreferencevalue() to determine whether the user has enabled or disabled anti-aliasing support; this is passed into the constructor. let options = { antialias: getpreferencevalue("antialiasing") }; let gllayer = new xrwebgllayer(xrsession, gl, options); if (gllayer) { xrsession.updaterenderstate({ baselayer: gllayer }); } offering the user features such as the ability to enable or disable things like anti-aliasing can provide them with optiions to try when your app isn't perfor...
ARIA live regions - Accessibility
progressbar a hybrid between a widget and a live region. use this with aria-valuemin, aria-valuenow and aria-valuemax. (tbd: add more info here). marquee for text which scrolls, such as a stock ticker. timer or any kind of timer or clock, such as a countdown timer or stopwatch readout. advanced live regions (tbd: more granular information on the support of the individual attributes with combinations of os/browser/at). general support for live regions was added to jaws on version 10.0. in windows eyes supports live regions since version 8.0 "for use outside of browse mode for microsoft internet explorer and mozilla firefox". nvda added some basic support for live regions for mozilla firefox back in 2008 and was improved in 2010 and 2014. in ...
...individual attributes with combinations of os/browser/at). general support for live regions was added to jaws on version 10.0. in windows eyes supports live regions since version 8.0 "for use outside of browse mode for microsoft internet explorer and mozilla firefox". nvda added some basic support for live regions for mozilla firefox back in 2008 and was improved in 2010 and 2014. in 2015, basic support was also added for internet explorer (mshtml). the paciello group has some information about the state of the support of live regions (2014). paul j. adam has researched the support of aria-atomic and aria-relevant in particular. aria-atomic: the aria-atomic=boolean is used to set whether or not the screen reader should always present the live region as a whole, even if only part of the ...
Using the alert role - Accessibility
a-live="polite" or other live region roles. possible effects on user agents and assistive technology when the alert role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having an alert role in the operating system's accessibility api. fire an accessible alert event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers may interrupt current output (whether it's speech or braille) and immediately announce or display the alert message. screen magnifiers may visually indicate that an alert occurred and what the alert text was. note: opinons may differ on how assistive technology should ha...
...ess of where keyboard focus is currently located. ...
Using the alertdialog role - Accessibility
t role should be used instead in that case (as the described in the using the alert role technique). possible effects on user agents and assistive technology when the alertdialog role is used, the user agent should do the following: expose the element as a dialog in the operating system's accessibility api. fire an accessible alert event using the operating system's accessibility api if it supports it. when the alert dialog appears, screen readers should announce the alert. when the alert dialog is correctly labeled and focus is moved to a control inside the dialog, screen readers should announce the dialog's accessible role, name and optionally description before announcing the focused element. note: opinions may differ on how assistive technology should handle this technique. th...
...abindex="0"> <h2 id="dialog1title">your login session is about to expire</h2> <p id="dialog1desc">to extend your session, click the ok button</p> <button>ok</button> </div> </div> working examples: tbd notes aria attributes used alertdialog aria-labelledby aria-describedby related aria techniques using the dialog role using the alert role compatibility tbd: add support information for common ua and at product combinations additional resources ...
Using the aria-labelledby attribute - Accessibility
tended information that the user might need. in addition to form elements, you can use the aria-labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects. the examples section below provides more information on how to use the attribute this way. to improve compatibility with user agents that do not support aria, you can use aria-labelledby with the <label> element (using the for attribute). this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. value a space-separated list of element ids possible effects on user agents and assistive technology when user agents compute the accessible name property of elements that have ...
...> <div role="menuitem">save</div> <div role="menuitem">save as ...</div> ... </div> ... ...
Using the aria-required attribute - Accessibility
description the aria-required attribute is used to indicate that user input is required on an element before a form can be submitted. this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. html5 now has the required attribute, but aria-required is still useful for user agents that do not yet support html5. value true or false (default: false) possible effects on user agents and assistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. e...
..." /> <br/> <label for="streetaddress">street address:</label> <input id="streetaddress" type="text" /> </form> working examples: tooltip example (includes the use of the aria-required attribute) notes used in aria roles combobox gridcell listbox radiogroup spinbutton textbox tree related aria techniques using the aria-invalid attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-required wai-aria authoring practices for forms constraint validation in html5 ...
Using the article role - Accessibility
ne, for example in syndication. articles can be nested; for example, a web log entry on a site that accepts user-submitted comments could represent the comments as articles nested within the article for the web log entry. the aria article role is similar to the html5 article element; however the article element should still be given the aria role of article, since not all assistive technologies support html5 yet. possible effects on user agents and assistive technology when the user navigates an element assigned the role of article, assistive technologies that typically intercept standard keyboard events should switch to document browsing mode, as opposed to passing keyboard events through to the web application. assistive technologies may provide a feature allowing the user to navigate...
...n class="content"> <p>a very interesting post</p> </section> <section class="comments"> <div class="comment" role="article"> <p>meaningful comment</p> </div> <div class="comment" role="article"> <p>positive comment</p> </div> </section> </article> notes aria attributes used related aria techniques aria techniques - list of roles compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the article role ...
Using the group role - Accessibility
role of region or a standard landmark role. possible effects on user agents and assistive technology when the group role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a group role in the operating system's accessibility api. fire an accessible group event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the description may be spoken. following this the focused control may be announced. screen magnifiers may enlarge the group. note: opinons may differ on how assi...
...amples: file directory treeview example using computed properties navigation treeview example using declared properties notes group members that are outside of the dom subtree of the group need to have explicit relationships assigned to them in order to participate in the group. aria attributes used group related aria techniques region role compatibility tbd: add support information for common ua and at product combinations additional resources aria authoring practices – accessible name guidance by role – group ...
Using the link role - Accessibility
stive technology. the link role is used to identify an element that creates a hyperlink to a resource that is in the application or external. when this role is added to an element, tab can be used to change focus to the link, and enter used to execute the link. note: where possible, it is recommended that you use a native <a> element rather than the link role, as native elements are more widely supported by older user agents and assistive technology. native <a> elements also support keyboard and focus requirements by default, without need for additional customization. the tabindex attribute may optionally be used with this role to directly specify the position of the element in the tab order. possible effects on user agents and assistive technology when the link role is added to an elem...
......
Using the log role - Accessibility
assertive" can be set for more aggressive updates. possible effects on user agents and assistive technology when the log role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a log role in the operating system's accessibility api. fire an accessible log event using the operating system's accessibility api if it supports it. assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen magnifiers may visually indicate that a log update has occurred. note: opinons may differ on how assistive techn...
...t"> </ul> </div> working examples: http://websiteaccessibility.donaldevans.com/2011/07/12/aria-log/ notes using the log role on an element implies that element has aria-live="polite". ...
ARIA: article role - Accessibility
e it, etc. ... </article> <article> ... </article> description the article role denotes a section of a document, page, or site that, if it were standing on its own, could be viewed as a complete document, page or site. the aim of a set of article sections is to indicate their relationship to one another. articles are not considered a navigational landmark, but many assistive technologies that support landmarks also support a means to navigate among articles. they may also support indication of nesting relationships within articles. articles can be nested, indicating that a nested article directly relates to the one it is nested in, but not necessarily to the ones outside the nesting hierarchy. see the examples for specific use cases. if an article is part of a feed, it can have the aria...
... a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1. aria-setsize in the context of a feed, indicates how many article items there are within that feed. keyboard interactions this role does not support any specific keyboard interaction. required javascript features event handlers this role does not require any event handlers to be present. changing attribute values when constructing a feed, set the aria-posinset and aria-setsize attributes on each article role to the appropriate values, bearing in mind that aria-posinset is 1-based. always use native element if available. instead ...
ARIA: Complementary role - Accessibility
these sections are frequently presented as sidebars or call-out boxes. if possible, use the html <aside> element instead. <div role="complementary"> <h2>our partners</h2> <!-- complementary section content --> </div> this is a sidebar containing links to event sponsors. description the complementary role is a landmark role. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. content listed within a container with the complementary landmark role should make sense if separated from the main content of the document. ...
...ections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria: complementary role' in that specification. recommendation wai-aria authoring practicesthe definition of 'complementary landmark role' in that specification. working draft screen reader support tbd ...
ARIA: feed role - Accessibility
ing mode are responsible for: indicating which article contains the reading cursor by ensuring the article element or one of its descendants has dom focus. providing reading mode keys that move dom focus to the next and previous articles. providing reading mode keys for moving the reading cursor and dom focus past the end and before the start of the feed. keyboard interaction supporting the following, or a similar, interface is recommended when focus is inside the feed: page down: move focus to next article. page up: move focus to previous article. control + end: move focus to the first focusable element after the feed. control + home: move focus to the first focusable element before the feed. if a feed is nested within a feed, such as a comments feed within a fee...
... except as required by any attributes. for example, setting aria-busy to true during the update operation if needed, and then to false upon completion. examples example implementation of feed pattern specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'feed' in that specification. recommendation screen reader support coming soon ...
ARIA: search role - Accessibility
cessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <form> element in conjunction with a declaration of role="search" will provide the largest amount of support. labeling landmarks multiple landmarks if there is more than one search landmark role in a document, provide a label for each landmark. this label will allow an assitive technology user to be able to quickly understand the purpose of each landmark. <form id="site-search" role="search" aria-label="sitewide"> <!-- search input --> </form> ... <form id="page-search" role="search" aria-la...
...navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria search role' in that specification. recommendation wai-aria authoring practicesthe definition of 'aria search role' in that specification. working draft screen reader support tbd ...
ARIA: heading role - Accessibility
about showing a page structure.</p> <h2>introduction</h2> <p>an introductory text.</p> <h2>chapter 1</h2> <p>text</p> <h3>chapter 1.1</h3> <p>more text in a sub section.</p> ...</div> accessibility concerns if you must use the heading role and aria-level attribute, do not go over level 6 so that you are consistent with html. although theoretically you can go higher, and some screen readers may support it, the results can be unpredictable with other browser/screen reader combinations. best practices the best way to use this role is to not use it at all, and instead use the native heading tags <h1> through <h6> as shown in the example above. the heading role and aria-level attribute should only be used to retrofit accessibility on legacy code that you cannot make major changes to. added b...
...pecifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'heading' in that specification. recommendation precedence order the heading role overrides the native semantic meaning of the element it is being used for. the aria-level attribute, in addition, determines what level of heading is being exposed. screen reader support tbd ...
WAI-ARIA Roles - Accessibility
response when activated by the user. adding role="button" will make an element appear as a button control to a screen reader. this role can be used in combination with the aria-pressed attribute to create toggle buttons.aria: cell rolethe cell value of the aria role attribute identifies an element as being a cell in a tabular container that does not contain column or row header information. to be supported, the cell must be nested in an element with the role of row.aria: checkbox rolethe checkbox role is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or ...
...le is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. these sections are frequently presented as sidebars or call-out boxes. if possible, use the html <aside> element instead.aria: contentinfo rolethe contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privac...
An overview of accessible web applications and widgets - Accessibility
!-- notice the role and aria-labelledby attributes we've added to describe these panels. --> <div id="ch1panel" role="tabpanel" aria-labelledby="ch1tab">chapter 1 content goes here</div> <div id="ch2panel" role="tabpanel" aria-labelledby="ch2tab">chapter 2 content goes here</div> <div id="quizpanel" role="tabpanel" aria-labelledby="quiztab">quiz content goes here</div> </div> aria is well supported by all major browsers, including firefox, safari, opera, chrome, and internet explorer, and many assistive technologies. presentational changes dynamic presentational changes include using css to change the appearance of content (such as a red border around invalid data, or changing the background color of a checked checkbox), as well as showing or hiding content. state changes aria pro...
...tribute in "edit" mode (since <input> elements have their own role semantics). do not do this. instead, implement the "view" mode using a different element altogether, such as a <div> or <span> with a role of button, and the « edit » mode using a text <input> element. asynchronous content changes under construction. see also live regions keyboard navigation often times developers overlook support for the keyboard when they create custom widgets. to be accessible to a variety of users, all features of a web application or widget should also be controllable with the keyboard, without requiring a mouse. in practice, this usually involves following the conventions supported by similar widgets on the desktop, taking full advantage of the tab, enter, spacebar, and arrow keys. traditionally...
Cognitive accessibility - Accessibility
e: people who have cognitive or language limitations may need more time to read and to understand. for improved usability remove any time limit. timed content should also be avoided, with exceptions for non-interactive synchronized media and real-time events. people with attention deficit disorders should be able to focus on content without distractions. the user should be able to postpone or suppress interruptions, except situations involving altering a person to an emergency. this provides access to people with cognitive disabilities by enabling them to focus on the main purpose of the content. enable the user to postpone content updates by providing a way to request content updates rather than updating automatically. also, enable a way to make nonessential alerts optional. ensure that...
...a legal or financial transaction to occur, provide a stated time within which the request can be amended or canceled by the user. provide help context-sensitive help should be made available. if a form requires text input, provide form instructions describing the purpose and the necessary input. include spell checking and suggestions for long-form text input, as well as links to help and support material. if a specific data format is expected for input, provide an example. notes the above are good design practices. they will benefit everyone. many people with cognitive impairments also have physical disabilities. websites must conform with the w3c’s web content accessibility guidelines. the w3c’s cognitive and learning disabilities accessibility task force produces web a...
Operable - Accessibility
that is essential to the experience. examples include carousels or rotating annoucements. 2.2.3 no time limits (aaa) this builds on criteria 2.2.1, stating that content that wants to pass aaa conformance should have no time limits. 2.2.4 surpress interruptions (aaa) any interruptions such as alerts or interstitial adverts should have functionality available to suppress or postpone them, unless it is an emergency alert. 2.2.5 re-authenticating (aaa) if an authentication session expires during usage of a web app, the user can re-authenticate and continue their usage without losing any data. 2.2.6 timeouts (aaa) added in 2.1 if there is a timeout (caused by user inactivity) warn users at the start of a process so they will...
...tep in a process, so should only logically have links to the previous and next steps. most of these mechanisms can be created using simple html features, for example see search field, creating a navigation menu, styling links as buttons. 2.4.6 headings and labels (aa) heading (e.g. <h2>) and <label> elements clearly describe the purpose of the content and form elements they are supposed to be describing. see ui controls, meaningful text labels, the basics of headings and paragraphs, the <label> element. note that you should avoid duplicating headings or labels (e.g. multiple instances of "further information"), unless the structure allows you to differentiate between them easily. 2.4.7 visible focus for focusable elements (aa) when tabbing throu...
Perceivable - Accessibility
agraphs), with css being used to create any unusual layout styles, irrespective of the markup. again, refer to html: a good basis for accessibility. 1.3.3 sensory characteristics (a) instructions for operating controls or understanding content do not rely on a single sense. this may prove inaccessible to people with a disability related to that sense, or a device that does not support that sense. so, for example: "click the round button to continue" the button should be clearly labelled so that it is obvious that it is the button you need to press. if there are multiple buttons, make sure they are all clearly labelled to distinguish their function. "listen to the audio instructions for guidance" this is obviously problematic—audio will be inac...
...n to the audio instructions for guidance" this is obviously problematic—audio will be inaccessible to those with hearing impairments, whereas text can be read, but also spoken by a screenreader if required. "swipe from the right hand side of the screen to reveal the menu" some users might not be able to swipe the screen, either due to disability or because their device does not support touch. an alternative should be provided, such as a keyboard shortcut or button that can be activated by keyboard or other means. note: conveying instructions solely by color is related, but covered in a different guideline — 1.4.1. 1.3.4 orientation (aa) added in 2.1 content does not restrict its view and operation to a single display orientation, su...
:not() - CSS: Cascading Style Sheets
Web › CSS › :not
color: blue; } the :not() pseudo-class has a number of quirks, tricks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated list of one or more selectors as its argument. the list must not contain another negation selector or a pseudo-element. the ability to list more than one selector is experimental and not yet widely supported. :not( <complex-selector-list> )where <complex-selector-list> = <complex-selector>#where <complex-selector> = <compound-selector> [ <combinator>? <compound-selector> ]*where <compound-selector> = [ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>? '*'<subc...
...*/ body :not(.crazy, .fancy) { font-family: sans-serif; } result specifications specification status comment selectors level 4the definition of ':not()' in that specification. working draft extends its argument to allow some non-simple selectors. selectors level 3the definition of ':not()' in that specification. recommendation ini...
@font-face - CSS: Cascading Style Sheets
r-webfont.woff") format("woff"); } descriptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. since firefox 61 (and in other modern browsers) this also accepts 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 accepts 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. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range th...
... font-feature-settings allows control over advanced typographic features in opentype fonts. ...
@keyframes - CSS: Cascading Style Sheets
they will be handled in the order they should occur. valid keyframe lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states. this can be used to animate an element from its initial state and back. properties that can't be animated in keyframe rules are ignored, but supported properties will still be animated. resolving duplicates if multiple keyframe sets exist for a given name, the last one encountered by the parser is used. @keyframes rules don't cascade, so animations never derive keyframes from more than one rule set. if a given animation time offset is duplicated, all keyframes in the @keyframes rule for that percentage are used for that frame. there is...
... times if a keyframe is defined multiple times but not all affected properties are in each keyframe, all values specified in these keyframes are considered. for example: @keyframes identifier { 0% { top: 0; } 50% { top: 30px; left: 20px; } 50% { top: 10px; } 100% { top: 0; } } in this example, at the 50% keyframe, the values used are top: 10px and left: 20px. cascading keyframes are supported starting in firefox 14. !important in a keyframe declarations in a keyframe qualified with !important are ignored. @keyframes important1 { from { margin-top: 50px; } 50% { margin-top: 150px !important; } /* ignored */ to { margin-top: 100px; } } @keyframes important2 { from { margin-top: 50px; margin-bottom: 100px; } to { margin-top: 150px !important; /* ignored ...
-ms-high-contrast - CSS: Cascading Style Sheets
zes making content as legible as possible by dynamically replacing foreground and background colors with a user-specified theme. for web content, theme colors are mapped to content types. this media feature applies to bitmap media types. it does not accept min/max prefixes. syntax the -ms-high-contrast media feature is specified as one of the following values. values none ... no longer supported as of microsoft edge 18. active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation. black-on-white indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a black-on-white color variation. white-on-black indicates that the subsequent styl...
...these color keywords in place of other css color values. this will ensure that content will always be able to be perceived. content if at all possible, prefer updating html markup over modifying content using css2 system color keywords. this helps keep the content more predictable. specifications not part of any standard. remarks as of microsoft edge 18, -ms-high-contrast: none is no longer supported. microsoft edge versions 18 and higher will be using the forced-colors media feature instead, but the forced-colors media feature specification is still being actively worked on. the -ms-high-contrast media feature works with the -ms-high-contrast-adjust property. the -ms-high-contrast media feature was introduced in windows 8. ...
-webkit-transform-2d - CSS: Cascading Style Sheets
the -webkit-transform-2d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 2d transforms are supported. apple has a description in safari css reference. syntax -webkit-transform-2d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 2d transforms. values true the browser supports the 2d css transforms with the -webkit prefix. false the 2d css transforms prefixed with -webkit are not supported by the browser. ...
...whose value is true if the browser supports -webkit prefixed css 2d transforms. values true the browser supports the 2d css transforms with the -webkit prefix. false the 2d css transforms prefixed with -webkit are not supported by the browser. examples basic example @media (-webkit-transform-2d) { div { -webkit-transform: translate(100px, 100px); } } this media feature is only supported by webkit. if possible, use an @supports feature query instead: @supports (-webkit-transform: translate(100px, 100px)) { div { -webkit-transform: translate(100px, 100px); } } specifications not part of any standard. ...
-webkit-transition - CSS: Cascading Style Sheets
the -webkit-transition boolean css media feature is a chrome extension whose value is true if the browsing context supports css transitions. it was never supported in browsers not based on webkit or blink. apple has a description in safari css reference; this is now called simply transition there. note: you should not use this media feature; it was never specified, has never been widely implemented, and has been removed from all browsers. use an @supports feature query instead. syntax @media (-webkit-transition) { /* css to use if transitions are supported */ } examples use @supports instead do not use the -webkit-transition media feature. ...
...tion there. note: you should not use this media feature; it was never specified, has never been widely implemented, and has been removed from all browsers. use an @supports feature query instead. syntax @media (-webkit-transition) { /* css to use if transitions are supported */ } examples use @supports instead do not use the -webkit-transition media feature. instead, test for transition support using the css @supports at-rule, like this: @supports (transition: initial) { /* css to use if transitions are supported */ } obsolete example before this became obsolete, you could use -webkit-transition in your css like this: @media (-webkit-transition) { /* css to use if transitions are supported */ } specifications not part of any standard. ...
forced-colors - CSS: Cascading Style Sheets
syntax the forced-colors media feature indicates whether or not the browser is currently in forced-colors mode. values none forced colors mode is not active; the page’s colors are not being forced into a limited palette. active indicates that forced colors mode is active. ...
...olor column-rule-color scrollbar-color -webkit-tap-highlight-color box-shadow text-shadow you can use system color keywords with any property other than those listed above, to ensure that the rest of the page integrates with the restricted color palette available in forced colors mode. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system in use. examples note: no browser currently implements this feature so the following example will not work. this example has an annoying color palette by default. this example does not take advantage of the colors provided by the user agent. html <d...
monochrome - CSS: Cascading Style Sheets
Web › CSS › @media › monochrome
syntax the monochrome feature is specified as an <integer> representing the number of bits per pixel in the monochrome frame buffer. if the device is not a monochrome device, the value is zero. it is a range feature, meaning that you can also use the prefixed min-monochrome and max-monochrome variants to query minimum and maximum values, respectively. ...
...g the number of bits per pixel in the monochrome frame buffer. if the device is not a monochrome device, the value is zero. it is a range feature, meaning that you can also use the prefixed min-monochrome and max-monochrome variants to query minimum and maximum values, respectively. ...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
script, the rules created using @media can be accessed with the cssmediarule css object model interface. syntax the @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule. /* at the top level of your code */ @media screen and (min-width: 900px) { article { padding: 1rem 3rem; } } /* nested within another conditional at-rule */ @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } for a discussion of media query syntax, please see using media queries. description media types media types describe the general category of a device. except when using the not or only logical operators, the media type is optional and the all type will be implied. all suitable f...
... level 4. any-pointer is any available input mechanism a pointing device, and if so, how accurate is it? added in media queries level 4. aspect-ratio width-to-height aspect ratio of the viewport color number of bits per color component of the output device, or zero if the device isn't color color-gamut approximate range of colors that are supported by the user agent and output device added in media queries level 4. color-index number of entries in the output device's color lookup table, or zero if the device does not use such a table device-aspect-ratio width-to-height aspect ratio of the output device deprecated in media queries level 4. device-height height of the rendering surface o...
@viewport - CSS: Cascading Style Sheets
Web › CSS › @viewport
note: see https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track. the @viewport css at-rule lets you configure the viewport through which the document is viewed. it's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as microsoft edge). lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. this is typically based on the size of the window on desktop browsers that aren't in full screen mode. on mobile devices (or desktop devices that are in full screen mode), the initial viewport is usually the portion of a device's scree...
...s). @viewport { width: 100vw; /*sets the width of the actual viewport to the device width*/ } note: the use of <meta name="viewport"> tag overrides @viewport syntax the at-rule contains a set of nested descriptors in a css block that is delimited by curly braces. a zoom factor of 1.0 or 100% corresponds to no zooming. larger values zoom in. smaller values zoom out. descriptors browser support for @viewport is weak at this time, with support being largely available in internet explorer and edge. even in those browsers, only a small number of descriptors are available. browsers will ignore @viewport if they don't support it, and will ignore any descriptors that they don't recognize. min-width used in the determination of the width of the viewport when the document is first displ...
Alternative style sheets - CSS: Cascading Style Sheets
chrome requires an extension to use the feature (as of version 48). the web page can also provide its own user interface to let the user switch styles. ...
...er. style sheets linked with the same title are part of the same choice. style sheets linked without a title attribute are always applied. use rel="stylesheet" to link to the default style, and rel="alternate stylesheet" to link to alternative style sheets. this tells the browser which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets. specifications specification status comment html living standardthe definition of 'link type "alternate"' in that specification. living standard html living standardthe definition of 'alternative stylesheet' in that specification. living standard html living standardthe definition of 'the "title" attribute f...
At-rules - CSS: Cascading Style Sheets
Web › CSS › At-rule
e — tells the css engine that all its content must be considered prefixed with an xml namespace. nested at-rules — a subset of nested statements, which can be used as a statement of a style sheet as well as inside of conditional group rules: @media — a conditional group rule that will apply its content if the device meets the criteria of the condition defined using a media query. @supports — a conditional group rule that will apply its content if the browser meets the criteria of the given condition. @document — a conditional group rule that will apply its content if the document in which the style sheet is applied meets the criteria of the given condition. (deferred to level 4 of css spec) @page — describes the aspect of layout changes that will be applied when ...
...can include nested statements—either rulesets or nested at-rules. furthermore, they all convey a common semantic meaning—they all link some type of condition, which at any time evaluates to either true or false. if the condition evaluates to true, then all of the statements within the group will be applied. conditional group rules are defined in css conditionals level 3 and are: @media, @supports, @document. (deferred to level 4 of css spec) since each conditional group may also contain nested statements, there may be an unspecified amount of nesting. specifications specification status comment css conditional rules module level 3 candidate recommendation initial definition compatibility standardthe definition of 'css at-rules' in that spe...
CSS Animations - CSS: Cascading Style Sheets
ons can be controlled by specifying their timing function, duration, their number of repetitions, and other attributes. reference css properties animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function css at-rules @keyframes guides detecting css animation support describes a technique for detecting if a browser supports css animations. using css animations step-by-step tutorial about how to create animations using css. this article describes each relevant css property and at-rule and explains how they interact with each other. css animations tips and tricks tips and tricks to help you get the most out of css animations. currently offers a techniq...
...ions step-by-step tutorial about how to create animations using css. this article describes each relevant css property and at-rule and explains how they interact with each other. css animations tips and tricks tips and tricks to help you get the most out of css animations. currently offers a technique for replaying an animation which has already run through to completion, which the api doesn't support inherently. specifications specification status comment css animations working draft initial definition. ...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
re how box alignment works in the context of block layout, including floated, positioned, and table elements. as this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main box alignment page, which details the common features of box alignment across layout methods. note: at the time of writing (may 2018), there is no real support for the box alignment properties in block layout. this document details how the specification expects these properties to be implemented for completeness, and is likely to change as the specification and browser implementations develop. align-content and justify-content the justify-content property does not apply to block containers or table cells. the align-content property applies to th...
...ock axis. it also does not apply to table cells. absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. aligning in these layout methods today as we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment properties as specified in flexbox. alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. a margin of auto will absorb a...
Spanning and Balancing Columns - CSS: Cascading Style Sheets
spanning the columns to cause an item to span across columns use the property column-span with a value of all. this will cause the element to span all of the columns. ...
...unts of text. the other value for column-fill is auto. in this case, rather than filling all the columns equally so their heights are balanced, the columns are filled sequentially. in the example below we have changed column-fill to auto and the columns are now filled, in order, to the height of the multicol container, leaving some columns empty at the end. note that column balancing is not supported by all browsers. check that you are getting the sort of effect that you expect in the browsers you support. in the next guide you will learn how multicol handles overflow, both within columns and where there are more columns than will fit the container. ...
Using multi-column layouts - CSS: Cascading Style Sheets
ore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> css #wid { column-width: 100px; } result the exact details are described in the css3 specification. in a multi-column block, content is automatically flowed from one column into the next as needed. all html, css and dom functionality is supported within columns, as are editing and printing. the columns shorthand most of the time, a web designer will use one of the two css properties: column-count or column-width. as values for these properties do not overlap, it is often convenient to use the shorthand columns. e.g. the css declaration column-width: 12em can be replaced by columns: 12em. example 3 html <div id="col_short"> ...
...ommodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum </div> css #column_gap { column-count: 5; column-gap: 2em; } result graceful degradation the column properties will just be ignored by non-columns-supporting browsers. therefore it's relatively easy to create a layout that will display in a single column in those browsers and use multiple columns in supporting browsers. conclusion css3 columns are a layout primitive that will help web developers make the best use of screen real estate. imaginative developers may find many uses for them, especially with the automatic height balancing feature. ...
CSS Containment - CSS: Cascading Style Sheets
ed styles such as you would get with the shadow dom. the main use case is to prevent situations where a css counter could be changed in an element, which could then affect the rest of the tree. using contain: style would ensure that the counter-increment and counter-set properties created new counters scoped to that subtree only. note: style containment is "at-risk" in the spec and may not be supported everywhere (it's not currently supported in firefox). special values there are two special values of contain: content strict we encountered the first in the example above. using contain: content turns on layout and paint containment. the specification describes this value as being "reasonably safe to apply widely". it does not apply size containment, so you would not be at risk of ...
...ation describes this value as being "reasonably safe to apply widely". ...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
ex item on the cross axis. align-content — described in the spec as for “packing flex lines”; controls space between flex lines on the cross axis. we will also discover how auto margins can be used for alignment in flexbox. note: the alignment properties in flexbox have been placed into their own specification — css box alignment level 3. it is expected that this spec will ultimately supersede the properties as defined in flexbox level one. the cross axis the align-items and align-self properties control alignment of our flex items on the cross axis, down the columns if flex-direction is row and along the row if flex-direction is column. we are making use of cross-axis alignment in the most simple flex example. if we add display: flex to a container, the child items all becom...
...operty works. once again we can switch our flex-direction to column in order to see how this property behaves when we are working by column. as before, we need enough space in the cross axis to have some free space after displaying all of the items. note: the value space-evenly is not defined in the flexbox specification and is a later addition to the box alignment specification. browser support for this value is not as good as that of the values defined in the flexbox spec. see the documentation for justify-content on mdn for more details on all of these values and browser support. aligning content on the main axis now that we have seen how alignment works on the cross axis, we can take a look at the main axis. here we only have one property available to us — justify-content. ...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
as you lay out your items you want to control the dimensions of the items in that one dimension, or control the spacing between items. these are the uses that flexbox was designed for. ...
...he justify-content property. you can read more about this property in aligning items in a flex container, which deals with aligning items on the main axis. in the below live example we display the items at their natural size and by using justify-content: space-between make equal amounts of space between the items. you can change how the space is distributed using the space-around value, or where supported, space-evenly. you could also use flex-start to place the space at the end of the items, flex-end to place it before them, or center to centre the navigation items. space distributed within the items a different pattern for navigation would be to distribute the available space within the items themselves, rather than create space between them. in this case we would use the flex properti...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
for this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so. logical and physical properties and values css is full of physical positioning keywords – left and right, top and bottom. if we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. ...
... guide to alignment, becomes very useful. if you can start to see layout in terms of block and inline, the way things work in grid start to make a lot more sense. css writing modes i’m going to introduce another specification here, that i will be using in my examples: the css writing modes specification. this spec details how we can use these different writing modes in css, not just for the support of languages that have a different writing mode to english, but also for creative purposes. i’ll be using the writing-mode property to make changes to the writing mode applied to our grid, in order to demonstrate how the logical values work. if you want to dig into writing modes further, however, then i would recommend that you read jen simmons excellent article on css writing modes. this g...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
of a grid item participate in the overall grid layout by declaring the ul element a subgrid. currently the only way to do this is to use display: contents to cause the box generated by the ul to disappear from the dom. for more information about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents. given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite temptation 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. an example would be where some content was semantically marked up as a list but you decide to use a set of <div> elements instead as then you can have...
... ...
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
style the target element of a url containing a fragment identifier. for example, the url http://developer.mozilla.org/en/docs/using_the_:target_selector#example contains the fragment identifier #example. in html, identifiers are found as the values of either id or name attributes, since the two share the same namespace. thus, the example url would point to the heading "example" in this document. suppose you wish to style any h2 element that is the target of a url, but do not want any other kind of element to get a target style. this is simple enough: h2:target { font-weight: bold; } it's also possible to create styles that are specific to a particular fragment of the document. this is done using the same identifying value that is found in the uri. thus, to add a border to the #example frag...
...by styling the target of a uri, reader confusion can be reduced or eliminated. see also :target original document information author(s): eric meyer, standards evangelist, netscape communications original copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Shapes from box values - CSS: Cascading Style Sheets
css box model the values listed above correspond to the various parts of the css box model. a box in css has content, padding, border, and margin. ...
...ines the shape enclosed by the outside content edge. each corner radius of this box is the larger of 0 or border-radius − border-width − padding. this means that it is impossible to have a negative value here. when to use the box values using box values is a simple way to create shapes, however this is by nature only going to work with very simple shapes that can be defined using the well-supported border-radius property. the examples shown above show one such use case. you can create a circular shape using border-radius and then curve text around it. you can create some interesting effects however with just this simple technique. in my final example of this section, i have floated two elements left and right, giving each a border-radius of 100% in the direction closest to the text. ...
Overview of CSS Shapes - CSS: Cascading Style Sheets
hape-outside property to it with a value of circle(50%). the result is that the content now curves around the circular shape rather than following the rectangle created by the box of the image. as in this level of the specification an element has to be floated in order to apply <basic-shape> to it; this has the side-effect of creating a simple fallback for many cases. if you do not have shapes support in the browser, the user will see content flowing around the sides of a rectangular box as before. if they do have shapes support then the visual display is enhanced. basic shapes the value circle(50%) is an example of a basic shape. the specification defines four <basic-shape> values, which are: inset() circle() ellipse() polygon() using the value inset() wraps text around a rectan...
...e if you want to create a shape using an image, and also clip away part of that image, you can use the same values. the image below is a square image with a blue background. we have defined a shape using shape-outside: ellipse(40% 50%); and also used clip-path: ellipse(40% 50%); to clip away the same area that we have used to define the shape. developer tools for shapes along with css shapes support in the browser, firefox are shipping a shape path editor in the firefox devtools. this tool means that you can inspect any shapes on your page, and even change the values in the live page. if your polygon isn’t quite right you can use the shapes editor to tweak it, then copy the new value back into your css. the shape path editor will be enabled by default in firefox 60 for shapes generate...
Grid wrapper - CSS: Cascading Style Sheets
h expand to fill the remaining available space in the grid container. ...
...he remaining available space in the grid container. ...
Pseudo-elements - CSS: Cascading Style Sheets
x selector::pseudo-element { property: value; } you can use only one pseudo-element in a selector. it must appear after the simple selectors in the statement. note: as a rule, double colons (::) should be used instead of a single colon (:). this distinguishes pseudo-classes from pseudo-elements. ...
... w3c spec, most browsers support both syntaxes for the original pseudo-elements. ...
Cubic Bezier Generator - CSS: Cascading Style Sheets
ize of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag state machine: 0 = nodrag, others = object being dragged function initcanvas() { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); canvas.onmousedown = mousedown; canvas.onmouseup = mouseup; } else { alert('you need safari or firefox 1.5+ to see this demo.'); } } func...
...(margin - y) / scaling + 1; } function ly(y) { // used when drawing horizontal lines to prevent subpixel blur var result = cy(y); return math.round(result) == result ? ...
background-attachment - CSS: Cascading Style Sheets
round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. </p> css p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"); background-attachment: fixed; } result multiple background images this property supports multiple background images. you can specify a different <attachment> for each background, separated by commas. each image is matched with the corresponding attachment type, from first specified to last. html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the other, trying every door, she walked sadly down th...
...zillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-attachment' in that specification. candidate recommendation the shorthand property has been extended to support multiple backgrounds and the local value. css level 2 (revision 1)the definition of 'background-attachment' in that specification. recommendation no significant change. css level 1the definition of 'background-attachment' in that specification. recommendation no significant change. ...
<basic-shape> - CSS: Cascading Style Sheets
g a shape, the reference box is defined by each property that uses <basic-shape> values. the coordinate system for the shape has its origin at the top-left corner of the reference box, with the x-axis running to the right and the y-axis running downwards. all the lengths expressed in percentages are resolved from the used dimensions of the reference box. ...
.... all the lengths expressed in percentages are resolved from the used dimensions of the reference box. shape functions the following shapes are supported. all <basic-shape> values use functional notation and are defined here using the value definition syntax. inset() inset( <shape-arg>{1,4} [round <border-radius>]? ) defines an inset rectangle. when all of the first four arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle. these arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values. the optional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand ...
content - CSS: Cascading Style Sheets
Web › CSS › content
f nesting for quotes. accessibility concerns css-generated content is not included in the dom. because of this, it will not be represented in the accessibility tree and certain assistive technology/browser combinations will not announce it. if the content conveys information that is critical to understanding the page's purpose, it is better to include it in the main document. accessibility support for css generated content – tink explanation of wcag, guideline 1.3 – mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. otherwise, for uri values, the...
...h an image. you can replace the contents of an element with either a <url> or an <image> value. content added with ::before or ::after will not be generated as the contents of the element have been replaced. html <div id="replaced">mozilla</div> css #replaced { content: url("https://mdn.mozillademos.org/files/12668/mdn.svg"); } #replaced::after { /* will not show if element replacement is supported */ content: " (" attr(id) ")"; } result specifications specification status comment css generated content module level 3the definition of 'content' in that specification. working draft adds support for alt-text css level 2 (revision 1)the definition of 'content' in that specification. recommendation initial definition ...
counters() - CSS: Cascading Style Sheets
Web › CSS › counters
the counters() css function enables nested counters, returning a concatenated string representing the current values of the named counters, if there are any. the counters() function has two forms: 'counters(name, string)' or 'counters(name, string, style)'. it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. the generated text is the value of all counters with the given name, from outermost to innermost, separated by the specified string. the counters are rendered in the style indicated, defaulting to decimal if no style is specified. /* simple usage - style defaults to decimal */ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) a counter has no visible effect by itself. t...
...tyle is specified. /* simple usage - style defaults to decimal */ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) a counter has no visible effect by itself. the counters() function (and counter() function) is what makes it useful by returning developer defined content. note: the counters() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom-ident> a name identifying the counters, which is the same case-sensitive name used for the counter-reset and counter-increment. the name cannot start with two dashes and can't be...
cursor - CSS: Cascading Style Sheets
Web › CSS › cursor
ges using <url> values, providing <x><y> coordinates for the second one, and falling back to the progress keyword value if neither image can be loaded: cursor: url(one.svg), url(two.svg) 5 5, progress; values <url> a url(…) or a comma separated list url(…), url(…), …, pointing to an image file. more than one <url> may be provided as fallbacks, in case some cursor image types are not supported. a non-url fallback (one or more of the keyword values) must be at the end of the fallback list. see using url values for the cursor property for more details. <x> <y> optional x- and y-coordinates. two unitless nonnegative numbers less than 32. keyword values move your mouse over values to see their live appearance in your browser: category css value example ...
...size nesw-resize nwse-resize zooming zoom-in something can be zoomed (magnified) in or out. zoom-out usage notes although the specification does not define any size limitations for cursor, individual user agents may choose to do so. cursor changes using images which are outside the size range supported by the browser will generally just be ignored. check the browser compatibility table for any notes on cursor size limits. formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax [ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | ...
env() - CSS: Cascading Style Sheets
Web › CSS › env
he rectangle is visible. note: unlike other css properties, user agent-defined property names are case-sensitive. formal syntax env( <custom-ident> , <declaration-value>? ) examples the below example makes use of the optional second parameter of env(), which allows you to provide a fallback value in case the environment variable is not available. <p> if the <code>env()</code> function is supported in your browser, this paragraph’s text will have 50px of padding between it and the left border — but not the top, right and bottom. this is because the accompanying css is the equivalent of <code>padding: 0 0 0 50px</code>, because, unlike other css properties, user agent property names are case-sensitive. </p> p { width: 300px; border: 2px solid red; padding: env(...
... note: user agent properties are not reset by the all property. specifications specification status comment css environment variables module level 1the definition of 'env()' in that specification. editor's draft initial definition. ...
saturate() - CSS: Cascading Style Sheets
a value of 0% is completely unsaturated, while a value of 100% leaves the input unchanged. the lacuna value for interpolation is 1. ...
...or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax saturate(amount) parameters amount the amount of the conversion, specified as a <number> or a <percentage>. a value under 100% desaturates the image, while a value over 100% super-saturates it. a value of 0% is completely unsaturated, while a value of 100% leaves the input unchanged. the lacuna value for interpolation is 1. examples saturate(0) /* completely unsaturated */ saturate(.4) /* 40% saturated */ saturate(100%) /* no effect */ saturate(200%) /* double saturation */ specifications specification status filter effects module l...
font-weight - CSS: Cascading Style Sheets
400 normal (regular) 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (heavy) 950 extra black (ultra black) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping. ...
...he numbers in common weight name mapping. however some fonts, called variable fonts, can support a range of weights with a more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying widths. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-weight can be any number between 1 and 1000. html <header> <input type="range" id="weight" name="weight" min="1" max="1000" /> <label for="weight">weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holbo...
font - CSS: Cascading Style Sheets
Web › CSS › font
css level 1the definition of 'font' in that specification. recommendation initial definition. ...
...cssfragment + "}"; document.body.appendchild(css); } setcss(); specifications specification status comment css fonts module level 3the definition of 'font' in that specification. candidate recommendation added support for font-stretch values. css level 2 (revision 1)the definition of 'font-weight' in that specification. recommendation added support for keywords. css level 1the definition of 'font' in that specification. recommendation initial definition. ...
ime-mode - CSS: Cascading Style Sheets
Web › CSS › ime-mode
lications or to undo the property if it was previously set by legacy code. syntax the ime-mode property is specified using one of the keyword values listed below. values auto no change is made to the current input method editor state. this is the default. normal the ime state should be normal; this value can be used in a user style sheet to override the page's setting. this value is not supported by internet explorer. active the input method editor is initially active; text entry is performed through it unless the user specifically dismisses it. not supported on linux. inactive the input method editor is initially inactive, but the user may activate it if they wish. not supported on linux. disabled the input method editor is disabled and may not be activated by the user. des...
...rsion of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value. formal definition initial valueautoapplies totext fieldsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | normal | active | inactive | disabled examples disabling input method support this example disables input method support for a form field. in the past, this was commonly used on fields that entered data into databases which didn't support extended character sets. <input type="text" name="name" value="initial value" style="ime-mode: disabled"> note: you shouldn't rely on disabling ime to prevent extended characters from passing through your form. even with ime disab...
mask-border-slice - CSS: Cascading Style Sheets
n initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of the mask border imagecomputed valueas specifiedanimation typediscrete formal syntax <number-percentage>{1,4} fill?where <number-percentage> = <number> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define the size of the slices taken from the source image, and used to create the border mask. mask-border-slice: 30 fill; chromium-based browsers support an outdated version of this property — mask-box-image-slice — with a prefix: -webkit-mask-box-image-slice: 30 fill; note: the mask-border page features a w...
... note: the fill keyword needs to be included if you want the element's content to be visible. ...
mask-border-source - CSS: Cascading Style Sheets
<color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-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 basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define the source of the border mask. mask-border-source: url(image.jpg); chromium-based browsers support an outdated version of this property — mask-box-image-source — with a prefix: -webkit-mask-box-image-source: url(image.jpg); note: the mask-border page features a working example (using the out-of-date pr...
... specifications specification status comment css masking module level 1the definition of 'mask-border-source' in that specification. ...
mask-border-width - CSS: Cascading Style Sheets
the defs element and all graphics elementsinheritednopercentagesrelative to width/height of the mask border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define the width of the border mask — setting this to a different value to mask-border-slice will cause the slices to be scaled to fit the border mask. mask-border-width: 30 fill; chromium-based browsers support an outdated version of this property — mask-box-image-width — with a prefix: -webkit-mask-box-imag...
...ng this to a different value to mask-border-slice will cause the slices to be scaled to fit the border mask. mask-border-width: 30 fill; chromium-based browsers support an outdated version of this property — mask-box-image-width — with a prefix: -webkit-mask-box-image-width: 20px; note: the mask-border page features a working example (using the out-of-date prefixed border mask properties supported in chromium), so you can get an idea of the effect. specifications specification status comment css masking module level 1the definition of 'mask-border-width' in that specification. candidate recommendation initial definition ...
mask-border - CSS: Cascading Style Sheets
, isn't it?</div> css to match the size of a single diamond, we will use a value of 90 divided by 3, or 30, for slicing the image into corner and edge regions. a repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps. ...
...mon; padding: 10px; /* prefixed longhand properties currently supported in chromium -webkit-mask-box-image-source: url(https://udn.realityripple.com/samples/2d/fd08a3134c.png); -webkit-mask-box-image-slice: 30 fill; -webkit-mask-box-image-width: 20px; -webkit-mask-box-image-repeat: round; -webkit-mask-box-image-outset: 1px; */ /* prefixed shorthand property currently supported in chromium */ -webkit-mask-box-image: url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ /* updated standard shorthand property, not supported anywhere yet */ mask-border: url("https://udn.realityripple.com/samples/2d/fd0...
overflow - CSS: Cascading Style Sheets
Web › CSS › overflow
wo keywords chosen from the list of values below. if two keywords are specified, the first applies to overflow-x and the second to overflow-y. otherwise, both overflow-x and overflow-y are set to the same value. values visible content is not clipped and may be rendered outside the padding box. hidden content is clipped if necessary to fit the padding box. no scrollbars are provided, and no support for allowing the user to scroll (such as by dragging or using a scroll wheel) is allowed. the content can be scrolled programmatically (for example, by setting the value of a property such as offsetleft), so the element is still a scroll container. clip like for hidden, the content is clipped to the element's padding box. the difference between clip and hidden is that the clip keyword als...
...ontent changes. printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block formatting context. desktop browsers provide scrollbars if content overflows. overlay behaves the same as auto, but with the scrollbars drawn on top of content instead of taking up space. only supported in webkit-based (e.g., safari) and blink-based (e.g., chrome or opera) browsers. mozilla extensions -moz-scrollbars-none [1] use overflow: hidden instead. -moz-scrollbars-horizontal [1] use overflow-x: scroll and overflow-y: hidden, or overflow: hidden scroll instead. -moz-scrollbars-vertical [1] use overflow-x: hidden and overflow-y: scroll, or overflow: scroll hidden instead.
shape-outside - CSS: Cascading Style Sheets
inside of the border. content-box defines the shape enclosed by the outside content edge. each corner radius of this box is the larger of 0 or border-radius - border-width - padding. <basic-shape> the float area is computed based on the shape created by of one of inset(), circle(), ellipse(), polygon(), or as added in the level 2 specification path(). if a <shape-box> is also supplied, it defines the reference box for the <basic-shape> function. otherwise, the reference box defaults to margin-box. <image> the float area is extracted and computed based on the alpha channel of the specified <image> as defined by shape-image-threshold. note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside ...
...between each value in the shape functions. if both shapes are of type polygon(), both polygons have the same number of vertices, and use the same <fill-rule>, interpolate between each value in the shape functions. in all other cases no interpolation occurs. ...
text-decoration - CSS: Cascading Style Sheets
going through it.</p> <p>this <a class="plain" href="#">link will not be underlined</a>, as links generally are by default. be careful when removing the text decoration on anchors since users often depend on the underline to denote hyperlinks.</p> <p class="underover">this text has lines above <em>and</em> below it.</p> <p class="thick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specification status comment css text decoration module level 4 working draft adds text-decoration-thickness; note that this isn't yet officially part of the shorthand — this is as yet unspecified. css text decoration modul...
...cification status comment css text decoration module level 4 working draft adds text-decoration-thickness; note that this isn't yet officially part of the shorthand — this is as yet unspecified. css text decoration module level 3the definition of 'text-decoration' in that specification. candidate recommendation transformed into a shorthand property. added support for the value of text-decoration-style. css level 2 (revision 1)the definition of 'text-decoration' in that specification. recommendation no significant changes. css level 1the definition of 'text-decoration' in that specification. recommendation initial definition. ...
text-overflow - CSS: Cascading Style Sheets
unction fade(), which is passed a <length> or a <percentage> to control the fade distance a <string>. values clip the default for this property. this keyword value will truncate the text at the limit of the content area, therefore the truncation can happen in the middle of a character. to clip at the transition between characters you can specify text-overflow as an empty string, if that is supported in your target browsers: text-overflow: '';. ellipsis this keyword value will display an ellipsis ('…', u+2026 horizontal ellipsis) to represent clipped text. the ellipsis is displayed inside the content area, decreasing the amount of text displayed. if there is not enough space to display the ellipsis, it is clipped. <string> the <string> to be used to represent clipped text. the s...
... syntax [ clip | ellipsis | <string> ]{1,2} examples css p { width: 200px; border: 1px solid; padding: 2px 5px; /* both of the following are required for text-overflow */ white-space: nowrap; overflow: hidden; } .overflow-visible { white-space: initial; } .overflow-clip { text-overflow: clip; } .overflow-ellipsis { text-overflow: ellipsis; } .overflow-string { /* not supported in most browsers, see the 'browser compatibility' section below */ text-overflow: " [..]"; } html <p class="overflow-visible">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-clip">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-ellipsis">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflo...
text-transform - CSS: Cascading Style Sheets
d, so for example text-transform: uppercase will change ar aon tslí to ar aon tslÍ and not, as one might expect, ar aon tslÍ (firefox only). in some cases, a hyphen is also removed upon uppercasing: an t-uisce transforms to an tuisce (and the hyphen is correctly reinserted by text-transform: lowercase). the language is defined by the lang html attribute or the xml:lang xml attribute. note: support for language-specific cases varies between browsers, so check the browser compatibility table. syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transform: lowercase; text-transform: full-width; text-transform: full-size-kana; /* global values */ text-transform: inherit; text-transform: initial; text-transform: unset; capital...
... other browsers did not. both webkit and gecko incorrectly considered letter-based symbols like ⓐ to be real letters. internet explorer 9 was the closest to the css 2 definition, but with some weird cases.) by precisely defining the correct behavior, css text level 3 cleans this mess up. the capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-defined behavior. uppercase is a keyword that converts all characters to uppercase. lowercase is a keyword that converts all characters to lowercase. none is a keyword that prevents the case of all characters from being changed. full-width is a keyword that forces the writing of a character — mainly ideograms and latin scripts — inside a square, allowing them ...
Getting Started - Developer guides
server step 1 – how to make an http request in order to make an http request to the server with javascript, you need an instance of an object with the necessary functionality. this is where xmlhttprequest comes in. its predecessor originated in internet explorer as an activex object called xmlhttp. then, mozilla, safari, and other browsers followed, implementing an xmlhttprequest object that supported the methods and properties of microsoft's original activex object. meanwhile, microsoft implemented xmlhttprequest as well. // old compatibility code, no longer needed. if (window.xmlhttprequest) { // mozilla, safari, ie7+ ... httprequest = new xmlhttprequest(); } else if (window.activexobject) { // ie 6 and older httprequest = new activexobject("microsoft.xmlhttp"); } note: for ...
...nse here. }; next, after declaring what happens when you receive the response, you need to actually make the request, by calling the open() and send() methods of the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server. keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process the request. for more information on the possible http request methods, check the w3c specs. the second parameter is the url you're sending the request to. as a security feature, you cannot call urls on 3rd-party domains by default. be sure to use the exact domain...
Video player styling basics - Developer guides
like the <button> elements, <progress> also has a default border, which is removed here. it is also given a slight rounded corner for aesthetic reasons. the color property is also defined here as internet explorer uses this defined colour for styling the progress bar's background colour as it increases. ...
...t for the immediate styling; the next task is making a number of javascript changes to ensure that everything works as expected. control visibility the first change is simple: the data-state for showing the video controls when javascript is available to the browser now needs to be set: // display the user defined video controls videocontrols.setattribute('data-state', 'visible'); progress bar support a check also needs to be made to set up the "fake" progress bar if the browser doesn't support the <progress> element: var supportsprogress = (document.createelement('progress').max !== undefined); if (!supportsprogress) progress.setattribute('data-state', 'fake'); button functionality this section looks at the javascript required for implementing the button functionality. play/pause and...
Writing Web Audio API code that works in every browser - Developer guides
e your code accordingly. you can also check this article on porting which covers more cases and has many code samples. things that are not ready yet second, ensure that your project doesn't use node types that are not implemented yet in firefox: mediastreamaudiosourcenode, mediaelementaudiosourcenode and oscillatornode. if it's using, for example, oscillatornode, you will have to wait until it is supported, or maybe, if you're really eager, hack in some replacement using scriptprocessornode, which allows you to write a node with callbacks that get called periodically, so that your javascript code generates or processes audio. the node parameters you use must also be supported in firefox too. if they aren't, you might be able to change them into something "acceptable" for the time being, and c...
...h callbacks that get called periodically, so that your javascript code generates or processes audio. the node parameters you use must also be supported in firefox too. if they aren't, you might be able to change them into something "acceptable" for the time being, and count on the talented audio developers to implement those very soon. for example, up until a couple of days ago pannernode did not support the default hrtf panning model yet, and attempting to use a pannernode with that configuration simply resulted in silence or a mono output coming out from that node, depending on the build you used. today the support is already present in nightly, but not quite yet in aurora. in the meantime, you can explicitly specify 'equalpower' instead: var panner = new audiocontext.pannernode(); panner.p...
Introduction to Web development - Developer guides
asic structure of a web page — the doctype and document 'tree' fundamental html elements — structural, head, list, form elements and more, explained by category. html beginners tutorial — a tutorial and exercise that recap and take you through the basics you've learned above. 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 concepts and fundamentals css reference guide — a complete guide to css with details on the level of gecko/firefox support for each. the w3c introduction to styling with css — a brief guide to styling web pages for beginners. common css questions — common questions a...
...arts of javascript. resources w3c web education community group wiki covers web design, html and html5, css, javascript and accessibility. this is a good starting point for beginners wishing to learn web development fundamentals across a number of areas. sitepoint a reliable reference site for learning html, css and javascript which also mentions feature support across different browsers and known browser bugs. htmldog an excellent and comprehensive reference site on html and css for beginners. google's html, css, and javascript from the ground up these easily digestible video tutorials from google's expert web developers cover the basics of html, css and javascript. csstutorial.net beginner tutorials a broad range of us...
Mobile Web Development - Developer guides
Web › Guide › Mobile
mobile devices mobile devices have quite different hardware characteristics compared with desktop or laptop computers. their screens are usually smaller, obviously, but they also usually automatically switch the screen orientation between portrait and landscape mode as the user rotates the device. they usually have touch screens for user input. apis like geolocation or orientation are either not supported on desktops or are much less useful, and these apis give mobile users new ways to interact with your site. working with small screens responsive web design is a term for a set of techniques that enables your web site to adapt its layout as its viewing environment — most obviously, the size and orientation of the screen — changes. it includes techniques such as: fluid css layouts, t...
...d geolocation. cross-browser development write cross-browser code to create web sites that will work acceptably across different mobile browsers: try to avoid using browser-specific features, such as vendor-prefixed css properties. if you do need to use these features, check whether other browsers implement their own versions of these features, and target them too. for browsers that don't support these features, provide an acceptable fallback. for example, if you set a gradient as a background for some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed versions of the linear-gradient() property. if you don't do that, at least make sure that the default background contrasts with the text: that way, the page will at least...
User input and controls - Developer guides
y manage events across devices by normalizing the handling of each one. a pointer can be any point of contact on the screen made by a mouse cursor, pen, touch (including multi-touch), or other pointing input device. the events for handling generic pointer input look a lot like those for mouse: pointerdown, pointermove, pointerup, pointerover, pointerout, etc. note: pointer events are not widely supported yet, but a pointer.js polyfill is available on mozilla github. implement controls pointer lock in some cases, typically game development, you might need to access mouse events even when the cursor goes past the boundary of the browser or screen: the pointer_lock_api gives you full control of the pointing device. this is the code to request pointer lock on an element: element.requestpo...
...nteditable="true">
 this text can be edited by the user. </div> note: compatibility information, examples and other resources can be found in the content editable guide. examples tracking multiple touch points at a time this example tracks multiple touch points at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. simple pointer lock demo we've written a simple pointer lock demo to show you how to use it to set up a simple control system. the demo uses javascript to draw a ball inside a <canvas> element. when you click the canvas, pointer lock is then used to remove the mouse pointer and allow you to move the ball directly using the mouse. contenteditable demo this is a working examp...
HTML attribute: multiple - HTML: Hypertext Markup Language
ion value="doc@woodworkers.com">doc</option> </datalist> input:invalid {border: red solid 3px;} if and only if the multiple attribute is specified, the value can be a list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. if the required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datalist> for subsequent email addresses when multiple is present. others do not. file input when multiple is set on the file input type, the user can select one or more files: <form method="post" enctype="multipart/form-data"> <p> <label for="uploads"> choose the images you want to upload: </label> <input ty...
...erating system, mouse users can hold the ctrl, command, or shift keys and then click multiple options to select/deselect them. keyboard users can select multiple contiguous items by focusing on the <select> element, selecting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options. the selection of non-contiguous is not as well supported: items should be able to be selected and deselected by pressing space , but support varies between browsers. specifications specification status comment html living standardthe definition of 'multiple attribute' in that specification. living standard html5the definition of 'multiple attribute' in that specification. recommendation ...
HTML attribute reference - HTML: Hypertext Markup Language
elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. attribute list attribute name elements description accept <form>, <input> list of types the server accepts, typically a file type. accept-charset <form> list of supported charsets. accesskey global attribute keyboard shortcut to activate or add focus to the element. action <form> the uri of a program that processes the information submitted via the form. align <applet>, <caption>, <col>, <colgroup>, <hr>, <iframe>, <img>, <table>, <tbody>, <td>, <tfoot> , <th>, <thead>, <tr> specifies the horizontal alignment of the element. ...
...ed by the browser. autofocus <button>, <input>, <keygen>, <select>, <textarea> the element should be automatically focused after the page loaded. autoplay <audio>, <video> the audio or video should play as soon as possible. background <body>, <table>, <td>, <th> specifies the url of an image file. note: although browsers and email clients may still support this attribute, it is obsolete. use css background-image instead. bgcolor <body>, <col>, <colgroup>, <marquee>, <table>, <tbody>, <tfoot>, <td>, <th>, <tr> background color of the element. note: this is a legacy attribute. please use the css background-color property instead. border <img>, <object>, <table> the border width. ...
<basefont> - HTML: Hypertext Markup Language
Web › HTML › Element › basefont
elements which are descended from its parent element. with this set, the font's size can then be varied relative to the base size using the <font> element. you should not use this element; instead, you should use css properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format. face this attribute contains a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typi...
...no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. usage notes do not use this element! though once (imprecisely) normalized in html 3.2, it wasn't supported in all major browsers. further, browsers, and even successive versions of browsers, never implemented it in the same way: practically, using it has always brought indeterminate results. the <basefont> element was deprecated in the standard at the same time as all elements related to styling only. starting with html 4, html does not convey styling information anymore (outside the <style> el...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
Web › HTML › Element › canvas
ed aria roles any dom interface htmlcanvaselement attributes this element's attributes include the global attributes. height the height of the coordinate space in css pixels. defaults to 150. moz-opaque lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting performance can be optimized. ...
...providing a useful fallback text or sub dom helps to make the the canvas more accessible. required </canvas> tag unlike the <img> element, the <canvas> element requires the closing tag (</canvas>). ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
gin, as that lets the embedded document remove the sandbox attribute — making it no more secure than not using the sandbox attribute at all. sandboxing is useless if the attacker can display content outside a sandboxed iframe — such as if the viewer opens the frame in a new tab. such content should be also served from a separate origin to limit potential damage. the sandbox attribute is unsupported in internet explorer 9 and earlier. src the url of the page to embed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. sr...
...bed. use a value of about:blank to embed an empty page that conforms to the same-origin policy. also note that programatically removing an <iframe>'s src attribute (e.g. via element.removeattribute()) causes about:blank to be loaded in the frame in firefox (from version 65), chromium-based browsers, and safari/ios. srcdoc inline html to embed, overriding the src attribute. if a browser does not support the srcdoc attribute, it will fall back to the url in the src attribute. width the width of the frame in css pixels. default is 300. deprecated attributes these attributes are deprecated and may no longer be supported by all user agents. you should not use them in new content, and try to remove them from existing content. align the alignment of this element with respect to the surr...
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
with which the wrong one can be pressed, especially on virtual keyboards. note: any forms involving sensitive information like passwords (e.g. login forms) should be served over https; many browsers now implement mechanisms to warn against insecure login forms; see insecure passwords. ...
...alidation for more information. note: the line feed (u+000a) and carriage return (u+000d) characters are not permitted in a password value. when setting the value of a password control, line feed and carriage return characters are stripped out of the value. ...
<keygen> - HTML: Hypertext Markup Language
Web › HTML › Element › keygen
as specified in ietf rfc 3279. the user may be given a choice of dsa key sizes, allowing the user to choose one of the sizes defined in the dsa standard. for ec keys, the keyparams parameter specifies the name of the elliptic curve on which the key will be generated. it is normally a string from the table in nskeygenhandler.cpp. (note that only a subset of the curves named there may actually be supported in any particular browser.) if the keyparams parameter string is not a recognized curve name string, then a curve is chosen according to the user's chosen key strength (low, medium, high), using the curve named "secp384r1" for high, and the curve named "secp256r1" for medium keys. (note: choice of the number of key strengths, default values for each strength, and the ui by which the user is...
...of this specification.) the <keygen> element is only valid within an html form. it will cause some sort of selection to be presented to the user for selecting key size. the ui for the selection may be a menu, radio buttons, or possibly something else. the browser presents several possible key strengths. currently, two strengths are offered, high and medium. if the user's browser is configured to support cryptographic hardware (e.g. "smart cards") the user may also be given a choice of where to generate the key, i.e., in a smart card or in software and stored on disk. when the submit button is pressed, a key pair of the selected size is generated. the private key is encrypted and stored in the local key database. publickeyandchallenge ::= sequence { spki subjectpublickeyinfo, challe...
<main> - HTML: Hypertext Markup Language
Web › HTML › Element › main
that is, unlike elements such as <body>, headings such as <h2>, and such, <main> doesn't affect the dom's concept of the structure of the page. it's strictly informative. example <!-- other content --> <main> <h1>apples</h1> <p>the apple is the pomaceous fruit of the apple tree.</p> <article> <h2>red delicious</h2> <p>these bright red apples are the most common found in many supermarkets.</p> <p>... </p> <p>... </p> </article> <article> <h2>granny smith</h2> <p>these juicy, green apples make a great filling for apple pies.</p> <p>... </p> <p>... </p> </article> </main> <!-- other content --> accessibility concerns landmark the <main> element behaves like a main landmark role. landmarks can be used by assistive technology to quickly ...
...ing for apple pies.</p> <p>... </p> <p>... </p> </article> </main> <!-- other content --> accessibility concerns landmark the <main> element behaves like a main landmark role. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. prefer using the <main> element over declaring role="main", unless there are legacy browser support concerns. skip navigation skip navigation, also known as "skipnav", is a technique that allows an assistive technology user to quickly bypass large sections of repeated content (main navigation, info banners, etc.). this lets the user access the main content of the page faster. adding an id attribute to the <main> element lets it be a target of a skip navigation link. <body> <a href="#m...
dir - HTML: Hypertext Markup Language
directionality, then applies that directionality to the whole element. usage notes: this attribute is mandatory for the <bdo> element where it has a different semantic meaning. this attribute is not inherited by the <bdi> element. if not set, its value is auto. this attribute can be overridden by the css properties direction and unicode-bidi, if a css page is active and the element supports these properties. as the directionality of the text is semantically related to its content and not to its presentation, it is recommended that web developers use this attribute instead of the related css properties when possible. that way, the text will display correctly even on a browser that doesn't support css or has the css deactivated. the auto value should be used for data ...
...at specification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'dir' in that specification. recommendation snapshot of html living standard, from html 4.01 specification it added the auto value, and is now a true global attribute. html 4.01 specificationthe definition of 'dir' in that specification. recommendation supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
itemtype - HTML: Hypertext Markup Language
this vocabulary defines a standard set of type names and property names. ...
... all be defined to use the same vocabulary. the itemtype attribute can only be specified on elements which have an itemscope attribute specified. the itemid attribute can only be specified on elements which have both an itemscope attribute and an itemtype attribute specified. they must only be specified on elements with an itemscope attribute, whose itemtype attribute specifies a vocabulary not supporting global identifiers for items, as defined by that vocabulary's specification. the exact meaning of a global identifier is determined by the vocabulary's specification. it is left to such specifications to define whether multiple items of the same global identifier (whether on the same page or different pages) are allowed to exist, and what processing rules for that vocabulary are, with res...
title - HTML: Hypertext Markup Language
if a tooltip effect is desired, it is better to use a more accessible technique that can be accessed with the above browsing methods. 3.2.5.1. the title attribute | w3c html 5.2: 3. semantics, structure, and apis of html documents using the html title attribute – updated | the paciello group toolti...
...tion of 'title' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'title' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe definition of 'title' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
Link types - HTML: Hypertext Markup Language
ally an icon (auditory or visual). in the browser, it is usually referred to as the favicon. if there are multiple <link rel="icon">s, the browser uses their media, type, and sizes attributes to select the most appropriate icon. if several icons are equally appropriate, the last one is used. if the most appropriate icon is later found to be inappropriate, for example because it uses an unsupported format, the browser proceeds to the next-most appropriate, and so on. note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder. instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. the shortcut link type is often seen befor...
...blank" (see related html spec discussion, webkit change, and firefox bug discussion). <a>, <area>, <form> <link> pingback defines an external resource uri to call if one wishes to make a comment or a citation about the webpage. the protocol used to make such a call is defined in the pingback 1.0 specification. note: if the x-pingback: http header is also present, it supersedes the <link> element with this link type. <link> <a>, <area>, <form> preconnect provides a hint to the browser suggesting that it open a connection to the linked web site in advance, without disclosing any private information or downloading any content, so that when the link is followed the linked content can be fetched more quickly. <link> <a>, <area>, <form> ...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
ost existing sites on the web. browsers therefore introduced two modes to treat new standards compliant sites differently from old legacy sites. there are now three modes used by the layout engines in web browsers: quirks mode, almost standards mode, and full standards mode. in quirks mode, layout emulates nonstandard behavior in navigator 4 and internet explorer 5. this is essential in order to support websites that were built before the widespread adoption of web standards. in full standards mode, the behavior is (hopefully) the behavior described by the html and css specifications. in almost standards mode, there are only a very small number of quirks implemented. how do browsers determine which mode to use? for html documents, browsers use a doctype in the beginning of the document to ...
...ing the application/xhtml+xml mime type in the content-type http header, you do not need a doctype to enable standards mode, as such documents always use full standards mode. note however that serving your pages as application/xhtml+xml will cause internet explorer 8 to show a download dialog box for an unknown format instead of displaying your page, as the first version of internet explorer with support for xhtml is internet explorer 9. if you serve xhtml-like content using the text/html mime type, browsers will read it as html, and you will need the doctype to use standards mode. how do i see which mode is used? in firefox, select view page info from the context menu, and look for render mode. in internet explorer, press f12, and look for document mode. what are the differences between...
HTML: Hypertext Markup Language
Web › HTML
es or videos, emphasizing content, creating a basic form, etc. advanced topics cors enabled image the crossorigin attribute, in combination with an appropriate cors header, allows images defined by the <img> element to be loaded from foreign origins and used in a <canvas> element as if they were being loaded from the current origin. cors settings attributes some html elements that provide support for cors, such as <img> or <video>, have a crossorigin attribute (crossorigin property), which lets you configure the cors requests for the element's fetched data. preloading content with rel="preload" the preload value of the <link> element's rel attribute allows you to write declarative fetch requests in your html <head>, specifying resources that your pages will need very soon after load...
...reby creating a "block." link types in html, various link types can be used to establish and define the relationship between two documents. link elements that types can be set on include <a>, <area> and <link>. guide to media types and formats on the web the <audio> and <video> elements allow you to play audio and video media natively within your content without the need for external software support. html content categories html is comprised of several kinds of content, each of which is allowed to be used in certain contexts and is disallowed in others. similarly, each has a set of other content categories they can contain and elements that can or can't be used in them. this is a guide to these categories. quirks mode and standards mode historical information on quirks mode and stand...
Data URLs - HTTP
gment, or to incorrectly encode the data into base64 format. formatting in html a data url provides a file within a file, which can potentially be very wide relative to the width of the enclosing document. as a url, the data should be formatable with whitespace (linefeed, tab, or spaces), but there are practical issues that arise when using base64 encoding. length limitations although firefox supports data urls of essentially unlimited length, browsers are not required to support any particular maximum length of data. for example, the opera 11 browser limited urls to 65535 characters long which limits data urls to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a mime type). lack of error handling in...
...mum length of data. for example, the opera 11 browser limited urls to 65535 characters long which limits data urls to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a mime type). lack of error handling invalid parameters in media, or typos when specifying 'base64', are ignored, but no error is provided. no support for query strings, etc. the data portion of a data url is opaque, so an attempt to use a query string (page-specific parameters, with the syntax <url>?parameter-data) with a data url will just include the query string in the data the url represents. security issues a number of security issues (e.g. phishing) have been associated with data urls, and navigating to them in the browser's t...
Evolution of HTTP - HTTP
ambiguities and introduced numerous improvements: a connection can be reused, saving the time to reopen it numerous times to display the resources embedded into the single original document retrieved. pipelining has been added, allowing to send a second request before the answer for the first one is fully transmitted, lowering the latency of the communication. chunked responses are now also supported. additional cache control mechanisms have been introduced. content negotiation, including language, encoding, or type, has been introduced, and allows a client and a server to agree on the most adequate content to exchange. thanks to the host header, the ability to host different domains at the same ip address now allows server colocation. a typical flow of requests, all through one si...
...ded to trigger adoption, and as legacy browser and server versions are renewed, usage has naturally increased, without further web developer efforts. post-http/2 evolution http didn't stop evolving upon the release of http/2. like with http/1.x previously, http's extensibility is still being used to add new features. notably, we can cite new extensions of the http protocol appearing in 2016: support of alt-svc allows the dissociation of the identification and the location of a given resource, allowing for a smarter cdn caching mechanism. the introduction of client-hints allows the browser, or client, to proactively communicate information about its requirements, or hardware constraints, to the server. the introduction of security-related prefixes in the cookie header, now helps guarant...
Identifying resources on the Web - HTTP
t the part after the #, also known as fragment identifier, is never sent to the server with the request. usage notes when using urls in html content, you should generally only use a few of these url schemes. when referring to subresources — that is, files that are being loaded as part of a larger document — you should only use the http and https schemes. increasingly, browsers are removing support for using ftp to load subresources, for security reasons. ftp is still acceptable at the top level (such as typed directly into the browser's url bar, or the target of a link), although some browsers may delegate loading ftp content to another application. examples https://developer.mozilla.org/docs/learn tel:+1-816-555-1212 git@github.com:mdn/browser-compat-data.git ftp://example.org/reso...
... security reasons. ...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
is authenticated or a csrf token is correct, this effectively acts as a defence measure against session fixation. on the application server, the web application must check for the full cookie name including the prefix—user agents do not strip the prefix from the cookie before sending it in a request's cookie header. for more information about cookie prefixes and the current state of browser support, see the prefixes section of the set-cookie reference article. javascript access using document.cookie new cookies can be created via javascript using the document.cookie property, and existing cookies can be accessed from javascript as well, if the httponly flag is not set. document.cookie = "yummy_cookie=choco"; document.cookie = "tasty_cookie=strawberry"; console.log(document.cookie); /...
...ication/confidentiality mechanisms such as json web tokens. ways to mitigate attacks involving cookies: use the httponly attribute to prevent access to cookie values via javascript. cookies that are used for sensitive information (such as indicating authentication) should have a short lifetime, with the samesite attribute set to strict or lax. (see samesite cookies, above.) in browsers that support samesite, this has the effect of ensuring that the authentication cookie is not sent with cross-origin requests, so such a request is effectively unauthenticated to the application server. tracking and privacy third-party cookies a cookie is associated with a domain. if this domain is the same as the domain of the page you are on, the cookie is called a first-party cookie. if the domain i...
Accept-Encoding - HTTP
the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. even if both the client and the server supports the same compression algorithms, the server may choose not to compress the body of a response, if the identity value is also acceptable. two common cases lead to this: the data to be sent is already compressed and a second compression won't lead to smaller data to be transmitted. this may be the case with some image formats; the server is overloaded and cannot afford the computational overhead induced by the compression requirement. typically, mic...
...e deflate compression algorithm. br a compression format using the brotli algorithm. identity indicates the identity function (i.e. no compression, nor modification). this value is always considered as acceptable, even if not present. * matches any content encoding not already listed in the header. this is the default value if the header is not present. it doesn't mean that any algorithm is supported; merely that no preference is expressed. ;q= (qvalues weighting) any value is placed in an order of preference expressed using a relative quality value called weight. examples accept-encoding: gzip accept-encoding: gzip, compress, br accept-encoding: br;q=1.0, gzip;q=0.8, *;q=0.1 specifications specification title rfc 7231, section 5.3.4: accept-encoding hy...
Accept-Ranges - HTTP
the accept-ranges response http header is a marker used by the server to advertise its support of partial requests. the value of this field indicates the unit that can be used to define a range. in presence of an accept-ranges header, the browser may try to resume an interrupted download, rather than to start it from the start again. header type response header forbidden header name no syntax accept-ranges: <range-unit> accept-ranges: none directives <range-unit> defines the range unit the server supports. though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry. ...
...rom the start again. header type response header forbidden header name no syntax accept-ranges: <range-unit> accept-ranges: none directives <range-unit> defines the range unit the server supports. though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry. none no range unit is supported, this makes the header equivalent of its own absence and is therefore rarely used, though some browsers, like ie9, it is used to disable or remove the pause buttons in the download manager. examples accept-ranges: bytes specifications specification title rfc 7233, section 2.3: accept-ranges hypertext transfer protocol (http/1.1): range requests ...
CSP: report-uri - HTTP
the deprecated http content-security-policy (csp) report-uri directive instructs the user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. though the report-to directive is intended to replace the deprecated report-uri directive, report-to isn’t supported in most browsers yet. so for compatibility with current browsers while also adding forward compatibility when browsers get report-to support, you can specify both report-uri and report-to: content-security-policy: ...; report-uri https://endpoint.com; report-to groupname in browsers that support report-to, the report-uri directive will be ignored. the directive has no effect in and of itself, but only gains meaning...
... syntax content-security-policy: report-uri <uri>; content-security-policy: report-uri <uri> <uri>; <uri> a uri where to post the report to. examples see content-security-policy-report-only for more information and examples. ...
CSP: style-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
...tyle { background: red; } </style> <div style="display:none">foo</div> you can use a nonce-source to only allow specific inline style blocks: content-security-policy: style-src 'nonce-2726c7f26c' you will have to set the same nonce on the <style> element: <style nonce="2726c7f26c"> #inline-style { background: red; } </style> alternatively, you can create hashes from your inline styles. csp supports sha256, sha384 and sha512. content-security-policy: style-src 'sha256-a330698cbe9dc4ef1fb12e2ee9fc06d5d14300262fa4dc5878103ab7347e158f' when generating the hash, don't include the <style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. <style>#inline-style { background: red; }</style> unsafe style expressions the 'unsafe-eval' source ex...
Cross-Origin-Embedder-Policy - HTTP
fe-none | require-corp directives unsafe-none this is the default value. allows the document to fetch cross-origin resources without giving explicit permission through the cors protocol or the cross-origin-resource-policy header. require-corp a document can only load resources from the same origin, or resources explicitly marked as loadable from another origin. if a cross origin resource supports cors, the crossorigin attribute or the cross-origin-resource-policy header must be used to load it without being blocked by coep. examples certain features depend on cross-origin isolation you can only access certain features like sharedarraybuffer objects or performance.now() with unthrottled timers, if your document has a coep header with the value require-corp value set. cross-origin...
...o set as well. to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } avoiding coep blockage with cors if you enable coep using require-corp and have a cross origin resource that needs to be loaded, it needs to support cors and you need to explicitly mark the resource as loadable from another origin to avoid blockage from coep. for example, you can use the crossorigin attribute for this image from a third-party site: <img src="https://thirdparty.com/img.png" crossorigin> specifications specification html living standardthe definition of 'cross-origin-embedder-policy header' in that ...
Large-Allocation - HTTP
or other similar methods without rel="noopener" or the "noopener" feature being set. this is for the same reason as above, namely that they can communicate and thus we cannot allow them to switch processes. a large-allocation header was ignored due to the document not being loaded out of process. firefox has moved to a multiprocess architecture, and this architecture is required in order to support the large-allocation header. some legacy addons can prevent firefox from using this new, faster, multiprocess architecture. if you have one of these addons installed, then we will continue to use the old single process architecuture for compatibility, and cannot handle the large-allocation header. this page would be loaded in a new process due to a large-allocation header, however large-allo...
...this new, faster, multiprocess architecture. if you have one of these addons installed, then we will continue to use the old single process architecuture for compatibility, and cannot handle the large-allocation header. this page would be loaded in a new process due to a large-allocation header, however large-allocation process creation is disabled on non-win32 platforms. firefox currently only supports the large-allocation header in our 32-bit windows builds, as memory fragmentation is not an issue in 64-bit builds. if you are running a non-win32 version of firefox, this error will appear. this check can be disabled with the "dom.largeallocation. forceenable" boolean preferece in about:config. specifications not part of any current specifications. an explainer of the ideas behind thi...
Referrer-Policy - HTTP
specifications ...
...//example.com/page?q=123 specifying a fallback policy if you want to specify a fallback policy in any case the desired policy hasn't got wide enough browser support, use a comma-separated list with the desired policy specified last: referrer-policy: no-referrer, strict-origin-when-cross-origin in the above scenario, no-referrer will only be used if strict-origin-when-cross-origin is not supported by the browser. specifying multiple values is only supported in the referrer-policy http header, and not in the referrerpolicy attribute. specifications specification status referrer policy editor's draft ...
Transfer-Encoding - HTTP
transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself. each segment of a multi-node connection can use different transfer-encoding values. if you want to compress data over the whole connection, use the end-to-end content-encoding header instead. ...
...ng is used by almost no browsers today, partly because of a patent issue (which expired in 2003). deflate using the zlib structure (defined in rfc 1950), with the deflate compression algorithm (defined in rfc 1951). gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc. this is originally the format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. identity indicates the identity function (i.e. no compression, nor modification). this token, except if explicitly specified, is always deemed acceptable. examples chunked encoding chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may n...
Control flow and error handling - JavaScript
this chapter provides an overview of these statements. the javascript reference contains exhaustive details about the statements in this chapter. the semicolon (;) character is used to separate statements in javascript code. any javascript expression is also a statement. see expressions and operators for complete information about expressions. block statement the most basic statement is a block statement, which is used to group statements. ...
... block is in the same scope as the var x statement before the block. (in c or java, the equivalent code would have outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped. see the let and const reference pages for more information. conditional statements a conditional statement is a set of commands that executes if a specified condition is true. javascript supports two conditional statements: if...else and switch. if...else statement use the if statement to execute a statement if a logical condition is true. use the optional else clause to execute a statement if the condition is false. an if statement looks like this: if (condition) { statement_1; } else { statement_2; } here, the condition can be any expression that evaluates to true or false...
Indexed collections - JavaScript
, it is safer to use array literals. alternatively, create an empty array first before adding the single element to it. in es2015, you can use the array.of static method to create arrays with single element. let wisenarray = array.of(9.3) // wisenarray contains only one element 9.3 referring to array elements because elements are also properties, you can access the using property accessors. suppose you define the following array: let myarray = ['wind', 'rain', 'fire'] you can refer to the first element of the array as myarray[0], the second element of the array as myarray[1], etc… the index of the elements begins with zero. note: you can also use property accessors to access other properties of the array, like with an object. let arr = ['one', 'two', 'three'] arr[2] // ...
...gins with zero. note: you can also use property accessors to access other properties of the array, like with an object. let arr = ['one', 'two', 'three'] arr[2] // three arr['length'] // 3 populating an array you can populate an array by assigning values to its elements. for example: let emp = [] emp[0] = 'casey jones' emp[1] = 'phil lesh' emp[2] = 'august west' note: if you supply a non-integer value to the array operator in the code above, a property will be created in the object representing the array, instead of an array element. let arr = [] arr[3.4] = 'oranges' console.log(arr.length) // 0 console.log(arr.hasownproperty(3.4)) // true you can also populate an array when you create it: let myarray = new array('hello', myvar, 3.14159) // or let...
Numbers and dates - JavaScript
000; // 2139095040 var flt_mantissa = 0b00000000011111111111111111111111; // 8388607 octal numbers octal number syntax uses a leading zero. if the digits after the 0 are outside the range 0 through 7, the number will be interpreted as a decimal number. var n = 0755; // 493 var m = 0644; // 420 strict mode in ecmascript 5 forbids octal syntax. octal syntax isn't part of ecmascript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%". in ecmascript 2015, octal numbers are supported if they are prefixed with 0o, e.g.: var a = 0o10; // es2015: 8 hexadecimal numbers hexadecimal number syntax uses a leading zero followed by a lowercase or uppercase latin letter "x" (0x or 0x). if the digits after 0x are outside the range (0123456...
...ere is a getday method that returns the day of the week, but no corresponding setday method, because the day of the week is set automatically. these methods use integers to represent these values as follows: seconds and minutes: 0 to 59 hours: 0 to 23 day: 0 (sunday) to 6 (saturday) date: 1 to 31 (day of the month) months: 0 (january) to 11 (december) year: years since 1900 for example, suppose you define the following date: var xmas95 = new date('december 25, 1995'); then xmas95.getmonth() returns 11, and xmas95.getfullyear() returns 1995. the gettime and settime methods are useful for comparing dates. the gettime method returns the number of milliseconds since january 1, 1970, 00:00:00 for a date object. for example, the following code displays the number of days left in the ...
Unicode property escapes - JavaScript
ages or scripts), etc. note: for unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of unicode code points. see also regexp.prototype.unicode. note: some unicode properties encompasses much more characters than some character classes (such as \w which matches only latin letters, a to z) but the latter is better supported among browsers (as of january 2020). syntax the following section is also duplicated on this cheatsheet. do not forget to edit it as well, thanks! // non-binary values \p{unicodepropertyvalue} \p{unicodepropertyname=unicodepropertyvalue} // binary and non-binary values \p{unicodebinarypropertyname} // negation: \p is negated \p \p{unicodepropertyvalue} \p{unicodebinarypropertyname} ...
...redominant" used script. if we want to match characters based on a "non-predominant" script, we could use the script_extensions property (scx for short). // ٢ is the digit 2 in arabic-indic notation // while it is predominantly written within the arabic script // it can also be written in the thaana script "٢".match(/\p{script=thaana}/u); // null as thaana is not the predominant script super() "٢".match(/\p{script_extensions=thaana}/u); // ["٢", index: 0, input: "٢", groups: undefined] unicode property escapes vs. character classes with javascript regular expressions, it is also possible to use character classes and especially \w or \d to match letters or digits. however, such forms only match characters from the latin script (in other words, a to z and a to z for \w and 0 t...
TypeError: cyclic object value - JavaScript
the javascript exception "cyclic object value" occurs when object references were found in json. json.stringify() doesn't try to solve them and fails accordingly. message typeerror: cyclic object value (firefox) typeerror: converting circular structure to json (chrome and opera) typeerror: circular reference in value argument not supported (edge) error type typeerror what went wrong? the json format per se doesn't support object references (although an ietf draft exists), hence json.stringify() doesn't try to solve them and fails accordingly. examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyc...
...), hence json.stringify() doesn't try to solve them and fails accordingly. examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyclic object value to serialize circular references you can use a library that supports them (e.g. cycle.js) or implement a solution by yourself, which will require finding and replacing (or removing) the cyclic references by serializable values. the snippet below illustrates how to find and filter (thus causing data loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return (key, va...
TypeError: "x" is not a constructor - JavaScript
the javascript exception "is not a constructor" occurs when there was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor. message typeerror: object doesn't support this action (edge) typeerror: "x" is not a constructor typeerror: math is not a constructor typeerror: json is not a constructor typeerror: symbol is not a constructor typeerror: reflect is not a constructor typeerror: intl is not a constructor typeerror: atomics is not a constructor error type typeerror what went wrong? there was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor. see constructor or the new operator for more information on what a constructor is. there are many global objects, like string or...
...r: math, json, symbol, reflect, intl, atomics. generator functions cannot be used as constructors either. examples invalid cases var car = 1; new car(); // typeerror: car is not a constructor new math(); // typeerror: math is not a constructor new symbol(); // typeerror: symbol is not a constructor function* f() {}; var obj = new f; // typeerror: f is not a constructor a car constructor suppose you want to create an object type for cars. you want this type of object to be called car, and you want it to have properties for make, model, and year. to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talo...
Arrow function expressions - JavaScript
arrow function expressions are ill suited as methods, and they cannot be used as constructors. ...
...ptional when there's only one parameter name: (singleparam) => { statements } singleparam => { statements } // the parameter list for a function with no parameters should be written with a pair of parentheses. () => { statements } advanced syntax // parenthesize the body of a function to return an object literal expression: params => ({foo: bar}) // rest parameters and default parameters are supported (param1, param2, ...rest) => { statements } (param1 = defaultvalue1, param2, …, paramn = defaultvaluen) => { statements } // destructuring within the parameter list is also supported var f = ([a, b] = [1, 2], {x: c} = {x: a + b}) => a + b + c; f(); // 6 description see also "es6 in depth: arrow functions" on hacks.mozilla.org. two factors influenced the introduction of arrow function...
Functions - JavaScript
unction. arguments.callee : the currently executing function. arguments.caller : the function that invoked the currently executing function. arguments.length: the number of arguments passed to the function. defining method functions getter and setter functions you can define getters (accessor methods) and setters (mutator methods) on any standard built-in object or user-defined object that supports the addition of new properties. the syntax for defining getters and setters uses the object literal syntax. get binds an object property to a function that will be called when that property is looked up. set binds an object property to a function to be called when there is an attempt to set that property. method definition syntax starting with ecmascript 2015, you are able to de...
...function zero() { // danger: compatibility risk console.log("this is zero."); } } es2015 says that if shoulddefinezero is false, then zero should never be defined, since the block never executes. however, it's a new part of the standard. historically, this was left unspecified, and some browsers would define zero whether the block executed or not. in strict mode, all browsers that support es2015 handle this the same way: zero is defined only if shoulddefinezero is true, and only in the scope of the if-block. a safer way to define functions conditionally is to assign a function expression to a variable: var zero; if (shoulddefinezero) { zero = function() { console.log("this is zero."); }; } examples returning a formatted number the following function returns a...
Array.prototype[@@iterator]() - JavaScript
tax arr[symbol.iterator]() return value the initial value given by the values() iterator. by default, using arr[symbol.iterator] will return the values() function. ...
...a [iterable].prototype.values method. this could be a built-in object like string object or a custom object. ...
Array.prototype.every() - JavaScript
it returns true. (it is vacuously true that all elements of the empty set satisfy any given condition.) polyfill every was added to the ecma-262 standard in the 5th edition, and it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of every in implementations which do not natively support it. this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and typeerror have their original values, and that callbackfn.call evaluates to the original value of function.prototype.call. if (!array.prototype.every) { array.prototype.every = function(callbackfn, thisarg) { 'use strict'; var t, k; if (this == null) { throw new typeerror('this...
...of calling the get internal method // of o with the argument "length". // 3. let len be touint32(lenvalue). var len = o.length >>> 0; // 4. if iscallable(callbackfn) is false, throw a typeerror exception. if (typeof callbackfn !== 'function' && object.prototype.tostring.call(callbackfn) !== '[object function]') { throw new typeerror(); } // 5. if thisarg was supplied, let t be thisarg; else let t be undefined. if (arguments.length > 1) { t = thisarg; } // 6. let k be 0. k = 0; // 7. repeat, while k < len while (k < len) { var kvalue; // a. let pk be tostring(k). // this is implicit for lhs operands of the in operator // b. let kpresent be the result of calling the hasproperty internal // ...
Array.prototype.find() - JavaScript
{ throw typeerror('"this" is null or not defined'); } var o = object(this); // 2. let len be ? tolength(? get(o, "length")). var len = o.length >>> 0; // 3. if iscallable(predicate) is false, throw a typeerror exception. if (typeof predicate !== 'function') { throw typeerror('predicate must be a function'); } // 4. if thisarg was supplied, let t be thisarg; else let t be undefined. var thisarg = arguments[1]; // 5. let k be 0. var k = 0; // 6. repeat, while k < len while (k < len) { // a. let pk be ! tostring(k). // b. let kvalue be ? get(o, pk). // c. let testresult be toboolean(? call(predicate, t, « kvalue, k, o »)). // d. if testresult is true, return kvalu...
...boolean(? call(predicate, t, « kvalue, k, o »)). // d. if testresult is true, return kvalue. var kvalue = o[k]; if (predicate.call(thisarg, kvalue, k, o)) { return kvalue; } // e. increase k by 1. k++; } // 7. return undefined. return undefined; }, configurable: true, writable: true }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it is best not to polyfill array.prototype at all, as you cannot make it non-enumerable. examples find an object in an array by one of its properties const inventory = [ {name: 'apples', quantity: 2}, {name: 'bananas', quantity: 0}, {name: 'cherries', quantity: 5} ]; function ischerries(fruit) { return fru...
Array.prototype.findIndex() - JavaScript
throw new typeerror('"this" is null or not defined'); } var o = object(this); // 2. let len be ? tolength(? get(o, "length")). var len = o.length >>> 0; // 3. if iscallable(predicate) is false, throw a typeerror exception. if (typeof predicate !== 'function') { throw new typeerror('predicate must be a function'); } // 4. if thisarg was supplied, let t be thisarg; else let t be undefined. var thisarg = arguments[1]; // 5. let k be 0. var k = 0; // 6. repeat, while k < len while (k < len) { // a. let pk be ! tostring(k). // b. let kvalue be ? get(o, pk). // c. let testresult be toboolean(? call(predicate, t, « kvalue, k, o »)). // d. if testresult is true, return k. ...
... c. let testresult be toboolean(? call(predicate, t, « kvalue, k, o »)). // d. if testresult is true, return k. var kvalue = o[k]; if (predicate.call(thisarg, kvalue, k, o)) { return k; } // e. increase k by 1. k++; } // 7. return -1. return -1; }, configurable: true, writable: true }); } if you need to support truly obsolete javascript engines that do not support object.defineproperty, it is best not to polyfill array.prototype methods at all, as you cannot make them non-enumerable. examples find the index of a prime number in an array the following example returns the index of the first element in the array that is a prime number, or -1 if there is no prime number. function isprime(num) { fo...
Array.from() - JavaScript
by subclasses of array, and create new instances of the subclass, not array. polyfill array.from() was added to the ecma-262 standard in the 6th edition (es2015). as such, it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of array.from() in implementations that don't natively support it. polyfill notes: this algorithm is exactly as specified in ecma-262 6th edition (assuming object and typeerror have their original values and that callback.call() evaluates to the original value of function.prototype.call()). in addition, since true iterables cannot be polyfilled, this implementation does not support generic iterables as defined in the 6th edition of ecma-262. // prod...
...typeof mapfn !== 'undefined') { // 5. else // 5. a if iscallable(mapfn) is false, throw a typeerror exception. if (!iscallable(mapfn)) { throw new typeerror( 'array.from: when provided, the second argument must be a function' ); } // 5. b. if thisarg was supplied, let t be thisarg; else let t be undefined. if (arguments.length > 2) { t = arguments[2]; } } // 10. let lenvalue be get(items, "length"). // 11. let len be tolength(lenvalue). var len = tolength(items.length); // 13. if isconstructor(c) is true, then // 13. a. let a ...
Array.prototype.sort() - JavaScript
a function that defines the sort order. if omitted, the array elements are converted to strings, then sorted according to each character's unicode code point value. firstel the first element for comparison. secondel the second element for comparison. return value the sorted array. note that the array is sorted in place, and no copy is made. description if comparefunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in utf-16 code units order. for example, "banana" comes before "cherry". in a numeric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in the unicode order. all undefined elements are sorted to the end of the array. note : in utf-16, unicode character...
...de order. all undefined elements are sorted to the end of the array. note : in utf-16, unicode characters above \uffff are encoded as two surrogate code units, of the range \ud800-\udfff. the value of each code unit is taken separately into account for the comparison. thus the character formed by the surrogate pair \ud655\ude55 will be sorted before the character \uff3a. if comparefunction is supplied, all non-undefined array elements are sorted according to the return value of the compare function (all undefined elements are sorted to the end of the array, with no call to comparefunction). if a and b are two elements being compared, then: if comparefunction(a, b) returns less than 0, sort a to an index lower than b (i.e. a comes first). if comparefunction(a, b) returns 0, leave a and...
Array.prototype.toLocaleString() - JavaScript
anguage tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. options optional an object with configuration properties, for numbers see number.prototype.tolocalestring(), and for dates see date.prototype.tolocalestring(). return value a string representing the elements of the array. polyfill // https://tc39.github.io/ecma402/#sup-array.prototype.tolocalestring if (!array.prototype.tolocalestring) { object.defineproperty(array.prototype, 'tolocalestring', { value: function(locales, options) { // 1. let o be ? toobject(this value). if (this == null) { throw new typeerror('"this" is null or not defined'); } var a = object(this); // 2. let len be ? tolength(? get(a, "length")). ...
... // « locales, options » // ) // ) r = nextelement == null ? '' : nextelement.tolocalestring(locales, options); // e. let r be a string value produced by // concatenating s and r. r = s + r; // f. increase k by 1. k++; } // 10. return r. return r; } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples using locales and options the elements of the array are converted to strings using their tolocalestring methods. object: object.prototype.tolocalestring() number: number.prototype.tolocalestring() date: d...
BigInt - JavaScript
ion when tested against typeof, a bigint will give "bigint": typeof 1n === 'bigint' // true typeof bigint('1') === 'bigint' // true when wrapped in an object, a bigint will be considered as a normal "object" type: typeof object(1n) === 'object' // true operators the following operators may be used with bigints (or object-wrapped bigints): +, *, -, **, %. bitwise operators are supported as well, except >>> (zero-fill right shift) as all bigints are signed. also unsupported is the unary operator (+), in order to not break asm.js. const previousmaxsafe = bigint(number.max_safe_integer) // ↪ 9007199254740991n const maxplusone = previousmaxsafe + 1n // ↪ 9007199254740992n const thefuture = previousmaxsafe + 2n // ↪ 9007199254740993n, this works now! const multi = pr...
...bigint.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. usage recommendations coercion because coercing between number and bigint can lead to loss of precision, it is recommended to only use bigint when values greater than 253 are reasonably expected and not to coerce between the two types. cryptography the operations supported on bigints are not constant time. bigint is therefore unsuitable for use in cryptography. use within json using json.stringify() with any bigint value will raise a typeerror as bigint values aren't serialized in json by default. however, you can implement your own tojson method if needed: bigint.prototype.tojson = function() { return this.tostring() } instead of throwing, json.stringif...
Intl.Collator.prototype.resolvedOptions() - JavaScript
perties reflecting the locale and collation options computed during the initialization of the given collator object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. usage sensitivity ignorepunctuation the values provided for these properties in the options argument or filled in as defaults. collation the value requested using the unicode extension key "co", if it is supported for locale, or "default". numeric casefirst the values requested for these properties in the options argument or using the unicode...
...the values provided for these properties in the options argument or filled in as defaults. collation the value requested using the unicode extension key "co", if it is supported for locale, or "default". numeric casefirst the values requested for these properties in the options argument or using the unicode extension keys "kn" and "kf" or filled in as defaults. if the implementation does not support these properties, they are omitted. examples using the resolvedoptions method var de = new intl.collator('de', { sensitivity: 'base' }) var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de" usedoptions.usage; // "sort" usedoptions.sensitivity; // "base" usedoptions.ignorepunctuation; // false usedoptions.collation; // "default" usedoptio...
Intl.DateTimeFormat() constructor - JavaScript
you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.datetimeformat([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. to use the browser's default locale, omit this argument or pass undefined. unicode extension are supported (for example "en-us-u-ca-buddhist"). for the general form and interpretation of the locales argument, see the intl page. the following unicode extension keys are allowed: nu numbering system. possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "tel...
...ase both options have been specified. formatmatcher the format matching algorithm to use. possible values are "basic" and "best fit"; the default is "best fit". see the following paragraphs for information about the use of this property. the following properties describe the date-time components to use in formatted output, and their desired representations. implementations are required to support at least the following subsets: weekday, year, month, day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute implementations may support other subsets, and requests will be negotiated against all available subset-representation combinations to find the best match. two algorithms are available for this ...
Intl.DateTimeFormat - JavaScript
hat enable language-sensitive date and time formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.datetimeformat() creates a new datetimeformat object. static methods intl.datetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.datetimeformat.prototype.format() getter function that formats a date according to the locale and formatting options of this datetimeformat object. intl.datetimeformat.prototype.formattoparts() returns an array of...
...rabic speaking countries uses real arabic digits console.log(new intl.datetimeformat('ar-eg').format(date)); // → "ٔ٩‏/ٔ٢‏/٢٠ٔ٢" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(new intl.datetimeformat('ja-jp-u-ca-japanese').format(date)); // → "24/12/19" // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(new intl.datetimeformat(['ban', 'id']).format(date)); // → "19/12/2012" using options the date and time formats can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0, 200)); // request a weekday along with a long date var options = { weekday: 'long', year:...
Intl.NumberFormat - JavaScript
for objects that enable language sensitive number formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.numberformat() creates a new numberformat object. static methods intl.numberformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.numberformat.prototype.format() getter function that formats a number according to the locale and formatting options of this numberformat object. intl.numberformat.prototype.formattoparts() returns an array of obj...
...mber)); // → ٔ٢٣٤ل٦٫٧٨٩ // india uses thousands/lakh/crore separators console.log(new intl.numberformat('en-in').format(number)); // → 1,23,456.789 // the nu extension key requests a numbering system, e.g. ...
Intl.PluralRules - JavaScript
instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. ...
... instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. ...
JSON.stringify() - JavaScript
key}'`; else return this; } }; json.stringify(obj); // '{"data":"data"}' json.stringify({ obj }); // shorthand property names (es2015). ...
...cycle.js by douglas crockford) or implement a solution by yourself, which will require finding and replacing (or removing) the cyclic references by serializable values. issue with plain json.stringify for use as javascript historically, json was not a completely strict subset of javascript. ...
JSON - JavaScript
es json is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing commas are forbidden. numbers leading zeros are prohibited. a decimal point must be followed by at least one digit. nan and infinity are unsupported. any json text is a valid javascript expression... ...but only in javascript engines that have implemented the proposal to make all json text valid ecma-262. in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph separator are allowed in string literals and property keys in json; but their use in these features in javascript string literals is a synta...
...ror to be thrown. the reviver option allows for interpreting what the replacer has used to stand in for other datatypes. json.stringify(value[, replacer[, space]]) return a json string corresponding to the specified value, optionally including only certain properties or replacing property values in a user-defined manner. by default, all instances of undefined are replaced with null, and other unsupported native data types are censored. the replacer option allows for specifying other behavior. examples example json { "browsers": { "firefox": { "name": "firefox", "pref_url": "about:config", "releases": { "1": { "release_date": "2004-11-09", "status": "retired", "engine": "gecko", "engine_version": "1.7" } ...
Object.keys() - JavaScript
. return value an array of strings that represent all the enumerable properties of the given object. description object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. the ordering of the properties is the same as that given by looping over the properties of the object manually. ...
...t all the enumerable properties of the given object. description object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. the ordering of the properties is the same as that given by looping over the properties of the object manually. ...
Object.prototype.__proto__ - JavaScript
flung, and are not limited to simply the time spent in obj.__proto__ = ... statements, but may extend to any code that has access to any object whose [[prototype]] has been altered. if you care about performance you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). warning: while object.prototype.__proto__ is supported today in most browsers, its existence and exact behavior has only been standardized in the ecmascript 2015 specification as a legacy feature to ensure compatibility for web browsers. for better support, use object.getprototypeof() instead. the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[prototype]] (...
...nternal [[prototype]] (either an object or null) of the object through which it is accessed. the use of __proto__ is controversial and discouraged. it was never originally included in the ecmascript language spec, but modern browsers implemented it anyway. only recently was the __proto__ property standardized by the ecmascript 2015 specification for compatibility with web browsers, so it will be supported into the future. it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a slow operation that should be avoided if performance is a concern). the __proto__ property can also be used in an object literal definition to set the object [[prototype]] on creation, as an al...
RegExp.prototype[@@replace]() - JavaScript
hub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax regexp[symbol.replace](str, newsubstr|function) parameters str a string that is a target of the replacement. newsubstr (replacement) the string that replaces the substring. a number of special replacement patterns are supported; see the specifying a string as a parameter section in string.prototype.replace() page. function (replacement) a function to be invoked to create the new substring. the arguments supplied to this function are described in the specifying a function as a parameter section in string.prototype.replace() page. return value a new string with some or all matches of a pattern replaced by a rep...
...rototype.replace(), except the different this and the different arguments order. var re = /-/g; var str = '2016-01-01'; var newstr = re[symbol.replace](str, '.'); console.log(newstr); // 2016.01.01 using @@replace in subclasses subclasses of regexp can override the [@@replace]() method to modify the default behavior. class myregexp extends regexp { constructor(pattern, flags, count) { super(pattern, flags); this.count = count; } [symbol.replace](str, replacement) { // perform @@replace |count| times. var result = str; for (var i = 0; i < this.count; i++) { result = regexp.prototype[symbol.replace].call(this, result, replacement); } return result; } } var re = new myregexp('\\d', '', 3); var str = '01234567'; var newstr = str.replace(re, '#'); /...
Set - JavaScript
set2] // [1, 2, 3, 4] // intersect can be simulated via let intersection = new set([...set1].filter(x => set2.has(x))) // difference can be simulated via let difference = new set([...set1].filter(x => !set2.has(x))) // iterate set entries with foreach() myset.foreach(function(value) { console.log(value) }) // 1 // 2 // 3 // 4 implementing basic set operations function issuperset(set, subset) { for (let elem of subset) { if (!set.has(elem)) { return false } } return true } function union(seta, setb) { let _union = new set(seta) for (let elem of setb) { _union.add(elem) } return _union } function intersection(seta, setb) { let _intersection = new set() for (let elem of setb) { if (seta.h...
... _difference.delete(elem) } else { _difference.add(elem) } } return _difference } function difference(seta, setb) { let _difference = new set(seta) for (let elem of setb) { _difference.delete(elem) } return _difference } // examples let seta = new set([1, 2, 3, 4]) let setb = new set([2, 3]) let setc = new set([3, 4, 5, 6]) issuperset(seta, setb) // => true union(seta, setc) // => set [1, 2, 3, 4, 5, 6] intersection(seta, setc) // => set [3, 4] symmetricdifference(seta, setc) // => set [1, 2, 5, 6] difference(seta, setc) // => set [1, 2] relation with array objects let myarray = ['value1', 'value2', 'value3'] // use the regular set constructor to transform an array into a set le...
String.prototype.charAt() - JavaScript
s returned. return value a string representing the character (exactly one utf-16 code unit) at the specified index. if index is out of range, charat() returns an empty string. description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character—in a string called stringname—is stringname.length - 1. if the index you supply is out of this range, javascript returns an empty string. if no index is provided to charat(), the default is 0. examples displaying characters at different locations in a string the following example displays characters at different locations in the string "brave new world": var anystring = 'brave new world'; console.log("the character at index 0 is '" + anystring.charat() + "'"); //...
...urrogate without preceding high surrogate' } let prev = str.charcodeat(i - 1) // (could change last hex to 0xdb7f to treat high private surrogates // as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate' } // return the next character instead (and increment) return [str.charat(i + 1), i + 1] } fixing charat() to support non-basic-multilingual-plane (bmp) characters while the previous example may be more useful for programs that must support non-bmp characters (since it does not require the caller to know where any non-bmp character might appear), in the event that one does wish, in choosing a character by index, to treat the surrogate pairs within a string as the single characters they represent, one can us...
String - JavaScript
for example: let outputstrings = [] for (let i = 0, n = inputvalues.length; i < n; ++i) { outputstrings.push(string(inputvalues[i])); } specifications specification ecmascript (ecma-262)the definition ...
...for example: let outputstrings = [] for (let i = 0, n = inputvalues.length; i < n; ++i) { outputstrings.push(string(inputvalues[i])); } specifications specification ecmascript (ecma-262)the definition of 'stri...
Symbol - JavaScript
the data type symbol is a primitive data type. the symbol() function returns a value of type symbol, has static properties that expose several members of built-in objects, has static methods that expose the global symbol registry, and resembles a built-in object class, but is incomplete as a constructor because it does not support the syntax "new symbol()". every symbol value returned from symbol() is unique. a symbol value may be used as an identifier for object properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general. some further explanation about purpose and usage can be found in the glossary entry for symbol. description to create a new primitive ...
... on objects the method object.getownpropertysymbols() returns an array of symbols and lets you find symbol properties on a given object. note that every object is initialized with no own symbol properties, so that this array will be empty unless you've set symbol properties on the object. constructor symbol() creates a new symbol object. it is incomplete as a constructor because it does not support the syntax "new symbol()". static properties symbol.asynciterator a method that returns the default asynciterator for an object. used by for await...of. symbol.hasinstance a method determining if a constructor object recognizes an object as its instance. used by instanceof. symbol.isconcatspreadable a boolean value indicating if an object should be flattened to its array elements. u...
parseInt() - JavaScript
ring begins with "0x" or "0x" (a zero, followed by lowercase or uppercase x), radix is assumed to be 16 and the rest of the string is parsed as a hexidecimal number. if the input string begins with "0" (a zero), radix is assumed to be 8 (octal) or 10 (decimal). exactly which radix is chosen is implementation-dependent. ecmascript 5 clarifies that 10 (decimal) should be used, but not all browsers support this yet. for this reason, always specify a radix when using parseint. if the input string begins with any other value, the radix is 10 (decimal). if the first character cannot be converted to a number, parseint returns nan. for arithmetic purposes, the nan value is not a number in any radix. you can call the isnan function to determine if the result of parseint is nan. if nan is passed o...
...radix. leading whitespace in string is ignored. if radix is undefined or 0, it is assumed to be 10 except when the number begins with the character pairs 0x or 0x, in which case a radix of 16 is assumed. this differs from ecmascript 3, which merely discouraged (but allowed) octal interpretation. many implementations have not adopted this behavior as of 2013. and, because older browsers must be supported, always specify a radix. a stricter parse function it is sometimes useful to have a stricter way to parse integers. regular expressions can help: function filterint(value) { if (/^[-+]?(\d+|infinity)$/.test(value)) { return number(value) } else { return nan } } console.log(filterint('421')) // 421 console.log(filterint('-421')) // -421 console...
Object initializer - JavaScript
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let o = {} let o = {a: 'foo', b: 42, c: {}} let a = 'foo', b = 42, c = {} let o = {a: a, b: b, c: c} let o = { property: function (parameters) {}, get property() {}, set property(value) {} }; new notations in ecmascript 2015 please see the compatibility table for support for these notations. in non-supporting environments, these notations will lead to syntax errors. // shorthand property names (es2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // shorthand method names (es2015) let o = { property(parameters) {} } // computed property names (es2015) let prop = 'foo' let o = { [prop]: 'hey', ['b' + 'ar']: 'there' } description an object initia...
... are generator functions: let o = { *generator() { ........... } }; which is equivalent to this es5-like notation (but note that ecmascript 5 has no generators): let o = { generator: function* () { ........... } }; for more information and examples about methods, see method definitions. computed property names starting with ecmascript 2015, the object initializer syntax also supports computed property names. that allows you to put an expression in brackets [], that will be computed and used as the property name. this is reminiscent of the bracket notation of the property accessor syntax, which you may have used to read and set properties already. now you can use a similar syntax in object literals, too: // computed property names (es2015) let i = 0 let a = { ['foo' +...
new operator - JavaScript
ginal color' console.log(object.getprototypeof(car2).color); // 'original color' console.log(car1.color); // 'black' console.log(car2.color); // 'original color' if you didn't write the new operator, the constructor function would be invoked like any regular function, without creating an object. in this case, the value of this is also different. examples object type and object instance suppose you want to create an object type for cars. you want this type of object to be called car, and you want it to have properties for make, model, and year. to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talo...
...ar mycar = new car('eagle', 'talon tsi', 1993); this statement creates mycar and assigns it the specified values for its properties. then the value of mycar.make is the string "eagle", mycar.year is the integer 1993, and so on. you can create any number of car objects by calls to new. ...
new.target - JavaScript
d with new" foo() // throws "foo() must be called with new" new.target in constructors in class constructors, new.target refers to the constructor that was directly invoked by new. this is also the case if the constructor is in a parent class and was delegated from a child constructor. ...
... directly invoked by new. this is also the case if the constructor is in a parent class and was delegated from a child constructor. class a { constructor() { console.log(new.target.name) } } class b extends a { constructor() { super() } } let a = new a() // logs "a" let b = new b() // logs "b" class c { constructor() { console.log(new.target) } } class d extends c { constructor() { super() } } let c = new c() // logs class c{constructor(){console.log(new.target);}} let d = new d() // logs class d extends c{constructor(){super();}} thus from the above example of class c and d, it seems that new.target points to the class definition of class which is initialized. for example, when d was initialized using new d(), the class definition of d was printed; and similarly, in case ...
this - JavaScript
execution context, it remains as undefined, as shown in the following example: function f2() { 'use strict'; // see strict mode return this; } f2() === undefined; // true in the second example, this should be undefined, because f2 was called directly and not as a method or property of an object (e.g. window.f2()). this feature wasn't implemented in some browsers when they first started to support strict mode. as a result, they incorrectly returned the window object. to set the value of this to a particular value when calling a function, use call(), or apply() as in the examples below. class context the behavior of this in classes and functions is similar, since classes are functions under the hood. but there are some differences and caveats. within a class constructor, this is a r...
...st proto = object.getprototypeof(this); console.log(object.getownpropertynames(proto)); } first(){} second(){} static third(){} } new example(); // ['constructor', 'first', 'second'] note: static methods are not properties of this. they are properties of the class itself. derived classes unlike base class constructors, derived constructors have no initial this binding. calling super() creates a this binding within the constructor and essentially has the effect of evaluating the following line of code, where base is the inherited class: this = new base(); warning: referring to this before calling super() will throw an error. derived classes must not return before calling super(), unless they return an object or have no constructor at all. class base {} class good exte...
class - JavaScript
x class name [extends othername] { // class body } description the class body of a class declaration is executed in strict mode. the constructor method is optional. class declarations are not hoisted (unlike function declarations). examples a simple class declaration in the following example, we first define a class named polygon, then extend it to create a class named square. ...
...ine a class named polygon, then extend it to create a class named square. note that super(), used in the constructor, can only be used in constructors, and must be called before the this keyword can be used. class polygon { constructor(height, width) { this.name = 'polygon'; this.height = height; this.width = width; } } class square extends polygon { constructor(length) { super(length, length); this.name = 'square'; } } attempting to declare a class twice re-declaring a class using the class declaration throws a syntaxerror. class foo {}; class foo {}; // uncaught syntaxerror: identifier 'foo' has already been declared the same error is thrown when a class has been defined before using the class expression. let foo = class {}; class foo {}; // uncaught syn...
JavaScript
javascript (js) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. while it is most well-known as the scripting language for web pages, many non-browser environments also use it, such as node.js, apache couchdb and adobe acrobat. javascript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. ...
...nted, imperative, and declarative (e.g. functional programming) styles. read more about javascript. this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host environments. for information about api specifics to web pages, please see web apis and dom. the standard for javascript is ecmascript. as of 2012, all modern browsers fully support ecmascript 5.1. older browsers support at least ecmascript 3. on june 17, 2015, ecma international published the sixth major version of ecmascript, which is officially called ecmascript 2015, and was initially referred to as ecmascript 6 or es6. since then, ecmascript standards are on yearly release cycles. this documentation refers to the latest draft version, which is currently ecmascript 2...
orientation - Web app manifests
note: the orientation can be changed at runtime via the screen orientation api. ...
... note: the orientation can be changed at runtime via the screen orientation api. ...
MathML attribute reference - MathML
which varies in typography. maxsize <mo> the maximum size of the operator. unimplemented minlabelspacing <mtable> a length value specifing the minimum space between a label and the adjacent cell in the row. minsize <mo> the minimum size of the operator. movablelimits <mo> specifies whether attached under- and overscripts move to sub- and superscript positions. notation <menclose> a list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribut...
...mplemented side <mtable> specifies the position where <mlabeledtr> label elements should be placed. unimplemented src <mglyph> the location of the image resource. unimplemented stackalign <mstack> stretchy <mo> specifies whether the operator stretches to the size of the adjacent element. subscriptshift <mmultiscripts>, <msub>, <msubsup> the minimum space by which to shift the subscript below the baseline of the expression. supscriptshift <mmultiscripts>, <msup>, <msubsup> the minimum space by which to shift the superscript above the baseline of the expression. symmetric <mo> if stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary m...
MathML documentation index - MathML
Web › MathML › Index
14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml, mathml reference, mathml:element the mathml <mglyph> element is used to display non-standard symbols where existing unicode characters are not available. it may be used within token elemen...
...a the mathml <mstyle> element is used change the style of its children. it accepts all attributes of all mathml presentation elements with some exceptions and additional attributes listed below. 31 <msub> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <msub> element is used to attach a subscript to an expression. 32 <msubsup> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <msubsup> element is used to attach both a subscript and a superscript, together, to an expression. 33 <msup> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <msup> element is used to attach a superscript to an expression. 34 <mtabl...
Digital audio concepts - Web media technologies
odecs use some form of lossy compression, because of the better compression ratio those algorithms offer. whereas lossless compression algorithms usually manage no better than a 40-50% of the size of the original, uncompressed sound data, modern lossy compression algorithms can reduce the size of the audio to between 5-20% of the original size, depending on the complexity of the audio. the vastly superior compression ratios possible with lossy compression usually make it a compelling choice, and adequate or excellent audio quality is possible with well-chosen codec configurations. researchers are continuing to devise better ways to analyze and compress audio, so new formats come out periodically that offer various improvements, either in compression ratio or audio fidelity (or both). use ca...
... will be higher. audio frequency bandwidth some codecs allow you to configure the audio frequency bandwidth directly, either by specifying the range of frequencies to allow, by establishing upper and/or lower frequency limits, or by specifying an audio source type that determines how to configure the algorithm based on the expected frequency use of the incoming signal. in addition, some codecs support special limited frequency bandwidth channels, such as the lfe channel, which inherently limit the frequency range available. in the case of lfe, the audio frequency bandwidth is limited to a frequency range suitable for use by a subwoofer or similar audio experience enhancement device. some codecs offer special profiles which are specifically intended for particular usage scenarios, such as ...
Guide to streaming audio and video - Web media technologies
dia, your server, and the options 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 optimize performance. https live streaming https live streaming (hls) is a protocol developed by apple and supported by safari on all of their platforms. hls may also be supported in other environments, although in some cases this support is conditional. 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 assumption being incorrect. the desktop vers...
... hls uses playlists to allow the user to not only select the media to stream, but also to choose among versions or forms of the same media. for example, hls lets the server stream a video with multiple audio streams which the user can choose from, in order to hear their own language. ...
Using images in HTML - Web media technologies
Web › Media › images
ed images into an html document, while the <picture> element enables responsive images. in this guide you'll find links to resources that deal with adding images to websites. references these articles cover some of the html elements and css properties that are used to control how images are displayed on the web. html <img> the html <img> element is used to embed an image in a webpage. it supports a wide range of attributes that control how the image behaves and allows you to add important information like alt text for people who don't see the image. <picture> the html <picture> element contains zero or more <source> elements and one <img> element which provides versions of an image for different display/device scenarios. the browser considers each child <source> element and chooses...
...element's box. areas of the box which aren't covered by the replaced element's object will show the element's background. background-image the background-image css property sets one or more background images for an element. guides these articles provide guidance on selecting and configuring image types. image file type and format guide a guide to the various image file types commonly supported by web browsers including details about their individual use cases, capabilities, and compatibility factors. additionally, this article provides guidance for selecting the best image file type for a given situation. mapping the width and height attributes of media container elements to their aspect-ratio this changes how browsers load images so their aspect ratios are calculated by the br...
Web Performance
rmance apis performance api this guide describes how to use the performance interfaces that are defined in the high-resolution time standard. resource timing api resource loading and timing the loading of those resources, including managing the resource buffer and coping with cors the performance timeline the performance timeline standard defines extensions to the performance interface to support client-side latency measurements within applications. together, these interfaces can be used to help identify an application's performance bottlenecks. user timing api create application specific timestamps using the user timing api's "mark" and "measure" entry types - that are part of the browser's performance timeline. frame timing api the performanceframetiming interface provides frame...
...terfall and flame charts in other performance tools. alternative media formats when it comes to images and videos, there are more formats than you're likely aware of. some of these formats can take your highly optimized media-rich pages even further by offering additional reductions in file size. in this guide we'll discuss some alternative media formats, how to use them responsibly so that non-supporting browsers don't get left out in the cold, and some advanced guidance on transcoding your existing assets to them. analyzing javascript bundles no doubt, javascript is a big part of modern web development. while you should always strive to reduce the amount of javascript you use in your applications, it can be difficult to know where to start. in this guide, we'll show you how to analyze y...
Progressive web app structure - Progressive web apps (PWAs)
itself. why should i use it? this architecture allows a website to benefit the most from all the pwa features — it caches the app shell and manages the dynamic content in a way that greatly improves the performance. in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement. the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web. being linkable, progressive and responsive by design it's important to remember the pwa advantages and keep them in mind when designing the application. the app shell approach allows websites...
...ws websites to be: linkable: even though it behaves like a native app, it is still a website — you can click on the links within the page and send a url to someone if you want to share it. progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available. for example, an offline mode with the help of service workers is just an extra trait that makes the website experience better, but it's still perfectly usable without it. responsive: responsive web design also applies to progressive web apps, as both are mainly for mobile devices. there are so many varied devices with browsers — it's important to prepare your website so i...
Installing and uninstalling web apps - Progressive web apps (PWAs)
rtable and convenient than a typical web site. by reducing the user experience differential between the web app and native apps on the user's device, you reduce both the loss of any muscle memory they have revolving around the native interface of the device and the sensation of "something isn't quite right" that users can experience when switching between native and web-based apps. what browsers support installation? installation is supported by chrome for android and android webview version 31 and later, opera for android 32 onward, samsung internet from version 4 onward, and firefox for android version 58 and later. safari on ios is a little different. some parts of the pwa ecosystem are supported, while others are not. ios 13 introduced a much more comparable install experience, which i...
...e screen. note: you can find out a lot more about chrome install banners from the article web app install banners. if you choose not to add it to your home screen at this point, you can do so later using the "add to home screen" icon in the main chrome menu. safari for ios / iphoneos / ipados on apple's ios (including iphoneos and ipados), the safari browser built into the device has some support for web applications, including support for the add to home screen feature. to add a web app to the home screen (also known as the launcher or springboard), tap the sharing button () at the bottom of the screen: this calls up the sharing panel. among the options should be the "add to home screen" option, unless it's been specifically removed from the list by the user editing the optons dis...
Progressive loading - Progressive web apps (PWAs)
the function passed as a parameter is handling the case when one or more items are intersecting with the observer (i.e. is appearing inside the viewport). we can iterate over each case and react accordingly — when an image is visible, we load the correct image and stop observing it as we no longer need to observe it. let's reiterate our earlier ment...
...more items are intersecting with the observer (i.e. is appearing inside the viewport). we can iterate over each case and react accordingly — when an image is visible, we load the correct image and stop observing it as we no longer need to observe it. let's reiterate our earlier mention of progressive enhancement — the code is written so that the app will work whether intersection observer is supported or not. if it's not, we just load the images using the more basic approach covered earlier. improvements remember that there are many ways to optimize loading times, and this example is exploring only one of the approaches. you could try to make your apps more bulletproof by making them work without javascript — either using <noscript> to show the image with final src already assigned, ...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
ed than notifications — we need to subscribe to a server that will then send the data back to the app. the app's service worker will receive data from the push server, which can then be shown using the notifications system, or another mechanism if desired. the technology is still at a very early stage — some working examples use the google cloud messaging platform, but are being rewritten to support vapid (voluntary application identification), which offers an extra layer of security for your app. you can examine the service workers cookbook examples, try to set up a push messaging server using firebase, or build your own server (using node.js for example). as mentioned before, to be able to receive push messages, you have to have a service worker, the basics of which are already explai...
...hen return the subscription object and move to the subscription part. if not, we initialize a new subscription: const response = await fetch('./vapidpublickey'); const vapidpublickey = await response.text(); const convertedvapidkey = urlbase64touint8array(vapidpublickey); the app fetches the server's public key and converts the response to text; then it needs to be converted to a uint8array (to support chrome). to learn more about vapid keys you can read the sending vapid identified webpush notifications via mozilla’s push service blog post. the app can now use the pushmanager to subscribe the new user. there are two options passed to the pushmanager.subscribe() method — the first is uservisibleonly: true, which means all the notifications sent to the user will be visible to them, and ...
Graphic design for responsive sites - Progressive web apps (PWAs)
en those graphics and layouts need to adapt to different displays! this is why we have included an entire docs section covering each of these topics (the one you are currently in, and app layout.) in addition, these days there are so many more technologies to choose from than your humble bmps, jpgs, gifs and pngs. but what should you choose? this really depends on what target devices you have to support, how complex the graphics need to be, and how much interactivity your graphics require. serving images selectively via css in general, you will use mostly the same graphical assets for different layouts in a responsive design, but you may well include slightly different ones dependant on context. for example, if your desktop layout includes a large header graphic and several programmatic gr...
...vailable such as font awesome. interactive images if your images need to feature some level of interactivity, such as links, other clickable areas, or animation, there are a number of options available. css as well as adding programmatic graphical effects to links (and anywhere else you might want them), css3 also allows you to write declarative animations and transitions. these may not be supported in older browsers like ie6-8, but they generally degrade gracefully, are fairly easy to write, and become much more flexible and powerful when combined with javascript and other technologies. javascript javascript has functions that enable developers to create animations, and any other type of interactivity you want. it is very powerful when combined with other technologies, although its ...
SVG Event Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Events
the global event attributes are available on all svg elements. ...
... the global event attributes are available on all svg elements. ...
baseline-shift - SVG: Scalable Vector Graphics
the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. the shifted object might be a sub- or superscript. note: as a presentation attribute baseline-shift can be used as a css property. note: this property is going to be deprecated and authors are advised to use vertical-align instead. ...
...: as a presentation attribute baseline-shift can be used as a css property. note: this property is going to be deprecated and authors are advised to use vertical-align instead. as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts. super the dominant-baseline is shifted to the default position for superscripts. <length-percentage> a length value raises (positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified length. a...
calcMode - SVG: Scalable Vector Graphics
for strings), the calcmode attribute is ignored and discrete interpolation is used. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value discrete | linear | paced | spline default value linear animatable no discrete this specifies that the animation function will jump from one value to the next without any interpolation. ...
... animatable no discrete this specifies that the animation function will jump from one value to the next without any interpolation. linear simple linear interpolation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. paced defines interpolation to produce an even pace of change across the animation. this is only supported for values that define a linear numeric range, and for which some notion of "distance" between points can be calculated (e.g. position, width, height, etc.). if paced is specified, any keytimes or keysplines will be ignored. for <animatemotion>, this is the default value. spline interpolates from one value in the values list to the next according to a time function defined by a cubic béz...
string - SVG: Scalable Vector Graphics
Web › SVG › Attribute › string
the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. ...
... the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. ...
transform - SVG: Scalable Vector Graphics
rm for the specific syntax to use in that case. as a presentation attribute, transform can be used by any element (in svg 1.1, only these 16 elements were allowed to use it: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <switch>, <text>, and <use>). also, as a legacy from svg 1.1, <lineargradient> and <radialgradient> support the gradienttransform attribute, and <pattern> supports the patterntransform attribute, both of which act exactly like the transform attribute. value <transform-list> default value none animatable yes transform functions the following transform functions can be used by the transform attribute <transform-list> warning: as per the spec, you should b...
...0" cy="0" r="10" fill="yellow" transform="scale(1,4)" /> <!-- horizontal scale --> <circle cx="0" cy="0" r="10" fill="pink" transform="scale(4,1)" /> <!-- no scale --> <circle cx="0" cy="0" r="10" fill="black" /> </svg> rotate the rotate(<a> [<x> <y>]) transform function specifies a rotation by a degrees about a given point. if optional parameters x and y are not supplied, the rotation is about the origin of the current user coordinate system. if optional parameters x and y are supplied, the rotation is about the point (x, y). example html,body,svg { height:100% } <svg viewbox="-12 -2 34 14" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="10" height="10" /> <!-- rotation is done around the point 0,0 --> <rect x="0" y="0" width="10" h...
Content type - SVG: Scalable Vector Graphics
00.5s = 500 milliseconds 00:00.005 = 5 milliseconds color <color> the basic type <color> is a css2 compatible specification for a color in the srgb color space. <color> applies to svg's use of the color attribute and is a component of the definitions of attributes fill, stroke, stop-color, flood-color, and lighting-color, which also offer optional icc-based color specifications. svg supports all of the syntax alternatives for <color> defined in css2 syntax and basic data types, and (depend on the implementation) in the future css color module level 3. a <color> is either a keyword or a numerical rgb specification. in addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's environment. the normative definition o...
..., both absolute and relative, to other objects. for example, to fill a rectangle with a linear gradient, you first define a <lineargradient> element and give it an id, as in: <lineargradient xml:id="mygradient">...</lineargradient> you then reference the linear gradient as the value of the fill attribute for the rectangle, as in the following example: <rect fill="url(#mygradient)"/> svg supports two types of iri references: local iri references, where the iri reference does not contain an <absoluteiri> or <relativeiri> and thus only contains a fragment identifier (i.e., #<elementid> or #xpointer(id<elementid>)). non-local iri references, where the iri reference does contain an <absoluteiri> or <relativeiri>. for the full specification of iri references in svg, see svg 1.1...
<glyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › glyph
vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface. ...
.../tr/svg/fonts.html#glyphelement --> <defs> <font id="font1" horiz-adv-x="1000"> <font-face font-family="super sans" font-weight="bold" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500"> <font-face-src> <font-face-name name="super sans bold"/> </font-face-src> </font-face> <missing-glyph><path d="m0,0h200v200h-200z"/></missing-glyph> <glyph unicode="!" horiz-adv-x="80" d="m0,0h200v200h-200z"></glyph> <glyph unicode="@" d="m0,50l100,300l400,100z"></glyph> </font> </defs> <text x="100" y="100" style="font-family: 'super sans', helvetica, sans-serif; font-weight: b...
SVG as an Image - SVG: Scalable Vector Graphics
external resources (e.g. images, stylesheets) cannot be loaded, though they can be used if inlined through data: uris. ...
... external resources (e.g. images, stylesheets) cannot be loaded, though they can be used if inlined through data: uris. ...
Same-origin policy - Web security
in policy: trust zones if both domains are in the highly trusted zone (e.g. corporate intranet domains), then the same-origin limitations are not applied. port ie doesn't include port into same-origin checks. therefore, https://company.com:81/index.html and https://company.com/index.html are considered the same origin and no restrictions are applied. these exceptions are nonstandard and unsupported in any other browser. changing origin a page may change its own origin, with some limitations. a script can set the value of document.domain to its current domain or a superdomain of its current domain. if set to a superdomain of the current domain, the shorter superdomain is used for same-origin checks. for example, assume a script from the document at http://store.company.com/dir/other...
...executes the following: document.domain = "company.com"; afterward, the page can pass the same-origin check with http://company.com/dir/page.html (assuming http://company.com/dir/page.html sets its document.domain to "company.com" to indicate that it wishes to allow that - see document.domain for more). however, company.com could not set document.domain to othercompany.com, since that is not a superdomain of company.com. the port number is checked separately by the browser. any call to document.domain, including document.domain = document.domain, causes the port number to be overwritten with null. therefore, one cannot make company.com:8080 talk to company.com by only setting document.domain = "company.com" in the first. it has to be set in both so their port numbers are both null. note...
Tutorials
imple webpage and publish your own simple code. html tutorials introductory level introduction to html this module sets the stage, getting you used to important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage. mdn html element reference a comprehensive reference for html elements, and how the different browsers support them. creating a simple web page with html an html guide for beginners that includes explanations of common tags, including html5 tags. also includes a step-by-step guide to creating a basic web page with code examples. html challenges use these challenges to hone your html skills (for example, "should i use an <h2> element or a <strong> element?"), focusing on meaningful markup. ...
...e. now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. we have covered the necessary prerequisites so can now dive deep into css layout, looking at different display settings, traditional layout methods involving float and positioning, and new fangled layout tools like flexbox. css reference complete reference to css, with details on support by firefox and other browsers. fluid grids design layouts that fluidly resize with the browser window, while still using a typographic grid. css challenges flex your css skills, and see where you need more practice. advanced level using css transforms apply rotation, skewing, scaling, and translation using css. css transitions css transitions, part of the draft css3 spec...
Using shadow DOM - Web Components
onents is encapsulation — being able to keep the markup structure, style, and behavior hidden and separate from other code on the page so that different parts do not clash, and the code can be kept nice and clean. the shadow dom api is a key part of this, providing a way to attach a hidden separated dom to an element. this article covers the basics of using the shadow dom. note: shadow dom is supported by default in firefox (63 and onwards), chrome, opera, and safari. the new chromium-based edge (75 and onwards) supports it too; the old edge didn't. high-level view this article assumes you are already familiar with the concept of the dom (document object model) — a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup ...
...see a live example also). this takes an image icon and a text string, and embeds the icon into the page. when the icon is focused, it displays the text in a pop up information box to provide further in-context information. to begin with, in our javascript file we define a class called popupinfo, which extends htmlelement: class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } inside the class definition we define the element's constructor, which defines all the functionality the element will have when an instance of it is instantiated. creating the shadow root we first attach a shadow root to the custom element: // create a shadow root let shadow = this.attachshadow({mod...
xml:base - XML: Extensible Markup Language
Web › XML › xml:base
the base url of a element can be queried from a script using node.baseuri. the base uri of an element is: the base uri specified by an xml:base attribute on the element, if one exists, otherwise the base uri of the element's parent element within the document entity or external entity, if one exists, otherwise the base uri of the document entity or external entity containing the element. support was removed from blink (chrome and opera) in 2015: chromium bug 341854 blink-dev mailing list post and from firefox 66 in bug 903372. use cases if you have an inline svg you use as icons that needs to work in a document with a html baseelement , you can reset the uri on your icon sprite by setting the xml:base. <html> <head> <base href="https://mydomain.com"> <style> .link { ...
...="412" dx="0" class="s9_999" >r</text> <style type="text/css"><![cdata[ @font-face { font-family: zapfdingbats_ghr; src: url("fonts/zapfdingbats_ghr.woff") format("woff"); } ]]></style> </svg> setting the xml:base on the svg element means you can inline the svg and thereby bypass cors issue while not changing the base uri for your entire document. work-arounds xml:base support in old browsers https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2 specifications specification status comment xml base (second edition) recommendation ...
Axes - XPath
Web › XPath › Axes
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are thirteen different axes in the xpath specification. an axis represents a relationship to the context node, and is used to locate nodes relative to that node on the tree. the following is an extremely brief description of the thirteen available axes and the degree of support available in gecko. for further information on using xpath expressions, please see the for further reading section at the end of transforming xml with xslt document. also see the 'axes' section in the xpath spec. ancestor indicates all the ancestors of the context node beginning with the parent node and traveling through to the root node. ancestor-or-self indicates the context node and all of its ancestors, in...
...e parent of an attribute node is an element node, but attribute nodes are not the children of their parents. following indicates all the nodes that appear after the context node, except any descendant, attribute, and namespace nodes. following-sibling indicates all the nodes that have the same parent as the context node and appear after the context node in the source document. namespace (not supported) indicates all the nodes that are in scope for the context node. in this case, the context node must be an element node. parent indicates the single node that is the parent of the context node. it can be abbreviated as two periods (..). preceding indicates all the nodes that precede the context node in the document except any ancestor, attribute and namespace nodes. preceding-sibling ...
boolean - XPath
...
... ...
ceiling - XPath
...
... ...
choose - XPath
...
... ...
concat - XPath
...
... ...
contains - XPath
...
... ...
count - XPath
Web › XPath › Functions › count
...
... ...
current - XPath
...
... ...
false - XPath
Web › XPath › Functions › false
...
... ...
floor - XPath
Web › XPath › Functions › floor
...
... ...
format-number - XPath
...
... ...
function-available - XPath
...
... ...
id - XPath
Web › XPath › Functions › id
...
... ...
lang - XPath
Web › XPath › Functions › lang
...
... ...
last - XPath
Web › XPath › Functions › last
...
... ...
local-name - XPath
...
... ...
namespace-uri - XPath
...
... ...
normalize-space - XPath
...
... ...
not - XPath
Web › XPath › Functions › not
...
... ...
round - XPath
Web › XPath › Functions › round
...
... ...
starts-with - XPath
...
... ...
string-length - XPath
...
... ...
sum - XPath
Web › XPath › Functions › sum
...
... ...
system-property - XPath
...
... ...
true - XPath
Web › XPath › Functions › true
...
... ...
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:call-template> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › choose
...
... ...
<xsl:comment> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › comment
...
... ...
<xsl:copy-of> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › copy-of
...
... ...
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › for-each
...
...f this element, sorting occurs before processing. otherwise, nodes are processed in document order. syntax <xsl:for-each select=expression> <xsl:sort> [optional] template </xsl:for-each> required attributes select uses an xpath expression to select nodes to be processed. optional attributes none. type instruction, appears within a template. defined xslt, section 8. gecko support supported. ...
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › include
...
... ...
<xsl:key> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › key
...
...ttributes name specifies a name for this key. must be a qname. match defines the nodes for which this key is applicable. use specifies an xpath expression that will be used to determine the value of the key for each of the applicable nodes. optional attributes none. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 12.2. gecko support supported. ...
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › output
pecifies the value of the version attribute of the xml or html declaration in the output document. this attribute is only used when method="html" or method="xml". encoding specifies the value of the encoding attribute in the output document. omit-xml-declaration indicates whether or not to include an xml declaration in the output. acceptable values are "yes" or "no". standalone (not supported.) if present, indicates that a standalone declaration should occur in the output document and gives its value. acceptable values are "yes" or "no". doctype-public specifies the value of the public attribute of the doctype declaration in the output document. doctype-system specifies the value of the system attribute of the doctype declaration in the output document. cdata-sect...
...es" or "no". doctype-public specifies the value of the public attribute of the doctype declaration in the output document. doctype-system specifies the value of the system attribute of the doctype declaration in the output document. cdata-section-elements lists elements whose text contents should be written as cdata sections. elements should be whitespace separated. indent (not supported.) specifies if the output should be indented to indicate its hierarchic structure. media-type (not supported.) specifies the output document mime type. type top-level, must be the child <xsl:stylesheet> or <xsl:transform>. defined xslt, section 16. gecko support partial support. see comments above. ...
<xsl:preserve-space> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:processing-instruction> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › sort
...
...cifies which language is to be used by the sort. data-type defines whether items are to be ordered alphabetically or numerically. the allowable values are "text" and "number" with "text" being the default. type subinstruction, always appears as a child of <xsl:for-each>, where it must appear before the template proper or of <xsl:apply-templates>. defined xslt, section10. gecko support supported. ...
<xsl:strip-space> - XSLT: Extensible Stylesheet Language Transformations
...
...cument for which whitespace should be removed. syntax <xsl:strip-space elements=list-of-element-names /> required attributes elements specifies a space-separated list of elements in the source whose whitespace-only text nodes should be removed. optional attributes none. type top-level, must be a child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 3.4 gecko support supported. ...
<xsl:transform> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
...
... ...
Index - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Index
n it. these are the same files used in the generating html example in the xslt in netscape gecko article. the xml file describes an article and the xsl file formats the information for display. 8 interface list needscontent, reference see xsltprocessor in the web api documentation section. 9 introduction gecko, intro, javascript, xslt with modern browsers supporting xslt, developers can now use javascript to access the power that xslt provides. javascript 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. since the xml data loaded only contains the raw information without any presentation data, it can load quickly even on dialup. 10 javascript/xslt bindings ...
...converting numbers into strings using theformat-number( ) function. 30 <xsl:element> element, reference, xslt the <xsl:element> element creates an element in the output document. 31 <xsl:fallback> element, reference, xslt, fallback the <xsl:fallback> element specifies what template to use if a given extension (or, eventually, newer version) element is not supported. 32 <xsl:for-each> element, reference, xslt, for, for-each the <xsl:for-each> element selects a set of nodes and processes each of them in the same way. it is often used to iterate through a set of nodes or to change the current node. if one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing. otherwise, nodes are process...
An Overview - XSLT: Extensible Stylesheet Language Transformations
nt that designates the elements so marked as belonging to the set of tags designated by the w3c in the 1999 xslt recommendation. another string that is occasionally seen in stylesheets, "http://www.w3.org/tr/wd-xsl", indicates compliance with an earlier working draft (hence the wd) of the w3c document. this latter namespace is not compatible with the one that the w3c eventually adopted and is not supported by netscape. because typing "http://www.w3.org/1999/xsl/transform" repeatedly would be tedious and would render the markup difficult to read, there is a standard mechanism for assigning a shorthand name to the namespace in the stylesheet heading. thus a full example of the opening stylesheet element might look like this. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" ...
...e. in essence, an xslt stylesheet is a set of rules, called templates, which declare that any node that matches this specific pattern should be manipulated in this specific way and end up in this specific position in the result tree. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are specified using xpath, another w3c recommendation. transformations depend on the processor's being able to pinpoint individual nodes on the tree. to facilitate this, the w3c decided to use a separate language, xpath, which also has uses outside the xslt context. as its name implies, xp...
Caching compiled WebAssembly modules - WebAssembly
caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. caching via indexeddb indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side. it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. ...
...o instantiate. an import object, if required. const wasmcacheversion = 1; instantiatecachedurl(wasmcacheversion, 'test.wasm').then(instance => console.log("instance says the answer is: " + instance.exports.answer()) ).catch(err => console.error("failure to instantiate: " + err) ); you can find the source code for this example on github as indexeddb-cache.html (see it live also). browser support at the moment, this technique will work in firefox and edge, as they both have support for structured cloning of webassembly modules. chrome has support implemented behind the webassembly structured cloning support flag, but is yet to turn it on by default because of some concerns (see this discussion, for example). safari is still yet to implement. ...
Navigator.mozNotification - Archive of obsolete content
mobile only in gecko 2.0 available only in firefox mobile as of gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) provides support for creating notification objects, which are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. the support for this property as been dropped in favor of the standard notification constructor. method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url. notification createnotification( in domstring t...
Navigator - Archive of obsolete content
features that used to hang off the navigator interface, but have since been removed. navigator.moznotificationprovides support for creating notification objects, which are used to display desktop notification alerts to the user. currently, these are only supported on firefox mobile and firefox os. see displaying notifications for an example. ...
Reddit Example - Archive of obsolete content
finally, it registers a listener to the user-defined click event which in turn passes the url into the open function of the tabs module. this is the panel.js content script that intercepts link clicks: $(window).click(function (event) { var t = e...
Communicating using "port" - Archive of obsolete content
annel of communication to its content scripts. but some modules, such as page-mod, might need to handle multiple pages, each with its own context in which the content scripts are executing, so it needs a separate channel (worker) for each page. so page-mod does not integrate the worker api directly: instead, each time a content script is attached to a page, the worker associated with the page is supplied to the page-mod in its onattach function. by supplying a target for this function in the page-mod's constructor you can register to receive messages from the content script, and take a reference to the worker so as to emit messages to the content script. var pagemodscript = "window.addeventlistener('click', function(event) {" + " self.port.emit('click', event.target.tos...
Modules - Archive of obsolete content
a module is a self-contained unit of code, which is usually stored in a file, and has a well defined interface. the use of modules greatly improves the maintainability of code, by splitting it up into independent components, and enforcing logical boundaries between them. unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. we will show how to do each of these things using the built-in components object provided by xulrunner application such as firefox and thunderbird. to improve encapsulation, each module should be defined in the scope of its own global object. this is made possible by the use of sandboxes. each sandbox lives in its own compa...
Module structure of the SDK - Archive of obsolete content
te or use when developing add-ons using the sdk is part of a commonjs module, including: sdk modules: the javascript modules which the sdk provides, such as panel and page-mod. local modules: each of the javascript files under your add-on's "lib" directory. external modules: reusable modules developed and maintained outside the sdk, but usable by sdk-based add-ons. sdk modules the modules supplied by the sdk are divided into two sorts: high-level modules like panel and page-mod provide relatively simple, stable apis for the most common add-on development tasks. low-level modules like heritage and namespace provide more powerful functionality, and are typically less stable and more complex. to use sdk modules, you can pass require() a complete path, starting with "sdk", to the mo...
Guides - Archive of obsolete content
bout the built-in sdk module loader, known as cuddlefish. classes and inheritance learn how classes and inheritance can be implemented in javascript, using constructors and prototypes, and about the helper functions provided by the sdk to simplify this. private properties learn how private properties can be implemented in javascript using prefixes, closures, and weakmaps, and how the sdk supports private properties by using namespaces (which are a generalization of weakmaps). content processes the sdk was designed to work in an environment where the code to manipulate web content runs in a different process from the main add-on code. this article highlights the main features of that design. testing the add-on sdk learn how to run the add-on sdk test suites. sdk infrastructur...
addon-page - Archive of obsolete content
note: this module has no effect on fennec. for pages like this, navigational elements such as the awesome bar, search bar, or bookmarks toolbar are not usually relevant and distract from the content you are presenting. the addon-page module provides a simple way to have a page which excludes these elements. ...
hotkeys - Archive of obsolete content
is executed only on the last one created. parameters options : object required options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key. these are the possible modifiers you can supply: shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. accel: the key used for keyboard sho...
selection - Archive of obsolete content
by iterating over the selection module itself. each iteration yields a selection object from which text, html, and iscontiguous properties can be accessed. private windows if your add-on has not opted into private browsing, then you won't see any selections made in tabs that are hosted by private browser windows. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. examples log the current contiguous selection as text: var selection = require("sdk/selection"); if (selection.text) console.log(selection.text); log the current discontiguous selections as html: var selection = require("sdk/selection"); if (!selection.iscontiguous) { for (var subselection in selection) { ...
self - Archive of obsolete content
short name. it comes from the name property in the main package's package.json file. version this property contains the add-on's version string. it comes from the version property set in the package.json file in the main package. loadreason this property contains of the following strings describing the reason your add-on was loaded: install enable startup upgrade downgrade isprivatebrowsingsupported this property indicates whether or not the add-on supports private browsing. it comes from the private-browsing key in the add-on's package.json file. data the data object is used to access data that was bundled with the add-on. this data lives in the add-on's data/ directory, immediately below the package.json file. all files in this directory will be copied into the xpi and made availa...
content/loader - Archive of obsolete content
es 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 scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-worker, use the symbiont module instead. symbiont inherits from loader but contains its own frame into which it loads content supplied as the contenturl option. example: the following code creates a wrapper on a hidden frame that reloads a web page in the frame every time the contenturl property is changed: var hiddenframes = require("sdk/frame/hidden-frame"); var { loader } = require("sdk/content/content"); var pageloader = loader.compose({ constructor: function pageloader(options) { options = options || {}; i...
core/promise - Archive of obsolete content
d.reject); return deferred.promise; } var tweets = readasync(url); timeout(tweets, 20).then(function(data) { ui.display(data); }, function() { alert('network is being too slow, try again later'); }); alternative promise apis there may be cases where you will want to provide more than just then method on your promises. in fact some other promise frameworks do that. such use cases are also supported. earlier described defer may be passed optional prototype argument, in order to make the returned promise and all the subsequent promises decendents of that prototype: let { promise, resolve } = defer({ get: function get(name) { return this.then(function(value) { return value[name]; }); } }); promise.get('foo').get('bar').then(console.log); resolve({ foo: { bar: 'taram !
event/core - Archive of obsolete content
type, listener) registers an event listener that is called only once: the next time an event of the specified type is emitted on the given event target. parameters target : object event target object. type : string the type of event. listener : function the listener function that processes the event. emit(target, type, message, arguments) execute each of the listeners in order with the supplied arguments. all the exceptions that are thrown by listeners during the emit are caught and can be handled by listeners of 'error' event. thrown exceptions are passed as an argument to an 'error' event listener. if no 'error' listener is registered exception will be logged into an error console. parameters target : object event target object. type : string the type of event. message : ob...
io/file - Archive of obsolete content
to hardcode windows-style paths, be sure to escape backslashes in strings. for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk". read more about escaping characters in strings. globals functions basename(path) the path parameter must be an absolute path, relative paths will cause an error. use the fs/path module for relative path support. returns the last component of the given path. for example, basename("/foo/bar/baz") returns "baz". if the path has no components, the empty string is returned. parameters path : string the path of a file. returns string : the last component of the given path. dirname(path) returns the path of the directory containing the given file. if the file is at the top of the volume, the empty...
loader/sandbox - Archive of obsolete content
if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line. evaluate(scope, 'a ++', 'http://foo.com/bar.js', 2); version of javascript can be also specified via an optional argument: evaluate(scope, 'let b = 2;', 'bar.js', 1, '1.5'); // throws cause `let` is not defined in js 1.5. load scripts this module provides a limited api for loading scripts from local urls. data: urls are supported. load(scope, 'resource://path/to/my/script.js'); load(scope, 'file:///path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source. parameters source : string|window|null an object that determines the privileges that will be given to the sandbox. this argument can be: a uri string, giving the sandb...
places/bookmarks - Archive of obsolete content
ns) queries can be performed on bookmark items by passing in one or more query objects, each of which is given one or more properties. within each query object, the properties are and'd together: so only objects matching all properties are retrieved. across query objects, the results are or'd together, meaning that if an item matches any of the query objects, it will be retrieved. for example, suppose we called search() with two query objects: [{ url: "mozilla.org", tags: ["mobile"]}, { tags: ["firefox-os"]}] this will return: all bookmark items from mozilla.org that are also tagged "mobile" all bookmark items that are tagged "firefox-os" an options object may be used to determine overall settings such as sort order and how many objects should be returned. parameters queries : ob...
system/child_process - Archive of obsolete content
experimental an implementation of the node.js child_process api. this module enables you to execute a child program in a new process. since it emulates the node.js child_process api, it's not documented separately here. however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the environment variables from the parent process, by default. the sdk versions don't: so when you specify a command you must pass in a complete path to the command or use the env option to set up the child process environment. child.stdin has no write() method (see example below for writing to child process stdin) examples adaption of node's do...
tabs/utils - Archive of obsolete content
returns tabcontainer : gettabs(window) returns the tabs for the specified window. if you omit window, this function will return tabs across all the browser's windows. however, if your add-on has not opted into private browsing, then the function will exclude all tabs that are hosted by private browser windows. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. parameters window : nsiwindow optional. returns array : an array of tab elements. getactivetab(window) given a browser window, get the active, or selected, tab. parameters window : window a browser window. returns tab : the currently selected tab. getownerwindow(tab) get the browser window that owns th...
test/assert - Archive of obsolete content
optional error argument: to check that the exception thrown is of the expected type, pass a constructor function: the exception thrown must be an instance of the object returned by that function. ...
ui/sidebar - Archive of obsolete content
es a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. to show what a sidebar looks like, here's a sidebar that displays the results of running the w3c validator on the current page: specifying sidebar content the content of a sidebar is specified using html, which is loaded from the url supplied in the url option to the sidebar's constructor. unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a url constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") }); from firefox 34, you can use "./sidebar.ht...
util/uuid - Archive of obsolete content
otherwise a new nsid will be generated and returned. returns nsid : a uuid, represented as an nsid object. ...
Release notes - Archive of obsolete content
for require("sdk/self").data.url("my-file") added the ability to attach stylesheets to individual tabs. details github commits made between firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. bugs fixed between firefox 33 and firefox 34. this will not include any uplifts made after this release entered aurora. firefox 33 highlights added support for context menus in panels via a new option in the panel constructor. added tab.readystate. added a browserwindow parameter to sidebar.show() and sidebar.hide(), to control the window for which the sidebar will be shown or hidden. details github commits made between firefox 32 and firefox 33. this will not include any uplifts made after this release entered aurora. bugs fixed between f...
jpm-mobile - Archive of obsolete content
you can use jpm and jpm-mobile for firefox 38 and onwards. this article is the reference for jpm-mobile. the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). jpm usage is: jpm-mobile [command] [options] jpm supports the following global options: -h, --help - show a help message and exit -v, --version - print the jpm version number installation jpm-mobile is distributed using the node package manager npm, so to get jpm-mobile you need to have npm installed, if you haven't already. npm is included in node.js, so to install npm, visit nodejs.org and click the install button. after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you mi...
Tools - Archive of obsolete content
cfx to jpm a guide to working with jpm if you're already familiar with cfx. console enables your add-on to log error, warning or informational messages. jpm jpm is a command-line tool that enables you to test, run, and package add-ons. jpm-mobile the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). ...
Creating annotations - Archive of obsolete content
, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review. annotation editor panel so far we have a page-mod that can highlight elements and send information about them to the main add-on code. next we will create the editor panel, which enables the user to enter an annotation associated with the selected element. we will supply the panel's content as an html file, and will also supply a content script to execute in the panel's context. so create a subdirectory under data called editor. this will contain two files: the html content, and the content script. annotation editor html the html is very simple: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <...
Storing annotations - Archive of obsolete content
annotation is composed of the text the user entered and the "annotation anchor", which consists of the url, element id and element content: function handlenewannotation(annotationtext, anchor) { var newannotation = new annotation(annotationtext, anchor); simplestorage.storage.annotations.push(newannotation); } this function calls a constructor for an annotation object, which we also need to supply: function annotation(annotationtext, anchor) { this.annotationtext = annotationtext; this.url = anchor[0]; this.ancestorid = anchor[1]; this.anchortext = anchor[2]; } now we need to link this code to the annotation editor, so that when the user presses the return key in the editor, we create and store the new annotation: var annotationeditor = panels.panel({ width: 220, height: ...
Creating Event Targets - Archive of obsolete content
ttarget, which implements the interface for adding and removing listeners core/heritage gives us class(), which we can use to inherit from eventtarget util/object gives us merge(), which just simplifies setting up the bookmarkmanager's properties we use class to inherit from eventtarget. ...
Creating Reusable Modules - Archive of obsolete content
epicker.filterall | nsifilepicker.filtertext); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string. note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returned nsilocalfile... } return path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path. we can adapt it like this: var {cc, ci} = require("chrome"); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } f...
Getting Started (jpm) - Archive of obsolete content
ng started with cfx. the command-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a command prompt. install firefox developer version for testing your add-on. initializing an empty add-on in the command prompt, create a new directory. navigate to it, type jpm init, and hit enter: mkdir my-addon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. for now, just press enter to accept the default for each property. for more information on jpm init, see the jpm command reference. once you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to accept it. implementi...
Unit Testing - Archive of obsolete content
ing"] = function(assert) { assert.throws(function() { base64.atob(); }, "empty string check works"); } require("sdk/test").run(exports); note that with jpm we must give the exact relative path to the base64.js module. this file: exports three functions, each of which expects to receive a single argument which is an assert object. assert is supplied by the test/assert module and implements the commonjs unit testing specification. the first two functions call atob() and btoa() and use assert.ok() to check that the output is as expected. the second function tests the module's error-handling code by passing an empty string into atob() and using assert.throws() to check that the expected exception is raised. at this point yo...
Bootstrapped extensions - Archive of obsolete content
difying the application user interface chrome.manifest in bootstrapped add-ons you can use a chrome.manifest file in bootstrapped add-ons to: make your add-on's content available via a chrome:// url (using the content, locale, and skin instructions in the manifest). replace existing chrome:// uris with your content (using the override instruction). not all chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register xul overlays from a bootstrapped add-on. see the chrome.manifest documentation for details. in firefox 10 and later the chrome.manifest file located in the root of the add-on's xpi (i.e. a sibling of the install.rdf) is loaded automatically. in firefox 8 and 9 you had to load/unload the manifest manually using nsicomponentmanag...
Alerts and Notifications - Archive of obsolete content
n popup(title, text) { try { components.classes['@mozilla.org/alerts-service;1'] .getservice(components.interfaces.nsialertsservice) .showalertnotification(null, title, text, false, '', null); } catch(e) { // prevents runtime error on platforms that don't implement nsialertsservice } } if you need to display a comparable alert on a platform that doesn't support nsialertsservice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=no,popup=yes', nu...
Bookmarks - Archive of obsolete content
var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. // an nsinavbookmarkobserver var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onite...
Canvas code snippets - Archive of obsolete content
h', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', // drawfocusring not currently supported // the following might instead be wrapped to be able to chain their child objects 'createimagedata', 'createlineargradient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; var props = ['canvas', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', ...
File I/O - Archive of obsolete content
omponents.interfaces var file = services.dirsvc.get("profd", ci.nsifile); // append the file name. file.append("data.txt"); // note: "file" is an object that implements nsifile. if you want the // file system path, use file.path note: file is an object that implements nsifile. if you want the file system path, use file.path, . here are some of the special locations the directory service supports: (scope: d = product-wide, f = profile wide) string scope meaning achrom d %curprocd%/chrome aplugns d %curprocd%/plugins (deprecated - use aplugnsdl) aplugnsdl d comsd n/a %curprocd%/components curprocd n/a current working directory (usually the application's installation directory). ...
HTML to DOM - Archive of obsolete content
the code snippets on this page will let your site work until these new features are more widely available. safely parsing simple html to dom when using xmlhttprequest to get the html of a remote webpage, it is often advantageous to turn that html string into dom for easier manipulation. however, there are potential dangers involved in injecting remote content in a privileged context in your extension, so it can be desirable to parse the html safely. ...
Miscellaneous - Archive of obsolete content
s situation by providing a simple method to restart the application. example for firefox: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires. event.detail contains the number of lines to scroll. this event is mozilla-only; other browsers may support window.onmousewheel. <div id="scrollarea" style="overflow: scroll; height: 6em; width: 10em;"> this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area.
Running applications - Archive of obsolete content
ms from your chrome javascript code, using mozilla xpcom interfaces. there are two ways to run programs. using nsiprocess the recommended way is to use the nsiprocess interface because it is crossplatform. using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux! see nsilocalfile.launch() for details and make sure that all your target platforms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more information on nsifile/nsilocalfile, see file i/o. var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); file.initwithpath("c:\\myapp.exe"); file.la...
StringView - Archive of obsolete content
view.foreachchar(function callback, optional object thisobject, optional unsigned long characteroffset, optional unsigned long characterslength); domstring stringview.valueof(); domstring stringview.tostring(); properties overview attribute type description encoding read only domstring a string expressing the encoding type. for actually supported values see here. buffer read only arraybuffer the buffer to be shared between stringview.rawdata and stringview.bufferview view references. rawdata read only arraybufferview an arraybufferview containing the representation of the string as array of 8-bit, 16-bit, or 32-bit integers (depending on the chosen encoding). bufferview read only ...
XML-related code snippets - Archive of obsolete content
e4x ...
XPath - Archive of obsolete content
,returntype,result); //contextnode should be used in the one in which it was created //add by mooring 2008-11-15 16:00 china var xhr = new ajax('post','demo.xml',parsexml,'xml'); //ajax is a class written by javascript which return responsexml object to parsexml function function parsexml(obj)//obj is the returnxml object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return; } var fields = [];//store the results if(window.activexobject) { var tobj = obj.documentelement.selectnodes("/root/field/item"); for(var i=0;i<tobj.length; i++) { fields.push(tobj[i].text); } } else { var tobj = obj.evaluate("/root/field/item",obj.documentelement,null, xpathresult.any_type, null); var tmp = tobj.iteratenext(); while(tmp) {...
Communication between HTML and your extension - Archive of obsolete content
t was the something that i wanted the extension to find. there were only a handful of events that seemed relevant (load, change, dominsertnode, dominsertnodeintodocument, domactivate) and i tried them all in many different ways. some of the events only apply to certain types of elements so i included trying to modify the result of the ajax request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example). the problem with the events is the timing. i wasn't sure about the difference between the capture or bubbling flag that you pass to addeventlistener but every time i would catch the event in the extension, the element from the ajax request wasn't fully updated into the html page. what that meant is that everytime the extension went loo...
Deploying a Plugin as an Extension - Archive of obsolete content
kage plugins for multiple platforms into a single extension, you can do that as well. there are two ways to do this. first, you can simply put all the files in the plugins directory. firefox will load the correct plugins based on the platform, simply because the plugins for other platforms won't load. if your plugin is for windows, don't forget add to version resources to your plugin's dll. also, supply mimetype and fileextents, without these your plugin won't work. michael kaply firefox advocate mkaply@us.ibm.com ...
Developing add-ons - Archive of obsolete content
zilla based software display content they can't handle natively. jetpack browser extension development for everyone. jetpack developers only need to know the tools of the modern web: html, css, and javascript. themes themes let users customize the appearance of the user interface presented by mozilla-based applications. search engine plugins firefox supports search engine plugins, which enable the search box to support different search engines. addons.mozilla.org (amo) api developers' guide the amo developers' guide describes how to use the amo api to fetch information about add-ons from the addons.mozilla.org site. the mozilla platform information about the mozilla platform, including all of its apis and technologies, as wel...
Extension Packaging - Archive of obsolete content
ed. this can be accomplished on windows using the registry. multi-item extension xpis in some cases, a single xpi file may wish to install multiple extensions/themes. a special kind of extension xpi, called the multiple item package, explains how to create this kind of package. (firefox 1.5/xulrunner 1.8 required.) from the release of firefox 53, multiple item extension packages are no longer supported and will not load. as a consequence, these packages are no longer accepted by amo. official references for toolkit api structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information abo...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
h several properties on that object used to affect the install. url the url property specifies the url of the xpi to install. this property is required. iconurl the iconurl property specifies an icon to be displayed in the installation dialog. this property is optional. if you do not specify an icon, the default icon will be used, usually a green puzzle piece. the icon can be any image format supported by firefox, and should be 32x32 pixels in size. hash the hash property specifies a cryptographic hash of the xpi file contents. this is used to verify the downloaded file, to protect against a corrupted file being served by a mirror download server, for example. you can use any hash function supported by nsicryptohash. the hash is specified as hash function:hash value, for example, sha1:2...
Listening to events in Firefox extensions - Archive of obsolete content
page, the pagehide event from each frame fires before the pagehide event in the main document. for navigation that occurs inside a single frame, events fire only in the affected frame. web progress listeners for more information about web loads a web progress listener can be used; these provide more details about the progress of loading data from the web. both browser and tabbrowser elements support the following: var progresslistener = { // add nsiwebprogressimplementation here } b.addprogresslistener(progresslistener); where b is the browser or tabbrowser you want to listen to events for. there are code snippets available that give more detail on using web progress listeners. for a tabbrowser, the above code will only get events from the browser that is currently displayed at th...
Multiple item extension packaging - Archive of obsolete content
as a consequence, these packages are no longer accepted by amo. a multiple item package provides the ability to package multiple installable bundles which can then be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requirements as an extension except as noted below. there is currently no feature to prevent or warn the user when installing an older version of an extension. ...
Offering a context menu for form controls - Archive of obsolete content
...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
what does nsilocalfile.initwithpath do? what arguments does it take? how is nsilocalfile.initwithpath actually implemented? let’s examine these questions one at a time. what does this do? what arguments does it take? first we’ll search for the component’s definition. type interface nsilocalfile (with a trailing space) in the search field and go. nearly all components inherit from nsisupports (fixme: why 'nearly' ?), so adding a trailing space when you search serves as a delimiter on the inheritance position, and makes it easier to specify what you’re looking for (see figures 6, 7).4 this results in the file nsilocalfile.idl. let’s display it. every method includes explanatory comments. in initwithpath, the nsilocalfile object gets initialized, and any information already i...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
the html document by manipulating strings, but using the dom makes it possible to manipulate xml documents in a way that better matches javascript's object-oriented nature. in addition, xul lacks any equivalent for the innerhtml property, so if it weren’t for the dom, dynamic processing would be impossible. there are a number of levels to the dom with different levels of functionality. gecko supports nearly all of dom level 2 and some of dom level 3. with the dom, the contents of an xml document are handled as a "dom tree," a collection of element nodes and other nodes. listing 4 shows an example that deletes the second child element of the element with the "toolbar" id, adds a new button element as a substitute, and sets a label attribute. we do not go into the details of the various ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
ry depending on your system. on windows vista, it will be located at c:\users\username\appdata\roaming\mozilla\firefox\profiles\random number.default\ ; on windows xp or 2000, it will be c:\documents and settings\username\application data\mozilla\firefox\profiles\random number.default\ ; on linux, it will be ~/.mozilla/firefox/random number.default/ ; on mac os x, it will be ~/library/application support/firefox/profiles/random number.default/ in the interests of security, delete these lines from prefs.js after finishing these tests. note that firefox itself and its extensions have privileges set by default after installation and registration. extensions don't need special code like that in listing 2 in order to get privileges. fixme: we should advise against using such method fixme: figu...
Adding Events and Commands - Archive of obsolete content
en window xul and web page content. it isn't hard for xul code to control the content on pages being loaded or displayed, as we will see later on, but it can be hard for your extension xul code to receive information from pages in a secure manner. this is because it would be very insecure to have a website js controlling the behavior of firefox and running javascript code with chrome privileges. suppose your extension interacts with pages from a website, and you want some actions on this site to trigger actions in your extension. one way to solve this is to have the actions on the site to generate a custom event that can be easily recognized by your extension. you can capture the events in the xul overlay, since they'll bubble all the way up: // in the overlay code. document.addeventlisten...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
e and annoy users. use custom toolbar items sparingly. toolbar button icons creating the icons for toolbar buttons is one of the most difficult tasks when making extensions. it is not too hard to come up with some graphics for the buttons, but it can be hard to make them blend in with firefox on all operating systems. the way icons are handled in firefox changed considerably after firefox 4, so supporting older versions is not mentioned here (you can check this document's change history for older revisions, though). these are the current icon sets for firefox: windows mac os x (lion and above) mac os x linux (gnome) note: the images above are probably not distributable under the same cc license, unlike the rest of this material. here are the key similarities and differenc...
Adding windows and dialogs - Archive of obsolete content
nce user actions can change the state of your windows, such as selecting an option in a listbox, or entering text in a textbox. if the user closes and then reopens your window, all the controls are reset to their defaults, which may not be what you want. you need some way of remembering the user-manipulated attribute values so that the window reloads it last state when opened. most xul elements support the persist attribute, which has this exact function. you set the persist attribute with a space-separated list of attribute names, indicating which attribute values must be persisted across window "sessions". <checkbox id="xulschoolhello-some-checkbox" label="&xulschoolhello.sometext.label;" checked="false" persist="checked" /> setting the id attribute of the element is mandatory i...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
r to host your add-on with mozilla it is crucial to minimize or completely eliminate eval use in order to receive a positive review and have your add-on made public. if it cannot be easily proven that an eval() call is benign and necessary because there are no viable alternatives, a mozilla add-ons gallery reviewer will generally reject the submission! parsing json mozilla provides native json support since firefox 3. there is simply no need to parse json using eval. additionally, parsing json retrieved from a remote location becomes a security vulnerability when parsed with the eval function. basically, you are executing remote code with full chrome access; that is, introducing a remote code execution vulnerability. even if you trust the remote server; for example, because it is one you r...
Connecting to Remote Content - Archive of obsolete content
besides xml, it can be used to retrieve data in other formats, for example json, html and plain text. in this section we'll look into the xml and json communication mechanisms. ...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
14+ only. * @param {nsiuri} baseuri the base uri relative to which resource * urls should be processed. note that this will not work for * xml fragments. * @param {boolean} isxml if true, parse the fragment as xml. */ function parsehtml(doc, html, allowstyle, baseuri, isxml) { let parser_utils = "@mozilla.org/parserutils;1"; // user the newer nsiparserutils on versions that support it. if (parser_utils in cc) { let parser = cc[parser_utils] .getservice(ci.nsiparserutils); if ("parsefragment" in parser) return parser.parsefragment(html, allowstyle ? parser.sanitizerallowstyle : 0, !!isxml, baseuri, doc.documentelement); } return cc["@mozilla.org/feed-unescapeht...
Getting Started with Firefox Extensions - Archive of obsolete content
a nice alert message (for some definitions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-platform installer, because the same installer file can work on all platforms firefox supports. xpis are simply zip files, but firefox recognizes the xpi extension and triggers the installation process when an xpi file is loaded. to look into the xpi file you need to download it first, not install it. if the server triggers an install when clicking on a link or button, what you need to do is right click on the install link, and choose the save link as... option. decompress the xpi f...
Introduction - Archive of obsolete content
powerful outreach more commonly seen in less open companies. version 1.0 of firefox was released in november 2004, version 2.0 in october 2006, and version 3.0 in june 2008. this tutorial was written after firefox 3 was released, and has been updated with time. while most of it should still work for creating extensions in firefox 3 (and even firefox 2), it is strongly recommended that you aim to support modern firefox versions, to encourage users to stay up to date with security fixes. a release that is more than 6 months old is likely vulnerable to published security bugs. firefox and other mozilla applications can be seen as composed of two different parts: a user interface layer that is distinct for each project, and a common platform on top of which the interface layer is built. the use...
Local Storage - Archive of obsolete content
understand at least a little about rdf when you read the documentation about templates. templates templates are a very powerful tool in firefox. they allow you to automatically generate xul content using information from a datasource, and automatically update the content once the datasource changes. they were designed with rdf datasources in mind, but since firefox 3 they have been extended to support sqlite datasources as well. handling templates can also be complicated, but it is worth the effort if you need to display long lists or trees with complex data. if you manage to get your display code to use templates, you will have saved a lot of coding. since templates are not necessary for most extensions and they're a complicated subject, it's better that you read it from the experts. the...
Overlay extensions - Archive of obsolete content
umentation for the approach to developing extensions for gecko-based applications which uses: xul overlays to specify the interface apis available to privileged code, such as tabbrowser and javascript modules, to interact with the application and content. prior to firefox 4, and the gecko 2 engine that powers it, this was the only way to develop extensions. this methodology has largely been superseded by restartless extensions, and the add-on sdk, which is built on top of them. the privileged javascript apis described here can still be used in these newer types of add-ons. xul school xul school is a comprehensive add-on development tutorial, focusing on firefox extension development but mostly applicable to other gecko-based applications. more resources setting up your environme...
Session store API - Archive of obsolete content
session store makes it possible for extensions to easily save and restore data across firefox sessions. there is a simple api that lets extensions access the session store feature. one key scenario in which supporting this feature can be crucial for an extension: firefox 2 lets users undo the closing of tabs. in order to properly restore your extension's state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored. the session store api is implemented using the nsisessionstore interface. knowing when to restore each time firefox is about to restore a tab, an event of type sstabrestoring is sent. if your extension ...
Signing an XPI - Archive of obsolete content
ificate mozilla firefox will not confirm the validity of your certificate to users who want to install your extension. ideally you want a certificate that has a root ca installed in all major platforms (microsoft windows, sun java, mozilla/netscape firefox/navigator, opera) so you only use one certificate for signing all your software, no matter which platform it is for. the cheapest universally supported (mozilla, java, microsoft) certificate seems to be the comodo instant-ssl offering. you can get a free certificate for open-source developers from unizeto certum, in 2010 it is a certum level iii ca. here are some current issuers: comodo instant-ssl code signing digi-sign digi-code geotrust code signing thawte code signing (owned by verisign) unizeto certum code-signing (free certif...
Signing an extension - Archive of obsolete content
into the content area of firefox. on the installation dialog, you can see your organization name along with the file name. references signing a xpi - more detailed instructions including test procedures. key manager - a firefox extention that has the ability to sign xpi files. signing a firefox extension with a windows authenticode ssl certificate / key - note that some cas do not allow (or support) to divert an authenticode certificate to object signing. please check the terms of service. signing an executable with authenticode - for signing executable file (exe) ...
Tabbed browser - Archive of obsolete content
nts.interfaces.nsiloadcontext); } catch (ex) { try { loadcontext = asubject.loadgroup.notificationcallbacks.getinterface(components.interfaces.nsiloadcontext); //in ff26 asubject.loadgroup.notificationcallbacks was null for me, i couldnt find a situation where it wasnt null, but whenever this was null, and i knew a loadcontext is supposed to be there, i found that "interfacerequestor.getinterface(components.interfaces.nsiloadcontext);" worked fine, so im thinking in ff26 it doesnt use asubject.loadgroup.notificationcallbacks anymore, but im not sure } catch (ex2) { loadcontext = null; //this is a problem i dont know why it would get here } } ...
Firefox addons developer guide - Archive of obsolete content
es: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed via the xuldev.org website. so there may be still some reference to the xuldev website (we want to host source code on mdc, not on xuldev), and to japanese things (like some specific locales, which have been translated to french since non-latin characters are not well supported). there are a few things that could be done to make this fit the site better, and for general cleaning up: tables should use the "standard-table" css class so they're styled the same as those on the rest of mdc. there should be some introductory text on the table of contents page at https://developer.mozilla.org/en/firefox_addons_developer_guide obviously there are a number of fixme i...
Using Dependent Libraries In Extension Components - Archive of obsolete content
the basic strategy of the stub is to dynamically load the dependent libraries, then load the component library and continue registration. ...
Search Extension Tutorial (Draft) - Archive of obsolete content
change comes in two parts: 1) installing a new search engine (and removing it when your extension is disabled), and 2) setting it as a default (and restoring the previous default when your extension is uninstalled). adding a new search engine search engines may be added either directly via an api call, or indirectly via an xml description file. while the former is the simpler method, it does not support complex descriptions containing suggestion urls or separate keyword search urls. note: example uninstall code is only provided for restartless extensions. a separate tutorial exists for running code at uninstall in non-restartless extensions. an example bootstrap.js file illustrating the simple method follows: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // imp...
Adding preferences to an extension - Archive of obsolete content
extensions. second, we call nsiprefservice.getbranch(). this lets us specify a specific branch of the preference tree to access. by default, we would have access to all preferences, but we only want access to those belonging to our own extension, so we specify that we want to access the "extensions.stockwatcher2" branch. after getting the preference branch for our extension, we call the nsisupports.queryinterface() method on it to be able to use the methods of the nsiprefbranch2 interface. the next step is to register a preference observer by calling the addobserver() method to establish that whenever any events occur on the preferences, our object (this) receives notification. when events occur, such as a preference being altered, our observe() method will be called automatically. n...
XML data - Archive of obsolete content
n km\b2"; } depth { display: block; } depth:before { content: "mean depth: "; } depth:after { content: " m"; } open the document in your browser: oceans arctic area: 13,000 million km² mean depth: 1,200 m atlantic area: 87,000 million km² mean depth: 3,900 m . . . notes about this demonstration: the superscript 2 (in "million km²") a unicode character, coded as \b2 in the css file. the heading, "oceans", has a negative top margin, moving it up so it is displayed on top of the border. challenge change the stylesheet so that it displays the document as a table. (see the tables chapter in the css specification for examples that you can adapt.) what next? if you had di...
Case Sensitivity in class and id Names - Archive of obsolete content
nkle can affect your site design and best practices to avoid any problems. in the authoring of both css and javascript/dom (otherwise known as dhtml) routines, it is a near-certainty that class and id names will be used to identify elements. we have discovered, however, that many authors are running into trouble with class and id names because they're used to the bugs of browsers that don't fully support open standards. the most common case is where the name uses different case in the document source than is found in the css or javascript. for example, there might be this css: p.warning {color: red; background: yellow;} ...coupled with this html: <p class="warning">warning!</p> in netscape 6, the paragraph in question will have neither red text nor a yellow background. as far as netscape 6 ...
Events - Archive of obsolete content
archived event pages domsubtreemodifiedmozaudioavailablemozbeforeresizemozorientationcachedchargingchangechargingtimechangecheckingdischargingtimechangedownloadingerrorlevelchangenoupdateobsoleteprogressupdateready ...
JXON - Archive of obsolete content
name || "", odocumenttype || null); loadobjtree(onewdoc, onewdoc, oobjtree); return onewdoc; }; const svalprop = "keyvalue", sattrprop = "keyattributes", sattrspref = "@", /* you can customize these values */ acache = [], risnull = /^\s*$/, risbool = /^(?:true|false)$/i; })(); note: the current implementation of const (constant statement) is not part of ecmascript 5. it is supported in firefox & chrome (v8) and partially supported in opera 9+ and safari. it is not supported in internet explorer 6-9, or in the preview of internet explorer 10. const is going to be defined by ecmascript 6, but with different semantics. similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. if you want...
List of Former Mozilla-Based Applications - Archive of obsolete content
nd discontinued this product. ...
Localizing an extension - Archive of obsolete content
performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. ...
Environment variables affecting crash reporting - Archive of obsolete content
the following environment variables affect crash reporting: moz_crashreporter_url sets the url that the crash reporter will submit reports to. moz_crashreporter_fulldump store full application memory in the minidump, so you can open it in a microsoft debugger. don't submit it to the server. (windows only.) moz_crashreporter_no_delete_dump don't delete the crash report dump file after submitting it to the server. minidumps will still be moved to the "crash reports/pending" directory. moz_crashreporter_no_report save the minidump file but don't launch the crash reporting ui or send the report to the server. ...
Monitoring WiFi access points - Archive of obsolete content
p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, queryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getservice(components.interfaces.nsiwifimonitor); wifi_service.startwatching(listener); </script> </head> <body> <div id...
Visualizing an audio spectrum - Archive of obsolete content
fft size: " + buffersize + " buffer size: " + buffer.length; } for ( var i = 0; i < buffersize; i++ ) { real[i] = buffer[reversetable[i]]; imag[i] = 0; } var halfsize = 1, phaseshiftstepreal, phaseshiftstepimag, currentphaseshiftreal, currentphase...
Autodial for Windows NT - Archive of obsolete content
ally windows xp home users, don't understand that microsoft has changed how autodial works. to them it looks like mozilla is broken because windows doesn't try to dial when the feature is turned on in control panel | internet options | connections when they are using mozilla but it does when they are using internet explorer. "what's a system service" they might ask when told about how autodial is supposed to work now. the second part of this fix is for those users. we try to mimic the autodial system service if it is not running and the user has the autodial feature turned on in control panel | internet options | connections. if an address can't be reached, we trigger the autodial features from inside mozilla. if a default dialup connection is configured, we use that one. if more than one dia...
BlackConnect - Archive of obsolete content
for the remainders of the blackconnect project, see here. ...
Bookmark Keywords - Archive of obsolete content
ar. these searches can be as complex as google will tolerate, since the entered data will be converted to url-encoded text before it's sent to the google servers. thus we could type any of the following into the address bar and get back useful results: <tt>google geitost</tt> <tt>google mozilla keyword bookmark</tt> <tt>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples. instead of just throwing them away, we're providing them for you in the following table. even better, you can file them for future use by right-clicking (or holding down the control key and clicking on the link) and filing the bookmark...
Chromeless - Archive of obsolete content
script apis that provide them with deep desktop integration. one of the core capabilities of the chromeless platform is the ability to safely embed untrusted web applications inside these applications. chromeless vs prism/webrunner prism (an ex-mozilla labs project, now discontinued but kept going independently of mozilla under the [now discontinued] webrunner name) was/is a way to make web pages superficially appear to be native applications. firefox users could choose to turn a web page into a "prism application" and have an icon added to their desktop to launch it without the firefox user interface surrounding the page. however, prism "applications", being web pages, were subject to all the normal restrictions that browsers place on a web page. for example, prism applications could not rea...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
you have to add #include "nptypes.h" in top of plugin.h file. feel free to append here your issues fixes if the above guide helped you. ...
Creating a Firefox sidebar extension - Archive of obsolete content
</description> </em:targetapplication> </description> </rdf> the other manifest file is chrome.manifest, the chrome manifest file. the chrome manifest creates a lookup for all the resource types used by the extension. the manifest also tells firefox that the extension has an overlay that needs to be merged into the browser. for more information on chrome manifests and the properties they support, see the chrome manifest reference. the manifest used in this extension is listed in example 6. example 6. chrome.manifest content emptysidebar chrome/content/ locale emptysidebar en-us chrome/locale/ skin emptysidebar classic/1.0 chrome/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul test while you're developing your sidebar, you wil...
Creating a hybrid CD - Archive of obsolete content
many mozilla files have long file names which makes creating the cd on a macintosh difficult because the hfs filesystem limits the length of file names to 32 characters. the utility mkhybrid lets you create hybrid cds that work with all three filesystems. ...
Getting Started - Archive of obsolete content
to create now. take a screenshot of mozilla running your theme and create an image that is 438x89 pixels in size. place it in \myskin and call it preview.png (if it's a jpg or gif call it preview.jpg or preview.gif). make a copy of contents.rdf and place it in \myskin and open it up in your text editor. this file is a small xml database which is used to describe the skin. list all the skins being supplied by this theme <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> in the code search for the part listed above. change the blue part to whatever you want your theme called and then its version number. then scroll down to the next section. <rdf:description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" chrome:accesskey="m" ...
In-Depth - Archive of obsolete content
ton-send[disabled="true"] { -moz-image-region: rect(294px 92px 315px 69px) !important; } the properties for rect are listed in a clockwise fashion - top, right, bottom, left. adding an image to the right of a toolbar this tutorial is done with mozilla 1.2 in mind. the layout of files can and probably will change over time, but the basics should remain the same. by default, mozilla 1.2 doesn't support images on the right hand side of the toolbars, but that can be changed with some xbl hacking. place this xml file in \classic\skin\classic\communicator\toolbar\toolbarbindings.xml (you will need to create the sub directory). what this file does, is it takes the standard toolbar that is used in mozilla and adds an image to the one side of it. if you look at the modern skin, you'll notice that ...
contents.rdf - Archive of obsolete content
copy the following text and paste it into a text file, then save that file as "contents.rdf": <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the skins being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> </rdf:seq> <rdf:description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" chrome:accesskey="m" chrome:author="me" chrome:description="this is my custom skin for mozilla" chrome:name="myskin/1.0" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:myskin/1.0:packages"> <rdf:li resource=...
Creating regular expressions for a microsummary generator - Archive of obsolete content
a sequence of characters) that matches patterns of characters in other strings. microsummary generators use them to identify the pages that the generators know how to summarize by matching patterns in those pages' urls. in this tutorial, we'll explain how to make regular expressions that match the urls for ebay auction item pages. by the end of the tutorial, you should know some basics about regular expressions and understand how to create expressions that match urls. for detailed documentation about regular expressions, see core_javascript_1.5_reference:global_objects:regexp. ...
Dehydra Frequently Asked Questions - Archive of obsolete content
name dehydra come from? initially dehydra was written as an easy way to look for patterns in control flow graphs (cfgs). images of those graphs reminded me of the multiheaded hydra monster. thus de-hydra can be thought of as a decapitating tool for slaying cfgs. currently dehydra does not provide the cfg functionality, this functionality is now provided by treehydra. what is the status of gcc 4.5 support? development version of dehydra should work with gcc 4.5 on any c++ codebase. if you encounter bugs or crashes, report them. where does one report dehydra bugs? use this link to file bugs. for crashes reports attach a minimized input file. use either a source files that rely on standard headers or a compressed .ii file (pass -save-temps to gcc to get .ii files). where can i find js code for r...
Dehydra Function Reference - Archive of obsolete content
his is accomplished by recording every included file into the _includedarray in the current namespace. include example include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js into the map object require({version:, strict:, werror:, gczeal:}) require is used to set runtime execution flags. it also returns the current values of these flags. require supports optional named arguments via javascript object where each parameter is a property. if a property is not specified then it will not be passed to the runtime. version integer: this sets js version similar to version() in js 1.7. strict boolean: controls js strict mode werror boolean: turns js warnings into errors gczeal int: this is a write-only parameter to set turn on frequent garbage colle...
Installing Dehydra - Archive of obsolete content
building spidermonkey it is recommended that you use spidermonkey revision aurora_base_20110705 when building dehydra. ...
Dehydra - Archive of obsolete content
ic analyses of c++ code. in the simplest sense, dehydra could be thought of as a semantic grep tool. it presented a wealth of semantic information that can be queried with concise javascripts. it was also useful to find bugs in source code as it allows for much more error checking than c++ is capable of by itself. dehydra was built as a gcc plugin, thus it is easy to use for projects that already support gcc. dehydra is also useful for generating language bindings and is used to bootstrap treehydra, a heavy-duty static analysis gcc plugin. documentation installing dehydra download, installation and dependency info for dehydra using dehydra examples for getting started writing analysis scripts. dehydra function reference callback and utilit...
Developing New Mozilla Features - Archive of obsolete content
of furious activity. if so, and if your feature is not of general interest, prepare to be a low priority for a while. get connected with mozilla.org staff mitchell@mozilla.org is a good contact for project management discussions. let us know what you’re doing. if you can find the resources, designate someone on your team as the liaison to mozilla.org for project management issues. review and super-review take time improving the code as requested by the reviewers takes time. poor quality code also takes time. we’ve opted to spend the time improving code consistency before check-in when the pain is limited to the developers and the reviewers rather than everyone in the tree. we’re committed to this style of development, but recognize that vigilance is necessary to make sure newcomers ...
Exception logging in JavaScript - Archive of obsolete content
or example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console. any exceptions that are generated by xpconnect -- that is, those exceptions whose result codes are defined in nsixpconnect.idl -- are always logged into the error console. the ns_nointerface error is never reported when returned by a javascript object's queryinterface() method on the nsisupports interface. the ns_nointerface error is never reported when returned by a javascript object's getinterface() method on the nsiinterfacerequestor interface. all other errors are reported when the last javascript frame on the stack returns to a c++ caller without handling the exception. that last point deserves clarification. consider this call chain: here we see c++ code calling javascript...
Introducing the Audio API extension - Archive of obsolete content
gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. deprecated since gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19)this feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. please note that this document describes a non-standard experimental api. this api has been deprecated since gecko 22, disabled since gecko 28, and remo...
CRMF Request object - Archive of obsolete content
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't wo...
importUserCertificates - Archive of obsolete content
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't wo...
popChallengeResponse - Archive of obsolete content
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. deprecatedthis feature has been removed from the web standards. though some browsers may still support it, it is in the process of being dropped. avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't wo...
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type. the namespace associated with this api is jetpack.clipboard which provides both read and write access to the clipboard. ...
Clipboard Test - Archive of obsolete content
features can get and set the clipboard in various flavors of data type. the namespace associated with this api is jetpack.clipboard which provides both read and write access to the clipboard. the api is fairly straightforward; examples can be found here. this api currently lives in the future and must be imported for use. j...
Clipboard Test - Archive of obsolete content
features can get and set the clipboard in various flavors of data type. the namespace associated with this api is jetpack.clipboard which provides both read and write access to the clipboard. the api is fairly straightforward; examples can be found here. this api currently lives in the future and must be imported for use. ...
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type. the namespace associated with this api is jetpack.clipboard which provides both read and write access to the clipboard. the api is fairly straightforward; examples can be found here. this api currently lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. string contentthe content to be copied to the clipboard. ...
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type. the namespace associated with this api is jetpack.clipboard which provides both read and write access to the clipboard. the api is fairly straightforward; examples can be found here. the api currently lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. contentthe content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. ...
Litmus tests - Archive of obsolete content
re litmus, but then pulled in. a "smoke test" is a quick check, done to verify the basic functionality of a certain feature, or a sanity check of the build process. bfts, or basic functionality tests this set of tests would take longer to run, but will cover an entire release. it may not cover it at much depth, but it does try to cover the major features. ffts, or full functionality tests this is supposed to be more comprehensive and will take longer to run. ...
Measuring add-on startup performance - Archive of obsolete content
using about:startup the about startup add-on provides a much simpler way to measure startup performance. once installed, it will gather startup data and display it in the about:startup page. the add-on is very lightweight, so it shouldn't have a noticeable negative effect on your baseline and add-on tests. to test with about:startup, you should set up a new firefox profile, install this add-on, and then open and quit firefox repeatedly. if you want to match talos, you should do this 20 times. then look at the results in the about:startup page. this should provide your baseline numbers. then repeat the process with both about startup and your add-on installed. ...
Message Summary Database - Archive of obsolete content
are in a thread, which message a message is in reply to, etc. this allows us to store watch/ignore information on a thread object, and avoids having to generate threading information whenever a folder is open. this has arguably been more trouble than it's been worth, especially when we've threaded incorrectly. meta information the nsidbfolderinfo interface handles the folder meta data. this also supports generic properties. there is a method on nsimsgdatabase to get the dbfolderinfo. mork - the good, the bad, and the ugly mork has a horrible reputation and we're always asked why we don't just replace it with some other db. the bottom line is that we haven't been able to justify the very large cost of doing so because there won't be any benefit to the end-user, at least in the short term. he...
Metro browser chrome tests - Archive of obsolete content
tests that make up the library of tests your test file will contain. each test can have start up and tear down logic, plus the body of the test contained in run(). the test file can contain other functions which will be ignored unless invoked by test(). gtests make use of promises and tasks for managing execution. test comparison functions used in metro browser chrome tests are identical to those supported by mochitests, see how the comparison functions work in the mochitest documentation for more details. helper functions the eventutils helper functions are available on the eventutils object defined in the global scope. additional metro specific test helpers can be found in /browser/metro/base/tests/mochitest/head.js. you may add additional common utils and helpers to head.js. be careful abo...
Microsummary XML grammar reference - Archive of obsolete content
a microsummary generator is an xml document that describes how to pull specific information from a web page to be presented in summary form as a bookmark whose title changes based on the content of the page it targets. warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article provides detailed information about the xml grammar used to build microsummary generators, describing each element and their attributes. for an introduction to how to create a microsummary, read the article creating a microsummary. example the microsummary generator created in the creating a microsummary tutorial: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <templat...
Microsummary topics - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) programmatically installing a microsummary generator to programmatically install a microsummary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosummaryservice interface implemented by the nsimicrosummaryservice component, then call its installgenerator() method, passing it an xml document containing the generator. for example, the following code snippet installs the microsummary generator from the creating a microsummary tutorial: var generatortext = ' \ <?xml version="1.0" encoding="utf-8"?> \ <generator xmlns="http://www.mozilla.org/microsummaries/0.1" \ name="firefox ...
Plug-n-Hack Get Involved - Archive of obsolete content
while this project has been started by the mozilla security team and has been validated with firefox and owasp zap, this is an open project and we welcome involvement from anyone, especially people working on other browsers and security tools. if you would like to add pnh support to a browser or tool, or even get involved in onward pnh development, then please get in touch and we will give you whatever assistance we can. to contribute or keep up to date with plug-n-hack changes please joion the mozilla plug-n-hack google group. you can also talk to the mozilla security team about this project on the #websectools irc channel. related links plug-n-hack overview ...
BlogPosts - Archive of obsolete content
just browsing: mozilla prism update thanscorner: mozilla prism - webrunner with pazzaz mozilla prism - a revolution in web apps thanscorner: mozilla webrunner 0.7 site specific browsers webrunner using webrunner webrunner + gears = offline desktop reader webrunner 0.5 webrunner 0.5 - mac support webrunner 0.5 - linux install webrunner, google reader, and google notebook distraction free gtd - 32+ web app files for online todo lists mozilla webrunner: a one-window, tabless browser with no url bar webrunner becomes prism - a mozilla labs project mozilla labs: prism alex faaborg: prism mozilla prism: bringing web apps to the desktop everyone should use site specific browsers mozilla prism portable (spanish) prism, l'avenir des applications web selon mozilla (french) mozilla prism : bundl...
Configuration - Archive of obsolete content
y string. separate multiple uris with commas: *google.com, *yahoo.com exclude urls that should be opened in the default browser, rather than in the web app. syntax is the same as for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no. iconic specifies that the application should be opened in iconic state. currently support only on windows in conjunction with the trayicon, causes the application to open minimized to the system tray: yes or no. launch prism with -webapp [bundle] to load the specified web profile and install the webapp to your prism profile folder. once the webapp is installed, it can be launched using -webapp [webapp-id] and prism will skip the installation and run the webapp directly. any of th...
HostWindow - Archive of obsolete content
idebar - section of window area used to display ancillary web content, including web applications. when the sidebar is displayed, the splitter can be used to change the width or quickly collapse it. the splitter itself cannot be hidden as it is the only ui to show a collapsed sidebar. when not displayed the entire sidebar area, including the splitter are hidden. note: the sidebar is currently not supported. we are considering whether to support a sidebar in future versions of prism and welcome input on this subject. status - area of the statusbar that displays the loading status message and a "percent complete" progress bar, as well as the "gear" menu that provides access to prism commands such as displaying the error console. to display the status bar, the statusbar option in webapp.ini must...
Styling - Archive of obsolete content
application's native styles. simply add the webapp.css to the bundle and it will be injected into the web application, regardless of the platform or os. it is also possible to create platform-specific styles. in this scenario, the css file is specific to an os. this allows prism webapps to take on an os-specific look. to use platform-specific styles, create a folder in the bundle archive for each supported os and place a webapp.css file in the folder. the folder names must match the following: windows - winnt mac os x - darwin linux - linux the folder names are pulled from mozilla and are the same as those used in other mozilla projects, such as extension and xul applications. note: you can also include a root level webapp.css which will be used if a platform-specific version is not foun...
Hacking wiki - Archive of obsolete content
, type <tt>anonymous</tt>) setting up copy the contents of the <tt>trunk</tt> folder and the <tt>css</tt> folder (note: the folder itself) into the <tt>www</tt> directory on your server. the contents of the <tt>trunk</tt> directory you just checked out is a slightly modified mediawiki install, so you can follow the mediawiki install instructions. the <tt>css</tt> folder contains files that are supposed to be in the <tt>/css</tt> directory of the site.) to get a working install, you need to configure mediawiki. it's done by navigating to <tt>/config/index.php</tt> in your web browser. polvi claims that you'll have it, but in case you don't, you can copy one from the mediawiki tarball. once you're done with the configuration script, copy the <tt>config/localsettings.php</tt> file it created ...
Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use remote xul. ...
Space Manager High Level Design - Archive of obsolete content
a band of occupied or available space nsblockbanddata: a specialization of nsbanddata that is used by nsblockreflowstate to determine the available space, float impacts, and where floats are cleared. essentially a css-specific wrapper for generic nsbanddata. bandrect: keeps the bounds of a band, along with the frames associated with the band. bandrects are a linked list (provided by prcliststr super-class) and also provide some geometry-management methods (splitvertically, splithorizontally) and some methods that query or manipulate the frames associated with the band (isoccupiedby, addframe, removeframe). bandlist: a subclass of bandrect that provides a list interface - head(), tail(), isempty(), etc. frameinfo: a structure that keeps information about the rectangle associated with a sp...
Tamarin Build System Documentation - Archive of obsolete content
build yellow box at the bottom of a set of buildsteps to see the result of all of the buildsteps for a build and the time each buildstep took scroll down to see previous builds triggered at the bottom of the page click on the [next page] link to display more previous builds what are the goals of the build system (qos)? to provide quick and accurate results of building and testing tamarin on supported platforms and configurations to represent the build results in a clear and concise manor please give use feedback if you have any comments or suggestions to improve the build system how to add tests to the smokes? the list of smoke tests are located in the tamarin-repository, test/run-smokes.txt, assume the start directory is test format is cd testdir; command to run test above the test ...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08. the announcement sent to tamarin-devel can be read here. testing summary acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests. performance testsuite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700) as well as current against the vm in flash player 10. the key takeaway is that the interpreter is much improved. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 i...
Tamarin - Archive of obsolete content
tamarin is a javascript engine written in c++. it currently implements adobe actionscript™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later. tamarin's jit-compiler, nanojit, is also used in tracemonkey ergo spidermonkey, which is mozilla’s javascript engine in firefox. tamarin is available under the mpl/gpl/lgpl tri-license. releases release tracking information on current, past, and upcoming releases of tamarin. documentation adobe actionscript virtual machine 2 (avm2) overview (pdf, 400k) the instructions, architecture, and file format supported by the avm2. see also the possible errata. tamarin build documentation how to get, build, and use tama...
Treehydra Manual - Archive of obsolete content
means the analysis has no information about that value or state. meet. meet is a relation on abstract values used to filter states at conditional statements. for example, if the current abstract value of a variable x is nonzero, and the analysis goes inside an if statement with the condition x == 1, then in the new abstract value of x will be nonzero meet 1. esp uses a user-defined meet function supplied to the analysis constructor that should return the intersection of two abstract values. it is also acceptable for meet to return a value that contains the intersection--this may cause the analysis to have more false positives but will not introduce false negatives. join. join is a relation on abstract values used to merge states at control flow merge points. for example, if esp reaches a poi...
URIScheme - Archive of obsolete content
moz-icon://.ext?size=32 : you can replace ext by your some file extension like js, css, xul, xml, etc. and the size number by 1 to 127 mailto:emailaddress@domain.com about: chrome:// ... preferences see gecko.handlerservice.schemes.* scripting interface see nsiprotocolhandler to create a new protocol/scheme. about: about: about:config about:crashes about:mozilla about:plugins about:robots ... ...
[Deprecated] The Mozilla build VM - Archive of obsolete content
thanks to significant improvements in our build environment setup process, it's much simpler and easier to get set up and stay up to date by starting with building firefox instead. other links of interest may include: developer guide (documentation about developing on and for mozilla projects). mentored bugs have a mentor who commits to helping you every step of the way. generally, there should be enough information in the bug to get started. whenever you need help, contact the mentor via matrix, in the bug itself, or by email. when you've completed the bug, they will help you get your code into the tree. ...
Venkman Internals - Archive of obsolete content
me("script"); then extract the urls from the src attributes. scriptwrapper newsgroup, 2002, rgrinda here is a bit more information about how venkman tracks files and functions... a scriptwrapper is a pure js object defined only inside venkman. as you pointed out, there is a 1:1 relationship between scriptwrappers and functions. scriptwrapper has-a jsdscript property, which is an object which supports the jsdiscript interface. jsdiscript is a lower level access to the function than the scriptwrapper. in order to set a breakpoint in a particular function, you'll want to call scriptwrapper.setbreakpoint(pc[, parentbp]); where |pc| is the program counter location to set the breakpoint, and |parentbp| is an optional "future breakpoint" object to use as the parent for this breakpoint. if you s...
When To Use ifdefs - Archive of obsolete content
ents/shistory/) is a hodgepodge mess of "toolkit" and "application-specific" code. this code is all going to be moved elsewhere (most of it to toolkit/ or suite/), but for the time being most application-specific ifdefs are allowed because we can't help it. if you're not sure, ask benjamin smedberg. for an example of an application-specific ifdef that is bad and should be removed, see nsnativeappsupportwin.cpp. types of ifdef there are two major types of ifdef: preprocessor ifdefs and makefile ifdefs. preprocessor ifdefs are generally easy to spot: in c, c++, and plaintext preprocessed code there will be an #ifdef or #if instruction. makefile ifdefs, however, are sometimes harder to spot and can cause hidden issues that are much more serious. makefile ifdefs are used to build or not-build...
Binding Attachment and Detachment - Archive of obsolete content
itance between d3 and s1 is implicit, meaning that there is no connection in the xbl documents between the two bindings. the inheritance link has been forged dynamically through the invocation of the element.style.mozbinding. <constructor> call as a document is loaded and style rules are matched for elements, any binding documents that are encountered will load as needed. binding document loads suppress the firing of the dom load event for the bound document. when the load event fires, and if all binding documents loaded successfully, it can be assumed that all bindings are attached to all elements in the page. for elements that are created during or after the load event is fired, no assumptions can be made regarding order of binding attachment. when a binding is attached, the following ev...
Example Sticky Notes - Archive of obsolete content
keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory. the others are only needed if you plan to handle xul (xml user interface language) or/and svg (scalable vector graphics) in your bindings; xlink in xml also may come useful sometimes. all namespaces above are supported by default and they do not require any additional downloads or initializations. --> <binding id="default"> <!-- a separate binding. you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding: url(notes.xml#default) this id is local within the binding file (not visible in the target document dom tree). --> <resources> <!-- ...
XBL - Archive of obsolete content
e will be updated to describe those differences. xbl 1.0 is a mozilla-specific technology, and not a w3c standard. at least two standards spawned from it have died: sxbl and xbl 2.0. warning: sxbl and xbl 2.0 have died. w3c sxbl (currently a working draft, 2005) stands for svg's xml binding language. it is supposed to include a subset of xbl 2.0 features needed for svg. it's similar in spirit to mozilla's xbl, but there are a few subtle (and not-so-subtle) differences. for example, names of the elements are different. also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements. xbl 2.0 (w3c c...
Creating XPI Installer Modules - Archive of obsolete content
, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
deleteRegisteredFile - Archive of obsolete content
method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes. description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry. ...
initInstall - Archive of obsolete content
installversion version); parameters the initinstall method has the following parameters: displayname a string that contains the name of the software being installed. the name of the software is displayed to the user. package the client version registry pathname for the software (for example: plugins/adobe/acrobat or /royalairways/royalpi/). it is an error to supply a null or empty name. the name can be absolute or relative. a relative pathname is relative to the netscape 6 namespace. a relative pathname must start with plugins/, to be relative to the plug-ins portion of that namespace or java/download/, to be relative to the java portion. all other parts of the netscape 6 area of the registry are reserved for use by netscape. the client ver...
registerChrome - Archive of obsolete content
ation script is located. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error. description when the third parameter is omitted (pointing to a specific location within the xpi file), this function is being used in a somewhat deprecated way. in this case, registerchrome is supporting the old format of installation archives, in which the manifest.rdf file was always located at the highest level of the installation archive. in this case, registerchrome does not require a path inside the archive, as it does now in order to locate the more flexible contents.rdf format of installation archives. note that you can also look in the installed-chrome.txt file in the chrome direc...
Return Codes - Archive of obsolete content
s. reboot_needed 999 the files were installed, but one or more components were in use. restart the computer and the application to complete the installation process. on windows nt, you may only need to restart the application as long as you did not replace operating system files. bad_package_name -200 a problem occurred with the package name supplied to initinstall unexpected_error -201 an unrecognized error occurred. access_denied -202 the user (or the os) did not grant the required security privilege. execution_error -203 an error occurred executing the script no_install_script -204 installation script was not signed ...
getString - Archive of obsolete content
parameters the method has the following parameters: section section in the file, such as "boot" or "drivers". key the key in that section whose value to return. returns the value of the key or an empty string if none was found. description the getstring method is similar to the windows api function getprivateprofilestring. unlike that function, this method does not support using a null key to return a list of keys in a section. example to get the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); var wallpapervalue = ini.getstring ("desktop", "wallpaper"); ...
writeString - Archive of obsolete content
ethod has the following parameters: section section in the file, such as "boot" or "drivers". key the key in that section whose value to change. value the new value. returns true if successfully scheduled, otherwise, false. description the writestring method is similar to the windows api function writeprivateprofilestring. to delete an existing value, supply null as the value parameter. unlike the writeprivateprofilestring function, this method does not support using a null key to delete an entire section. values are not actually written until performinstall is called. example to set the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); ini.writestring (...
getValue - Archive of obsolete content
retrieves the value of an arbitrary key. method of winreg object syntax winregvalue getvalue ( string subkey, string valname); parameters the getvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want. returns a winregvalue object representing the value of the named value-name/value pair or null if there is no value or if there is an error. see winregvalue for information about these values. description the getvalue method retrieves the value of an arbitraty key. ...
setValue - Archive of obsolete content
sets the value of an arbitrary key. method of winreg object syntax string setvalue ( string subkey, string valname, winregvalue value); parameters the setvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want to change. value a winregvalue object representing the new non-string value. see winregvalue for information about these values. returns 0 if it succeeded; a nonzero number if it failed to schedule the action. ...
WinRegValue - Archive of obsolete content
winregvalue object, with the data members type and data set to the values passed to this constructor. description advanced windows developers can use this object to manipulate non-string values for the windows registry. an object of this type has two fields: the type of the data and the value. for information on the possible data types for a registry value, see your windows api documentation. you supply the value for these fields to the constructor for this class. ...
A XUL Bestiary - Archive of obsolete content
to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to do with chrome. the term chrome is used in different contexts to mean different things. in general, chrome refers to a xul interface and all of its supporting files; chrome means the xul content and structure, plus the css skin, plus whatever localization and platform-specific files are part of that xul interface. by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul. the chrome url this concept of a chrome as an integrated, dynamic thing in some w...
autoFillAfterMatch - Archive of obsolete content
...
button.type - Archive of obsolete content
ose the menu. menu-button you can also use the value menu-button to create a button with a menu. unlike the menu type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed. panel similar to the menu type, this opens a popup. place a panel element inside the button. panel elements are popups that support any type of content. radio the button acts like a radio button. only one button in the group can be on a once. repeat this button will fire its command event repeatedly while the mouse button is held down. ...
buttons - Archive of obsolete content
command with the ondialogextra2 attribute. note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma). warning: if the accept and cancel buttons are actually shown is system dependent and is mainly controlled by the value of the boolean preference browser.preferences.instantapply. if it is set to true any changes to settings are supposed to be applied immediately. the accept button is therefore unnecessary and is hidden. the cancel button might be shown as an additional possibility to close the dialog in this situation (windows and linux) or might be hidden, too (mac os). the default setting of browser.preferences.instantapply currently is true on linux and mac os and false on windows (which however might or might not chang...
disabled - Archive of obsolete content
...
disablefastfind - Archive of obsolete content
...
emptytext - Archive of obsolete content
« xul reference home emptytext deprecated since gecko 2 type: string a string that appears in the textbox when it has no value. this is superseded by the placeholder attribute in gecko 2.0. the old name is retained for compatibility, but you should update your code. ...
fullscreenbutton - Archive of obsolete content
the window receives a "fullscreen" event once the change has been made. ...
lightweightthemes - Archive of obsolete content
...
modifiers - Archive of obsolete content
atforms that do not have them. shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super or hyper key on linux. this shouldn't be specified directly because it may conflict with system wide shortcut key. accel: the key used for keyboard shortcuts on the user's platform, which is control on windows and linux, and command on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in ...
ontextcommand - Archive of obsolete content
...
ontextrevert - Archive of obsolete content
...
querytype - Archive of obsolete content
...
smoothscroll - Archive of obsolete content
...
textbox.disablehistory - Archive of obsolete content
...
textbox.type - Archive of obsolete content
for more information about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. ...
Attribute (XUL) - Archive of obsolete content
ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Accessing Files - Archive of obsolete content
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. accessing files this section describes how to create a file reference. retrieving a file when working with files, usage is always done via a file object and...
IO - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › IO
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 (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access and get information about files, read from files and create and write files. using files a xul applic...
TOC - Archive of obsolete content
Archive › Mozilla › XUL › FileGuide › TOC
...
findbar - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata close() return type: no return value closes the notification or findbar and removes it from i...
International characters in XUL JavaScript - Archive of obsolete content
this means that such script files can use any character from virtually any language of the world. for example, they can contain a line: var text = "ein schönes beispiel eines mehrsprachigen textes: ę—„ęœ¬čŖž"; this mixes german and japanese characters. earlier versions always interpreted js files loaded from xul as iso-8859-1 (latin-1), in both local and remote cases. unicode escapes, as discussed below, have always worked. ...
advance - Archive of obsolete content
Archive › Mozilla › XUL › Method › advance
...
appendCustomToolbar - Archive of obsolete content
« xul reference home appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name. you can supply a comma-separated list of toolbar item ids as the second argument to add some items by default. the method returns the dom element for the created toolbar. ...
getFormattedString - Archive of obsolete content
« xul reference home getformattedstring( key, strarray ) return type: string looks up the format string for the given key name in the string bundle and returns a formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. alternatively, numbered indices of the format %n$s (e.g. %1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. if you need to handle substitutions involving plurals, take a look at localization and plurals. ...
openPopup - Archive of obsolete content
« xul reference home openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location. anchor the popup may be either anchored to another node or opened freely. to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. the direction in which the popup is oriented depends on the direction of the anchor. position possible values for position are: before_start, before_end, after_start, after_end...
openSubDialog - Archive of obsolete content
« xul reference home opensubdialog( url, features, params ) return type: window opens a child modal dialog. usually this method would be used to allow the user to configure advanced options. the arguments are similar to the window's opendialog method except that the window name does not need to be supplied. the url should be a xul file. if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed. ...
openWindow - Archive of obsolete content
...
selectTabAtIndex - Archive of obsolete content
...
Methods - Archive of obsolete content
ment.getattributenodens dom:element.getattributens dom:element.getelementsbytagname dom:element.getelementsbytagnamens dom:element.getfeature fixme: brokenlink dom:element.getuserdata dom:element.hasattribute dom:element.hasattributens dom:element.hasattributes dom:element.haschildnodes dom:element.insertbefore dom:element.isequalnode dom:element.issamenode dom:element.issupported dom:element.lookupnamespaceuri dom:element.lookupprefix dom:element.normalize dom:element.removeattribute dom:element.removeattributenode dom:element.removeattributens dom:element.removechild dom:element.removeeventlistener dom:element.replacechild dom:element.setattribute dom:element.setattributenode dom:element.setattributenodens dom:element.setattributens dom:...
Node - Archive of obsolete content
Archive › Mozilla › XUL › Node
rence_node 5 short entity_node 6 short processing_instruction_node 7 short comment_node 8 short document_node 9 short document_type_node 10 short document_fragment_node 11 short notation_node 12 methods node appendchild ( node newchild ) node clonenode ( boolean deep ) boolean hasattributes ( ) boolean haschildnodes ( ) node insertbefore ( node newchild , node refchild ) boolean issupported ( string feature , string version ) void normalize ( ) node removechild ( node oldchild ) node replacechild ( node newchild , node oldchild ) ...
Floating Panels - Archive of obsolete content
oautohide="true" titlebar="normal"> <label control="name" value="name:"/> <textbox id="name"/> </panel> the noautohide attribute is used to indicate that the panel is not temporary. when set to true, the popup will not close when the user clicks outside of it, nor when the user presses the escape key. the titlebar attribute creates a panel with a titlebar. currently, only the value normal is supported, which creates a default titlebar. in the future, a distinction will be available to support titlebars of differing styles. the floating panel can be placed and moved independently of the main window, however it will always appear above the main window. on mac, floating panels are invisible when another application is made active, and become visible again when the xul application is made ac...
MenuButtons - Archive of obsolete content
a button or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed. an arrow appears on the button next to the label or image indicating to the user that a menu is present. a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally. however a segment of the button displays an arrow which, when pressed, opens a menu. ...
MenuModification - Archive of obsolete content
lways adds the new item to the end of the menu, the insertitemat method may be used in a similar fashion to insert an item into the menu elsewhere. menu.insertitemat(0, "delete", "delete"); in this example, the insertitemat method is used to insert a new 'delete' item at the beginning of the menu's popup. the first argument is the index where the new item should be inserted. in this case, 0 is supplied as the index, which means before the first item. indicies are counted starting at 0, so to insert an item before the fourth item pass 3 as the argument. the second and third arguments to insertitemat are the label and value for the new item, as with appenditem. both the appenditem and insertitemat methods return the new menuitem, so you can further modify it, for instance to add an access k...
MoveResize - Archive of obsolete content
ng and resizing a popup menus and popups have methods which may be used to move and resize them. moving a popup once a popup is open, it can be moved using the popup's moveto method. void moveto(in long left, in long top); the left argument is the horizontal screen position and the top argument is the vertical screen position. this method will change the left and top attributes to match the supplied arguments, so if these attributes are persisted the values will be restored when the window is displayed again. for instance, the following example will move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements provided by the operating system, such as the menu bar or the task bar. resizing a popup th...
Panels - Archive of obsolete content
the panel element the panel element is used to create panels. the panel will display whatever elements are placed as children of the panel element. for example, the following panel displays a textbox for entering a name. note that the panel is not placed in a separate file and is instead placed inside another window. ...
Positioning - Archive of obsolete content
when opening a popup via a script using the openpopup method, the second argument may be used to specify the position instead of using the position attribute. for example, the following might be used with the above example to open the popup: menupopup.openpopup(label, "end_before", 0, 0, false, false); note that the position has been set to 'end_before', as above. when both are used, the value supplied to openpopup overrides the attribute. however, if the attributesoverride argument to openpopup (the last argument, false in the example above) was true, the attribute would override the value supplied to openpopup. this allows the script and xul code to coordinate in different ways as to how the popup should be opened. positioning using coordinates a popup can be positioned further using t...
Tooltips - Archive of obsolete content
t is styled to look different. elements that use the tooltiptext attribute display the tooltip in a default tooltip element, which typically looks like a small yellow box large enough to fit the text inside it. this default tooltip is created automatically, so you don't normally need to use a tooltip element. however, it is possible to use another tooltip element that looks differently, or which supports other elements besides a single text label. the tooltip can be created using the tooltip element, the contents of which appear inside the tooltip. <tooltip id="iconic"> <image src="help.png"/> <label value="save a file to a remote site"/> </tooltip> <button label="save" tooltip="iconic"/> in this example, a tooltip with the id 'iconic' contains an image and a label. a button is asso...
controllers - Archive of obsolete content
ommands. the document's command dispatcher will locate controllers to handle a command by using the focused element's list. ...
emptyText - Archive of obsolete content
« xul reference emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value. this is superseded by the placeholder property in gecko 2.0. the old name is retained for compatibility, but you should update your code. ...
richlistitem.label - Archive of obsolete content
« xul reference label type: string gets the concatentation of text from any child label elements. does not support setting label values. use the child elements directly to set label text. ...
smoothScroll - Archive of obsolete content
...
Property - Archive of obsolete content
second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wraparound year yearleadingzero related dom element properties dom:el...
Multiple Rules - Archive of obsolete content
this involves using additional rule elements after the first. in addition, conditions may be applied to each rule. only those results that match the conditions have content generated for them. for each result, the conditions associated with each rule are examined to see if they match. the first rule that matches causes content to be generated for that result. for example, the first rule might match directories or folders, whereas the second rule might match files. ...
Special Condition Tests - Archive of obsolete content
the first of these tests can be used to test if an element is a container or not. to use this test, place an iscontainer attribute on a <rule>. the iscontainer attribute should be set to true if you only want to match containers, and false if you only want to match non-containers. a container is an rdf container such a...
Template and Tree Listeners - Archive of obsolete content
r versions; this function checks the orientation and returns the opposite. this works as the 'on' value is 0 and the 'between' values are -1 and 1. obviously, this code is much simpler than what we would really want to use -- we should be checking what is being dragged to make sure that it is compatible with the tree. or, we might want to allow dropping on specific rows only; the drop methods are supplied with an index argument so we can check for this. « previousnext » ...
Using Recursive Templates - Archive of obsolete content
« previousnext » you may recall that templates generate content recursively. after the data is generated, each result is used as the new reference point for a nested iteration of the template. this is usually used to generate content in a tree or menu. both the rdf and xml datasource types support recursion. for example, using this xml datasource: <people> <group name="male"> <person name="napoleon bonaparte"/> <person name="julius caesar"/> <person name="ferdinand magellan"/> </group> <group name="female"> <person name="cleopatra"/> <person name="laura secord"/> </group> </people> we could display this data in a flat list by using the right query: <query expr="group/person/"> or, we could display one level for the two groups, and use another lev...
Adding Buttons - Archive of obsolete content
nabled. you can switch the disabled state of the button using javascript. accesskey this should be set to a letter that is used as a shortcut key. this letter should appear in the label text and will typically be drawn underlined. when the user presses alt (or a similar key that varies on each platform) and the access key, the button will be focused from anywhere in the window. note: buttons support more attributes than those listed above. others will be discussed later. some examples of buttons example 1 : source view <button label="normal"/> <button label="disabled" disabled="true"/> the examples above will generate the buttons in the image. the first button is a normal button. the second button is disabled so it appears greyed out. we'll start by creating a simple find button ...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
s, it is simply passed to the inner content as usual. the general handler syntax is as follows: <binding id="binding-name"> <handlers> <handler event="event-name" action="script"/> </handlers> </binding> place all of your handlers within the handlers element. each handler element defines the action taken for a particular event specified by its event attribute. valid event types are those supported by xul and javascript, such as click and focus. use the event name without the 'on' in front of it. a common reason to set handlers is to modify the custom properties when an event occurs. for example, a custom checkbox might have a checked property which needs to be changed when the user clicks the checkbox: <handlers> <handler event="mouseup" action="this.checked=!this.checked"/> </hand...
Adding Methods to XBL-defined Elements - Archive of obsolete content
l box element with the id of outer, you willl find that it has has 4 children. these correspond to its four buttons, even though those buttons are drawn inside the stack. the stack has only one child, the children element itself. the length of the anonymous array of the outer box is two, the first element the description element and the second the stack element. constructors and destructors xbl supports two special methods created with separate tags, constructor and destructor. a constructor is called whenever the binding is attached to an element. it is used to initialize the content such as loading preferences or setting the default values of fields. the destructor is called when a binding is removed from an element. this might be used to save information. there are two points when a bin...
Broadcasters and Observers - Archive of obsolete content
now all of the places where a back action could be. if someone added a new back button using an extension, it wouldn't be handled. it is convenient to simply disable the back action and have all the elements that issue the back action disable themselves. we can use the attribute forwarding of commands to accomplish this. broadcasters there is a similar element called a broadcaster. broadcasters support attribute forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state information. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the former...
Cross Package Overlays - Archive of obsolete content
used on the toolbox. this value (browser-toolbox) is the same as the identifier of the toolbox in the browser window (navigator.xul). this means that the overlay will apply to the toolbox in the browser window and the content will be added as an extra toolbar. the id of the toolbox changed from "<code>navigator-toolbox</code>" to "<code>browser-toolbox</code>" in firefox 3 beta 3. you can support both firefox 2 and earlier and firefox 3 by duplicating the <code><span class="plain">' .. <toolbox> .. '</span></code> section with that id. to add this overlay to the manifest file, we need to add two resources. first, we add one for each window that we are applying an overlay to. the code below should be added into contents.rdf just before the closing rdf tag. <rdf:seq about="urn:mozil...
Custom Tree Views - Archive of obsolete content
that may be implemented, you only need to implement the ones that the tree will call. three methods that you should implement are listed below. rowcount this property should be set to the total number of rows in the tree. getcelltext( row , column ) this method should return the text contents at the specified row and column. this will be called to display data for each cell. the rows are supplied as numeric values starting at 0. the columns are treecolumn objects. in the older versions of mozilla (before firefox 1.5 or mozilla 1.8), the columns are supplied as the values of the id attribute on the columns. if you need a id attribute like older versions, the id property of treecolumn can be used. settree( tree ) this method is called once to set the tree element on the view. here ...
Document Object Model - Archive of obsolete content
on, despite what the prefix might say. this is an important distinction. in fact, the actual text used for the prefix is irrelevant when determining what kind of element is used. the dom provides a number of namespace related functions similar to the non-namespace ones. for example, the getattributens() function is similar to the the getattribute() function except an additional argument may be supplied to specify an attribute in a specific namespace. many xul elements have their own properties that are unique to that element. refer to the element reference for a full guide to the attributes and properties available for an element. navigating the dom the dom is a tree structure with a single root node with children. you can get a reference to the root node using the document's documentel...
Features of a Window - Archive of obsolete content
be set to 0. to have the window set its size automatically, leave both the width and height out. the width and height only specify the initial size of the window. the user may still resize the window to another size, assuming that the window is resizable. other window features the flags below can be passed as part of the third argument to the window.open function. your operating system may not support all of them. you can also use any of the pre-existing flags, which you should find in a javascript reference. you may disable a feature by setting it to 'no', for example 'dialog=no'. alwayslowered the window will always appear behind other windows. alwaysraised the window will always appear above other windows. centerscreen the window will be centered on the screen when it is opened.
Input Controls - Archive of obsolete content
lement, textbox, used for text entry fields. without any attributes, the textbox element creates a box in which the user can enter text. textboxes accept many of the same attributes as html input controls. the following are some of them: id a unique identifier so that you can identify the textbox. class the style class of the textbox. value if you want the textbox to have default text, supply it with the value attribute. disabled set to true to have text entry disabled. textbox.type you can set this attribute to the special value password to create a textbox that hides what it types. this is usually used for password entry fields. maxlength the maximum number of characters that the textbox allows. note that while in html, several different kinds of fields can be created ...
Keyboard Shortcuts - Archive of obsolete content
the modifiers attribute. it is a space-separated list of modifier keys, which are listed below. alt the user must press the alt key. on the macintosh, this is the option key. control the user must press the ctrl key. meta the user must press the meta key. this is the command key on the macintosh. shift the user must press the shift key. os the user must press the win key. this is the super key or the hyper key on linux. if this value is used, typically the key combination conflicts with system wide shortcut keys. so, you shouldn't use this value as far as possible. accel the user must press the special accelerator key. the key used for keyboard shortcuts on the user's platform. usually, this would be the value you would use. access the user must press the special access key.
List Controls - Archive of obsolete content
m label="chocolate chip" value="chocchip" /> <listitem label="raspberry ripple" value="raspripple" /> <listitem label="squash swirl" value="squash" /> </listbox> the example has been changed to display only 3 rows at a time. values have also been added to each item in the list. list boxes have some additional features, which will be described later. multi-column list boxes the listbox also supports multiple columns. each cell may have arbitrary content within it, although usually only text is used. when the user selects an item in the list, the entire row is selected. you cannot have a single cell selected. two tags are used to specify the columns in the listbox. the listcols element is used to hold the column information, each of which is specified using a listcol element. you will ne...
Localization - Archive of obsolete content
entity is replaced with its value, which can be a string of text. entities may be used whenever text occurs, including the values of attributes. the example below demonstrates the use of an entity in a button. <button label="&findlabel;"/> the text that will appear on the label will be the value that the entity &findlabel; has. a file is created which contains the entity declarations for each supported language. in english, the &findlabel; entity will probably be declared to have the text "find". dtd files entities are declared in document type definition (dtd) files. files of this type are normally used to declare the syntax and semantics of a particular xml file, but they also let you declare entities. in the mozilla chrome system, you will find dtd files located in the locales subdir...
Manipulating Lists - Archive of obsolete content
this interface provides a number of functions specifically for handling multiple selection. for example the selecteditems property holds a list of the items that are selected, while the selectedcount property holds the number of items selected. typically, you will use these properties to iterate over the...
Modifying the Default Skin - Archive of obsolete content
using it may lead to hard-to-diagnose bugs or crashes. ...
More Event Handlers - Archive of obsolete content
ed once for the first click, again for the second click, and again for the third click, but the dblclick event will only be fired once for a double click. the button and detail properties only apply to the mouse button related events, not mouse movement events. for the mousemove event, for example, both properties will be set to 0. mouse position event properties however, all mouse events will be supplied with properties that hold the coordinates of the mouse position where the event occurred. there are two sets of coordinates. the first is the screenx and screeny properties and are relative to the top left corner of the screen. the second set, clientx and clienty, are relative to the top left corner of the document. here is an example which displays the current mouse coordinates: example 4 :...
Stacks and Decks - Archive of obsolete content
e same text 'shadowed' again but slightly offset from the other. the second description element is drawn in red so the effect is more visible. this method has advantages over using text-shadow because you could completely style the shadow apart from the main text. it could have its own font, underline or size. (you could even make the shadow blink). it is also useful as mozilla doesn't currently support css text shadowing. a disadvantage is that the area taken up by the shadow makes the size of the stack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack style="background-color: #c0c0c0"> <description value="disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/> <description value="disabled" style="color: gre...
The Chrome URL - Archive of obsolete content
ls anywhere normal urls can be used. you can even enter them directly into the url bar in a firefox browser window. if you enter the url mentioned above into the browser's address bar, you should see that window appear like a web page might do and for the most part will function as if it was a separate window. some dialog boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them. you will also see chrome urls without specified filenames, such as: chrome://browser/content/ in this case, only the package name and part is specified. this type of reference will automatically select an appropriate file from that right directory. for content, a file with the same name of the package and a xul extension is selected. in the above example, t...
Tree Box Objects - Archive of obsolete content
abel id="part"/> the getcellat() function takes five arguments, the coordinates to look up and three out parameters. an out parameter is used since the function needs to return more that one value. you will see a number of interfaces that use out parameters in the xulplanet object reference (fixme: deadlink). these are indicated by the word 'out' before the argument. for these, you will need to supply an empty object and the function will fill in the 'value' property with the necessary value. the three out parameters will be filled in with the row, the column and a child type. the row is the index of the row the mouse is over, since we call it with the event coordinates of a mousemove event. if the coordinate is not over a row, the row value will be set to -1. the column is a column object...
Using Spacers - Archive of obsolete content
his section, we will find out how to add some spacing in between the elements we have created. adding spacers one of the problems with developing user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different platforms may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple platforms and languages usually have their windows laid out with lots of space to allow for this. some platforms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit the needs of the user. (java uses layout...
XBL Inheritance - Archive of obsolete content
xtends from the xul textbox element. the url given in the extends attribute above is the url of the textbox binding. this means that we inherit all of the content and behavior provided by the textbox binding. in addition, we add a handler which responds to the keypress event. autocompleting textboxes the example above is similar to how the url autocomplete feature works in mozilla. a textbox that supports autocomplete is just one with a xbl binding that extends the basic textbox. the autocomplete textbox adds extra event handling so that when a url is typed, a menu will pop up with possible completions. you can use it in your own applications too. just create a textbox with two extra attributes. <textbox type="autocomplete" searchsessions="history"/> set the type to autocomplete to add the a...
XUL Structure - Archive of obsolete content
e one per xul file. the locale part also contains properties files, which are similar, but are used by script files. the file browser.properties contains a few such localized strings. this structure allows you to translate mozilla or a component into a different language by just adding a new locale for that language. you don't have to change the xul code at all. in addition, another person could supply a separate package that applies a skin or locale to your content part, thus providing support for a new theme or language without having to change the original package. other packages there is a special package called toolkit (or global). we saw the global directory earlier for skins. the file toolkit.jar contains the corresponding content part for it. it contains some global dialogs and def...
Using Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use remote xul. ...
Using spell checking in XUL - Archive of obsolete content
spell checking functionality is available starting in firefox 2. this document describes how to use the mozispellcheckingengine component to add spell checking capabilities to your firefox extension. see controlling spell checking in html forms for details on adding spell check support to html forms for your website. checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test. this method returns true if the word is correctly spelled, or false if it's not. you may also want to check to see if the word is in the user's personal dictionary, since sometimes a word might be correctly spelled but in the dictionary. // different versions of firefox h...
Window icons - Archive of obsolete content
global icon files currently take precedence and bundles are only searched for icons which are not provided by the application. starting with firefox 3.0, xulrunner 3.0, thunderbird 3.0 and seamonkey 2.0 you can now specify png format icons instead of xpm format on linux. you can specify up to 4 different sizes of png icons using the suffixes .png, 16.png, 32.png and 48.png. older versions to support older applications, such as firefox 1.0, you need to copy the icons to app_dir/chrome/icons/default manually on the first start (example code). ...
Writing Skinnable XUL and CSS - Archive of obsolete content
r usage will be allowed. image chrome urls should never occur in xul. any chrome url that references an image in the skin is strictly forbidden in the xul. if you find yourself needing to display an image from the skin, then use <titledbutton> and style it rather than using <html:img>. the problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've specified. this is not healthy. note that some particularly evil people put images chrome urls in dtds. this is even worse, and it also is strictly forbidden. original document information author(s): david hyatt last updated date: may 24, 2000 copyright information: copyright (c) 1999-2000 david hyatt ...
XUL Parser in Python/source - Archive of obsolete content
source code for the xul parser in python. import sys, glob, xmllib import os, re el_list = {} w = open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. def strip(snip): t = re.sub('http://.*?\s', '', snip) return t class xulparser(xmllib.xmlparser): def unknown_starttag(self, t, a): name = strip(t) if name not in el_list: el_list[name] = {} for attr,val in a.items(): el_list[name][strip(attr)] = strip(val) def syntax_error(self, message): pass p = xulparser() cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file ...
XUL element attributes - Archive of obsolete content
ts implemented in xbl. the element should fire change, command, or input event when the value is changed so that the preference will update accordingly. see the pref system documentation for more information. querytype type: string indicates the type of datasource used in a template. firefox 3 provides 3 built-in datasources: 'rdf', default, 'xml' and 'storage'. extensions may provide support for additional datasources. ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the value of an about attribute on an rdf container. this attribute should be placed alongside the datasources attribute. removeelement type: id when placed on an element in an overlay, it indi...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
->"/> 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. however, this attribute causes any xul loaded in the browser to have issues with jaws 7.10. we believe they are using the window class to determine that it is content rather than dialog, but does not support content mode for xul. therefore, with jaws 7.10, to use xul inside of a browser, the type attribute cannot not be used. caption see groupbox checkbox <checkbox label='<!--label text-->' /> colorpicker <colorpicker type="button" palettename="standard" /> colorpicker appears to read color values out if the colorpicker can get ...
XML - Archive of obsolete content
interface widgets, the relationship between them, or grammar, and some built-in flexibility for using extra resources like images, html elements, and other standards-based technologies. but this is all you need to build any interface. xul is timely. only quite recently have the standards out of which xul was fashioned matured to a level where they might really be powerful and flexible enough to support the sort of development that xul provides for. as the figure below indicates, xul is an amalgam of these different standards: css for styling or "skinning", dom for the object model and scriptable access, javascript for the linking and behavior, rdf for resources, xml for the structure, and html for the content and some little extras. in this way, it's more like a developmentplatform or frame...
XUL Event Propagation - Archive of obsolete content
tion, whether to register a capturing listener); the event handler code argument can be in-line code or a function. the last boolean parameter specifies whether the event listener wants to use event capturing, or be registered to listen for events that bubble up the hiearchy normally. note: the dom provides the addeventlistener method for creating event listeners on nodes that do not otherwise supply them. but in xul, almost every element includes an "oncommand" event listener attribute for getting events. addeventlistener is the way to register event listeners for events other than the generalized "command" event, and the way to register a particular element for event capture, which preempts the regular flow of events. original author: ian oeschger other documents: w3c dom events, mozil...
action - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
assign - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
bbox - Archive of obsolete content
Archive › Mozilla › XUL › bbox
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
binding - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
bindings - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
box - Archive of obsolete content
Archive › Mozilla › XUL › box
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements vbox, hbox ...
broadcaster - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
broadcasterset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
browser - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata addprogresslistener( listener ) return type: no return value add a progre...
caption - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements groupbox, checkbox ...
checkbox - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulcheckboxelement ...
colorpicker - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement bugs the onchange event only fires if attribut...
column - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, rows, row ...
columns - Archive of obsolete content
...
command - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul:list of commands ...
commandset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
conditions - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
content - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata relacionados tbd ...
datepicker - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related stack ...
description - Archive of obsolete content
typically, this will cause the text to appea...
dialogheader - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements dialog, window ...
dropmarker - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
grippy - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
groupbox - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
hbox - Archive of obsolete content
Archive › Mozilla › XUL › hbox
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, vbox ...
image - Archive of obsolete content
Archive › Mozilla › XUL › image
this typically looks lik...
keyset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
label - Archive of obsolete content
Archive › Mozilla › XUL › label
these classes should be use...
listcell - Archive of obsolete content
specif...
listcol - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcols, listhead, listheader, listitem ...
listcols - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listhead, listheader, listitem ...
listhead - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listheader, listitem ...
listheader - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listhead, listitem ...
listitem - Archive of obsolete content
these classes should be u...
member - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and adds...
menubar - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menuitem, menulist, menupopup, menuseparator interfaces nsiacces...
menuitem - Archive of obsolete content
specif...
menulist - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value, description ) return type: element creates a new menuitem element a...
menuseparator - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menubar, menuitem, menulist, menupopup interfaces nsiaccessiblep...
notification - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata close() return type: no return value closes the notification or findbar and removes it from ...
notificationbox - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendnotification( label , value , image , priority , buttons, eventcallback ) return type: ...
observes - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
page - Archive of obsolete content
Archive › Mozilla › XUL › page
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
param - Archive of obsolete content
Archive › Mozilla › XUL › param
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
popupset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements popup, menupopup ...
prefpane - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata events paneload this event is fired on the pane element when the pane is fully loa...
progressmeter - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
query - Archive of obsolete content
Archive › Mozilla › XUL › query
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
queryset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements radiogroup, checkbox interfaces nsiaccessibleprovider, nsidomxulselect...
radiogroup - Archive of obsolete content
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and add...
resizer - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
row - Archive of obsolete content
Archive › Mozilla › XUL › row
...
rows - Archive of obsolete content
Archive › Mozilla › XUL › rows
...
rule - Archive of obsolete content
Archive › Mozilla › XUL › rule
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata decrease() return type: no return value decreases the value of the scale or...
script - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbar - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbox - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollcorner - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
separator - Archive of obsolete content
these classes should be u...
spacer - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements separator, splitter ...
spinbuttons - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
splitter - Archive of obsolete content
these classes should be u...
stack - Archive of obsolete content
Archive › Mozilla › XUL › stack
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related deck ...
statusbar - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessibleprovider ...
<statusbarpanel> - Archive of obsolete content
these classes should be u...
stringbundleset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata notes note: prior to gecko 1.9, disabling tabs fails; even while disabled, they still accept e...
tabbox - Archive of obsolete content
...
tabpanel - Archive of obsolete content
...
tabpanels - Archive of obsolete content
...
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata advanceselectedtab( dir, wrap ) return type: no return value if the argument dir is set to 1...
template - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
textnode - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
timepicker - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
titlebar - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
toolbarbutton - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, ...
toolbargrippy - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, tool...
toolbaritem - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbarpalette, toolbarseparator, to...
toolbarpalette - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolb...
toolbarseparator - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalett...
toolbarset - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalett...
toolbarspacer - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbar...
toolbarspring - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalett...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata startediting( row, column ) return type: no return value activates user editing of the given ...
treecell - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treerow and treeseparator.
treechildren - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata example <tree flex="1"> <treecols> <treecol id="sender" label="sender" flex="1"/> <t...
treecol - Archive of obsolete content
this class should be used i...
treecols - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecol, treechildren, treeitem, treerow, treecell and treeseparator.
treeitem - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treerow, treecell and treeseparator.
treerow - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treecell and treeseparator...
treeseparator - Archive of obsolete content
...
triple - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
vbox - Archive of obsolete content
Archive › Mozilla › XUL › vbox
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, hbox ...
where - Archive of obsolete content
Archive › Mozilla › XUL › where
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
wizardpage - Archive of obsolete content
attribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related wizard ...
XUL - Archive of obsolete content
how to perform drag and drop operations. overlays overlays are used to describe extra content for the ui. they provide a powerful mechanism for extending and customizing existing xul applications. xul periodic table this collection of xul demos used to be available as a web page, but can no longer be viewed in firefox since support for remote xul was disabled. there is a xulrunner application containing the xul periodic table which can be opened with gecko based browsers. you can get it here. see: using firefox 3 to run xulrunner applications for instructions on running xulrunner apps in firefox. view all... community ...
Building XULRunner - Archive of obsolete content
xulrunner is built using basically the same process as firefox or other applications. please read and follow the general build documentation for instructions on how to get sources and set up build prerequisites. by default, xulrunner is built with javaxpcom support; the build system must be able to find an appropriate jdk on the system; see the instructions on building javaxpcom for more details. if you do not want to build javaxpcom support, specify --disable-javaxpcom in your configuration. on mac, xulrunner requires mac os x 10.3 or higher and xcode 1.5 or higher to build properly. the runtime requirement is mac os x 10.2. a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/ob...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
same values specified in your xulrunner application's application.ini file. my app's .iss file sample as follows: ; script generated by the inno setup script wizard. ...
Custom app bundles for Mac OS X - Archive of obsolete content
ontents/ info.plist (application bundle properties are specified in this xml file.) pkginfo (this is a simple text file and is created along with the info.plist file) macos/ (the macos folder will contain your xulrunner executable) xulrunner (this is the xulrunner stub) resources/ (this is where you place your xul application code and support files) application.ini (xulrunner-related application settings) example.icns (this is the icon which will be used by your application bundle) chrome/ content/ example.xul (this directory contains your application's chrome) example.manifest defaults/ ...
XULRunner FAQ - Archive of obsolete content
thon or ...)? the goal of xulrunner is to facilitate development and deployment of internet applications. it is not meant to be a full-featured runtime; this allows xulrunner to maintain a smaller footprint and simpler deployment strategy than generic full-featured runtimes. if i use xulrunner do i have to write my application in xul? no! you can write your application in any language supported by the mozilla web platform, including html, xhtml, svg, or xul. so why is it called xulrunner, instead of htmlrunner or something? xul was always the original language of choice for ui in mozilla applications and the main library is called libxul, mostly the name is a hangover from that that has now stuck. when will firefox be based on xulrunner? there is no intention to do...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
in any case, you will have to build ldap xpcom, by adding --enable-ldap build option. see the build_documentation for more information about how to build xulrunner. when configuring build options, just add: ac_add_options --enable-ldap to your .mozconfig file. ...
MacFAQ - Archive of obsolete content
menu item to enable the mac "preferences" menu make sure that you use "menu_preferences" as the id for your options/preferences menu item toolbars mac windows have a small "jelly bean" button in the top right corner. this button is used to show/hide the toolbar. the toolkit will automatically enable this behavior if you add class="chromeclass-toolbar" to your <toolbar> element. commandline support commandline handlers work great on the mac if it's a cold start. here's how to implement command-line trapping when the app is already running, without getting into appleevents or c++ code. this is implemented in a pseudo "hidden window" technique and parsing the window arguments instead of command-line handlers and some of the toolkit singleton window code. taking advantage of the core code...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
the native soap interface was removed from gecko 1.9, those stuck speaking to soap apis need a new place to turn. after some experimentation, the following seems to be the best way to speak soap in xulrunner. several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested. it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoapclient. this library doesn't require a wsdl. though jquery is listed as a dependen...
Windows and menus in XULRunner - Archive of obsolete content
cation, you’ll notice that xulrunner gives your windows a default icon (top left corner on windows). you’ll most likely want to specify your own icons. you can learn how to do it in the article window icons. menus and toolbars most desktop applications are complex enough to require some sort of menu and/or toolbar to structure the application’s available commands. xul provides elements to support both menus and toolbars. building on the simple window code, here is what xul menus and toolbars look like: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src...
calIFileType - Archive of obsolete content
summary the califiletype interface provides information about a specific file type. califiletype is used in caliimporter and caliexporter to determine which file types are supported for import/export. status: unfrozen. defined in calendar/base/public/caliimportexport.idl interface code [scriptable, uuid(efef8333-e995-4f45-bdf7-bfcabbd9793e)] interface califiletype : nsisupports { readonly attribute astring defaultextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type. extensionfilter the extension filter to use in the filepicker's filter list. separate multiple extensions with semicolon and space. description the description to show to t...
Mozprofile - Archive of obsolete content
ithub.com/mozilla/mozbase/b...permissions.py resources other mozilla programs offer additional and overlapping functionality for profiles. there is also substantive documentation on profiles and their management. profilemanager : xulrunner application for managing profiles. has a gui and cli. python-profilemanager : python cli interface similar to profilemanager profile documentation : http://support.mozilla.com/kb/profiles ...
reftest opportunities files - Archive of obsolete content
to be checked. many of these were checked with the layout regression test tool, which has been described as difficult to use and it apparently reported a lot of regressions that were not errors. if you can look at the html in one of these pages, and can see a way to get the same visual ouptut, then that is an obvious reftest opportunity. for example, if some html is in an unexpected place and is supposed to be ignored, then we can match against an html file that is missing that extra mark-up. in other cases, the design of the reference page may take more subtlety. for now, create a bug in the core product, testing component in the bugzilla, if you can point to a file in this list and can attach the html reference that can be used to compare the output. any assistance or comments here would b...
xbDesignMode.js - Archive of obsolete content
ode. * * the initial developer of the original code is * netscape communications corporation. * portions created by the initial developer are copyright (c) 2003 * the initial developer. all rights reserved. ...
2006-11-22 - Archive of obsolete content
view the original post and unmask the e-mail address) michael would like to thank stormdragon for setting this up. click here for more details. new mailing list for nvda steve lee was pleased to announce that the mozilla foundation has approved a grant spearheaded by himself and aaron leventhal for "improved switch access to firefox". he expressed his gratitude and thanks everyone for being supportive during and after the summit. click here for more details. idispatch support for jaws scripting needed aaron leventhal stated that currently there is no idispatch support for iaccessible's in mozilla. if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=...
2006-10-13 - Archive of obsolete content
along with back, reload, etc.) questions about programming for firefox a student questions how to create an extension that changes fonts, and how to capture website content before it is displayed. firefox add-on wanted user is inquiring if there is such an application to automatically save pieces of a webpage everytime is it updated. firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the option to show pop-up windows, using window.open(), from inside untrusted script, to be re-implemented. this function was disabled, see bug: https://bugzilla.mozilla.org/show_bug.cgi?id=180048 meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-10-20 - Archive of obsolete content
aders in ie7, firefox and other assorted browsers. also a debate about which browser is "beating" which to a lesser extent further in the discussion. how to create firefox extension (chrome) to add images next to urls ? question regarding how to make a firefox extension that would insert an image next to all links in the loaded web pages similar to the mcafee siteadvisor extension. adding support for new uri scheme question regarding creating a new uri scheme for firefox on windows. helpful information was found here on mozillazine. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-10-26 - Archive of obsolete content
pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. (what it is, how to use it) cross-post-and followup fx2 announcment to support-firefox request for when the announcement about firefox 2's release to be posted on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about how to rebui...
2006-10-27 - Archive of obsolete content
pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. (what it is, how to use it) cross-post-and followup fx2 announcment to support-firefox request for when the announcement about firefox 2's release to be posted on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about how to rebui...
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - november 24, 2006 - december 1, 2006 announcements none this week. discussions firefox 2.0 should re-implement modal window.open to support web 2.0 a plea to re-implement the option to show modal windows, using window.open(), from inside an untrusted script. this implementation was removed in 2002 to fight against popups. xml in firefox is a major problem a major debate surrounding the use of xml for customizing rss feeds. devs say this is the way its supposed to be, others say its a bug! the debate continues. discussion of support for modal windows within firefox 2.0 a lengthy post regarding the re-implementation of modal windows into firefox. basic feature that i think is a must in any web broswer a discussion revolving around...
2006-10-06 - Archive of obsolete content
hence, they are looking for a mac user to test out the new features by building a mac.rdf file with all of the various .mac account properties mentioned in the document here. ...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.apps.thunderbird - november 18 - 24, 2006 announcements none for this week discussions issues with 2.0 features there's renewed discussion on why certain features were removed in the 2.0 release, and the addition of support for s/mime and not pgp/gpg encryption. additional links: bug 22687 and original newsgroup thread. thunderbird losing emails tb seems to be deleting mail folders when they reach 4gb in size. exact cause is unknown but may be related to multiprocessor platforms. meetings none for this week ...
2006-10-13 - Archive of obsolete content
gets an error in the middle of his build. he has disabled xft and has tried looking at related postings by benjamin smedberg gcc-40-workarounds and gcc-and-visibility-one-step-forward-hit-a-brick-wall announcements please help us test the new tinderbox and bonsai server installations paul reed announced that they are setting up a new installation of the tinderbox and bonsai servers onto new, supported hardware. some testing and validation has been done, but they would like other people to look at the installations and complete the setup before they switch over. new tinderbox installation new bonsai installation if any inconsistencies are found please use bugzilla to let them know discussions there were no discussions this week. meetings there were no meetings this week. ...
2006-10-20 - Archive of obsolete content
luna, a machine used to create gtk1 builds, with a machine thats sole responsibility is to only the tests on builds from the official nightly machines. on october 20th j. paul reed responded to robert kaiser's post: j. paul reed replies to robert kaiser post and asks him to confirm the intention of his post. j. paul reed also questions why gtk1 is still being built since it is know to be unsupported on trunk. on october 20th boris zbarsky responded to j. paul reed previous post: boris zbarsky answered j. paul reed's question that was posted in his previous reply. j. paul reed had asked "why gtk1 was still being built". boris zbarsky's said: the reason why gtk1 builds are still being performed is because: when requests are made to change build boxes to newer versions the people re...
2006-10-20 - Archive of obsolete content
usses his desire to make xul/browser based applications. he wants to be able to build applications that will run inside the browser. nickolay ponomarev, benjamin smedberg, axel hecht clarify some misconceptions about front-end and back-end programming with xulrunner, including the difficulty of writing the backends in c++ (since that would require a recompilation on every platform frank wanted to support). meetings no meetings this week ...
2006-11-17 - Archive of obsolete content
ructions and the current list of known regressions on the branch can be found at: http://wiki.mozilla.org/gecko:reflow...ng#quick_links. users are asked to file bugs on encountered problems that are not present on the current trunk builds. if bugs are filed, "[reflow branch]" should be placed at the beginning of the summary. parsing html into a document object in fx3 discussion if gecko 1.9 will support parsing html into a document object. the possibility of turning the microsummaryresource object into a xpcom component, which accomplishes this task in a "hacky" manner, was also discussed. meetings none this week. ...
2006-12-08 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - dec 02- dec 08, 2006 announcements none during this week. discussions xpcom cpp to js callback engaging discussion on a problem with trying to call back from c++ to a javascript object using an interface the developer created with an idl. however, the c++ call that's supposed to be invoking the method on the javascript 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 javascript meetings none during this week. ...
Browser-side plug-in API - Archive of obsolete content
, and so forth. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. npn_destroystream npn_forceredraw npn_getauthenticationinfo npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_invalidaterect npn_invalidateregion npn_memalloc npn_memflush npn_memfree npn_newstream npn_pluginthreadasynccall npn_poppopupsenabledstate npn_posturl npn_posturlnotify npn_pushpopupsenabledstate npn_reloadplugins...
NPN_PostURLNotify - Archive of obsolete content
e request with the subsequent npp_urlnotify call, which returns this value (see description below). returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_posturlnotify functions identically to npn_posturl, with these exceptions: npn_posturlnotify supports specifying headers when posting a memory buffer. npn_posturlnotify calls npp_urlnotify upon successful or unsuccessful completion of the request. for more information, see npn_posturl. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. if this function is called with a target parameter value of _self or a parent ...
NPN_RequestRead - Archive of obsolete content
eek mode initially (since the browser must cache all the stream data on disk in order to access it randomly). if npn_requestread() is called on a stream that is not inherently seekable and not initially in mode np_seek, it returns the error code nperr_stream_not_seekable. typically, the only streams that are inherently seekable are those from in-memory or on-disk data, or from http servers that support byte-range requests. see also npp_newstream() npp_writeready() npp_write() npstream ...
NPN_UserAgent - Archive of obsolete content
he following parameter: instance pointer to the current plug-in instance. returns a pointer to a buffer that contains the user agent field of the browser. description the user agent is the part of the http header that identifies the browser during transfers. you can use this information to verify that the expected browser is in use, or you can use it in combination with npn_version() to supply different code for different versions of the same browser. see also npn_status() npn_version() gecko user agent string reference ...
NPN_Version - Archive of obsolete content
ent version. you can use npn_version() to inquire on version constants (npvers constants), which represent particular browser features. once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. for example, the plug-in could inquire on the constant npvers_has_windowless to see if it is running in a browser that supports windowless functionality. for more information and an example, see finding out if a feature exists. for a listing of version constants defined in the plug-in api, see version feature constants. note: platform-specific code in the plug-in api files npwin.cpp, npmac.cpp, or npunix.c checks version numbers automatically. a plug-in whose major version is less than the major version of the brow...
NPP_HandleEvent - Archive of obsolete content
is responsible for delivering to the plug-in, see the npevent structure. ms windows the browser gives each windowed plug-in its own native window, often a child window of the browser window, to draw into. the plug-in has complete control over drawing and event handling within that window. mac os the browser does not give a windowed plug-in a native window, because the mac os platform does not support child windows. instead, the windowed plug-in draws into the graphics port associated with the the browser window, at the offset that the browser specifies. for this reason, npp_handleevent is only way the plug-in can receive events from its host application on mac os. when npp_handleevent is called, the current port is set up so that its origin matches the top-left corner of the plug-in. a pl...
NPP_NewStream - Archive of obsolete content
npstream* stream, npbool seekable, uint16* stype); parameters the function has the following parameters: instance pointer to current plug-in instance. type pointer to mime type of the stream. stream pointer to new stream. seekable boolean indicating whether the stream is seekable: true: seekable. stream supports random access through calls to npn_requestread (for example, local files or http servers that support byte-range requests). false: not seekable. the browser must copy data in the stream to the local cache to satisfy random access requests made through npn_requestread. stype out parameter. the plugin should set this value to request a mode for the stream. for more information about...
NPP_URLNotify - Archive of obsolete content
with network, disk i/o, lack of memory, or other problems. notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call. description the browser calls npp_urlnotify() after the completion of a npn_geturlnotify() or npn_posturlnotify() request to inform the plug-in that the request was completed and supply a reason code for the completion. the most common reason code is npres_done, indicating simply that the request completed normally. other possible reason codes are npres_user_break, indicating that the request was halted due to a user action (for example, clicking the stop button), and npres_network_err, indicating that the request could not be completed, perhaps because the url could not be ...
NP_GetMIMEDescription - Archive of obsolete content
each mime type description should be separated by a semicolon (;). each mime type description contains the mime type, an extensions list and a short description. ...
Entity list - Archive of obsolete content
note: there are 3 different versions of rss 0.91. there is netscape's rss 0.91 (revision 1) (n 0.91 r1), netscape's rss 0.91 revision 3 (n 0.91 r3) and userland's rss 0.91 (u 0.91). netscape's rss 0.91 uses a dtd which defines 96 additional named entities. ...
Syndicating content with RSS - Archive of obsolete content
(and other) feeds use a special icon. it is recommended that you too use this icon when creating the special <a> link to your feed. the icon looks like the following: you can get more icons like this from feed icons. (other sizes and colors, along with their source files, are available too.) advanced syndication techniques although this advanced technique for syndication is not required, support of this is recommended, especially for web sites and applications with high performance needs. the http protocol, one of the core technologies behind the web, provides a way of prioritizing the content type that an http client prefers to receive. this technique takes advantage by having the client prefer rss (over html or other formats). here's a simple example of it being done: accept: app...
What is RSS - Archive of obsolete content
and's rss 0.92. in august 2002 userland released a draft for rss 0.94. like rss 0.93, this version of rss was never made "final" and was also only a draft, and never became a replacement for userland's rss 0.92. so at this point we still had netscape's rss 0.91, the rss-dev working group's rss 1.0, and userland's rss 0.92. (although some were using rss 0.93 and rss 0.94 even though they weren't supposed to.) in september 2002 userland released rss 2.0. rss 2.0 was meant to be a replacement for rss 0.92 (and the rss 0.93 and rss 0.94 drafts that no one was supposed to use). userland bumped up the version number all the way up to 2.0 because the rss-dev working group already used 1.0 with their rdf-based rss 1.0. so at this point we had netscape's rss 0.91, the rss-dev working group's rss 1...
Why use RSS - Archive of obsolete content
ryone is using it. rss has a huge amount of momentum. people are using it to syndicate all sorts of things: news articles, blogs, bookmarks, internet radio shows, internet television shows, software updates, e-mails, mailing lists, music playlists, and more. if it is episodic, it can be syndicated with rss. software that reads and can make use of rss is also everywhere. mozilla firefox has some support for rss (with it's live bookmark technology.). there are too many desktop and web-based rss aggregators out there to list them all. also, custom-made software is also making use of rss. rss aggregators are everywhere one reason to use rss to syndicate is because there are an enormous amount of desktop and web-based rss aggregators out there. (too many to list.) and if you syndicate using rs...
Proposal - Archive of obsolete content
note: those in the list below that are marked "in development" should not be implemented. "in development" means that they are still working on it and trying to come up with a draft. those labeled with "draft exists" can be implemented, but be warned that they could radically change. ...
Encryption and Decryption - Archive of obsolete content
hm is determined by finding the fastest method to break the algorithm and comparing it to a brute force attack. for symmetric keys, encryption strength is often described in terms of the size or length of the keys used to perform the encryption: in general, longer keys provide stronger encryption. key length is measured in bits. for example, 128-bit keys for use with the rc4 symmetric-key cipher supported by ssl provide significantly better cryptographic protection than 40-bit keys for use with the same cipher. roughly speaking, 128-bit rc4 encryption is 3 x 1026 times stronger than 40-bit rc4 encryption. (for more information about rc4 and other ciphers used with ssl, see "introduction to ssl.") an encryption key is considered full strength if the best known attack to break the key is no fa...
Threats - Archive of obsolete content
ed recipient. impersonation can take two forms: spoofing. a person can pretend to be someone else. for example, a person can pretend to have the email address jdoe@example.net, or a computer can identify itself as a site called www.example.net when it is not. this type of impersonation is known as spoofing. misrepresentation. a person or organization can misrepresent itself. for example, suppose the site www.example.net pretends to be a furniture store when it is really just a site that takes credit-card payments but never sends any goods. malware. website malware is a growing problem. business needs have changed the way websites store sensistive data, with more usage of cloud services. but hackers may make out money, data and confidential information from your website by infec...
The Basics of Web Services - Archive of obsolete content
ion as said before, rss and atom feeds are a simple example of how a web service works, most commonly, xml-rpc or soap are also used to communicate between a server and a client. introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used. xml-rpc was developed by useful inc, along with microsoft. warning: xml-rpc support was removed from firefox starting with firefox 3. introducing soap soap, a web service, is listed as a w3c standard, and is similar in ways to xml-rpc. soap also has backing from ibm, as well as microsoft. warning: soap support was removed from firefox starting with firefox 3. soap or xml-rpc? briefly, soap was intended to fill gaps in xml-rpc. an example is, it is easier to send a multi...
contents.rdf - Archive of obsolete content
copy the following text and paste it into a text file, then save that file as "contents.rdf": <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <!-- list all the skins being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:my_theme"/> </rdf:seq> <rdf:description about="urn:mozilla:skin:my_theme" chrome:displayname="my theme" chrome:accesskey="n" chrome:author="" chrome:authorurl="" chrome:description="" chrome:name="my_theme" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:my_theme:packages"> <rdf:li resource="urn:mozilla:skin:my_...
install.rdf - Archive of obsolete content
--> <em:targetapplication> <description> <!-- firefox's uuid --> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <!-- my_theme --> <em:name>my_theme</em:name> <em:description...
Theme changes in Firefox 3 - Archive of obsolete content
t is half of the width of the indicator image. also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml. as a result, the 'display' property should be removed from .tab-drop-indicator-bar (including for dragging="true"). mac os x file description of change browser/themes/pinstripe/browser/tabbrowser/tabdragindicator.png removed superfluous blank pixels from the edges, so that the image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-tab[first-tab="true"] > .tab-image-left no longer has a margin-left. instead .tabs-left now displayed and given the same width as the former margin-left. it was already done this way in winstripe. changes...
Summary of Changes - Archive of obsolete content
http://www.w3.org/tr/2004/rec-dom-le...e3-textcontent ie5+ elemref.style.pixeltop dom level 2: parseint(elemref.style.top, 10) ie5+ elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; ie5+ new activexobject("microsoft.
Using Web Standards in your Web Pages - Archive of obsolete content
the first 2 sections address exclusively validation issues, benefits of validation, deprecated elements, deprecated attributes. ...
Using workers in extensions - Archive of obsolete content
orker threads in extensions to perform tasks in the background without blocking the user interface. if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension localizing an extension updating an extension to support multiple mozilla applications download the sample you may download the complete example: download the example. how this differs from previous versions this version of the stock ticker extension moves the xmlhttprequest call that fetches updated stock information into a worker thread, which then passes that information back to the main body of the extension's code to update the displa...
-moz-text-blink - Archive of obsolete content
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values none produces no blinking. blink text blinks. note that not blinking the text is one technique to satisfy checkpoint 3.3 of wai-uaag. ...
-moz-window-shadow - Archive of obsolete content
however, for these windows shadows were turned off and there was no way to turn them on. in firefox 3.5 the default changed, with all windows having a shadow. this version introduced the -moz-window-shadow css property to provide a way to turn off unwanted shadows. ...
-ms-accelerator - Archive of obsolete content
receives the focus. <!doctype html> <html> <head> <title>accelerator</title> </head> <body> <label for="oname"><u style="-ms-accelerator: true; accelerator: true">n</u>ame: </label> <input type="text" id="oname" size="25" accesskey="n" value="your name here" /> </body> </html> specifications not part of any specification. remarks this property is supported by windows 2000 and later. it enables users to hide navigation indicators for menu items and controls until the alt key is pressed. an access key is a single character used as a keyboard shortcut for selecting an object. the user presses the alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object. in i...
-ms-content-zoom-chaining - Archive of obsolete content
this property requires windows 8 or later. ...
-ms-content-zoom-limit-max - Archive of obsolete content
centage> the maximum zoom factor. formal syntax <percentage> specifications not part of any specification. remarks this property constrains the limit for touch zooming as well as values of the mscontentzoomfactor property. this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-limit-min - Archive of obsolete content
centage> the minimum zoom factor. formal syntax <percentage> specifications not part of any specification. remarks this property constrains the limit for touch zooming as well as values of the mscontentzoomfactor property. this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-limit - Archive of obsolete content
imit-min property. -ms-content-zoom-limit-max value of the -ms-content-zoom-limit-max property. formal syntax <'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'> specifications not part of any specification. remarks this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-snap-points - Archive of obsolete content
ontact (for instance, a finger), the content can continue to move with inertia. snap-points can change the animation that runs when the user lifts his or her finger so that you can adjust where the content will stop. by placing snap-points, you can make it easy for your users to manipulate your content and make it stop at convenient or key places. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zoom-snap-type - Archive of obsolete content
ontact (for instance, a finger), the content can continue to move with inertia. snap-points can change the animation that runs when the user lifts his or her finger so that you can adjust where the content will stop. by placing snap-points, you can make it easy for your users to manipulate your content and make it stop at convenient or key places. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows or later. ...
-ms-content-zoom-snap - Archive of obsolete content
property. -ms-content-zoom-snap-points value of the -ms-content-zoom-snap-points property. formal syntax <'-ms-content-zoom-snap-type'> | <'-ms-content-zoom-snap-points'> specifications not part of any specification. remarks this property has no effect on non-zoomable elements. see -ms-content-zooming for details on zoomable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-content-zooming - Archive of obsolete content
ment is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. by default, zoom-enabled elements can be zoomed by the user via pinch-zoom. the top-level element can also be zoomed via double-tap when it is zoom-enabled. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-hyphenate-limit-zone - Archive of obsolete content
ueas specifiedanimation typediscrete syntax values <percentage> an integer followed by a percent sign (%), which specifies the width of the hyphenation zone, calculated with respect to the line box. negative values are not allowed. <length> a floating-point number, followed by a relative units designator, that indicates the width of the hyphenation zone. for more information about supported length units, see css basic data types. negative values are not allowed. formal syntax <percentage> | <length> specifications not part of any specification. remarks the -ms-hyphenate-limit-zone property enables you to control the amount of trailing whitespace permitted during hyphenation. the hyphenation zone is always at the logical right side of the padding box. a word is c...
-ms-scroll-rails - Archive of obsolete content
discrete syntax values none the content moves exactly with the user's finger. this value allows for free-form panning. railed initial value. panning locks to the primary axis of motion. formal syntax none | railed specifications not part of any specification. remarks this property has no effect on non-scrollable elements. starting with windows 8.1, this property is also supported for touchpad interaction. this property requires windows 8 or later. ...
-ms-scroll-snap-points-x - Archive of obsolete content
...
-ms-scroll-snap-points-y - Archive of obsolete content
...
-ms-scroll-snap-x - Archive of obsolete content
...
-ms-scroll-snap-y - Archive of obsolete content
have the same effect. .scroll1 { -ms-scroll-snap-type: mandatory; -ms-scroll-snap-points-y: snapinterval(0, 100%); } .scroll2 { -ms-scroll-snap-y: mandatory snapinterval(0, 100%); } specifications not part of any specification. remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction. ...
-ms-wrap-margin - Archive of obsolete content
other shapes. initial value0applies toexclusion elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values <length> the margin size, a non-negative value. formal syntax <length> specifications not part of any specification. remarks offsets created by the -ms-wrap-margin property are offset from the outside of the exclusion. this property can be set to any supported length value. ...
:-moz-system-metric(images-in-menus) - Archive of obsolete content
this selector is intended for use mainly by theme developers. ...
:-moz-system-metric(touch-enabled) - Archive of obsolete content
note: since firefox 58, this pseudo-class is no longer available to web content — it is only available internally (e.g. ...
::-ms-browse - Archive of obsolete content
...
::-ms-clear - Archive of obsolete content
the clear button is only shown on focused, non-empty text controls. this includes inputs that appear text-like or fall back to type="text". ...
::-ms-fill-lower - Archive of obsolete content
...
::-ms-fill-upper - Archive of obsolete content
see also ::-ms-fill-lower ::-ms-track ::-ms-thumb ::-moz-range-progress css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
-moz-touch-enabled - Archive of obsolete content
otherwise it's 0. media: media/visual accepts min/max prefixes: no example you might use this feature to render your buttons slightly larger if the user is on a touch-screen device, to make them more finger-friendly. ...
display-inside - Archive of obsolete content
...
CSS - Archive of obsolete content
Archive › Web › CSS
icker of <input type="file">.::-ms-checkthe ::-ms-check css pseudo-element is a microsoft extension that represents checkboxes and radio button groups created by <input type="checkbox"> and <input type="radio">.::-ms-clearthe ::-ms-clear css pseudo-element creates a clear button at the edge of an <input type="text"> text control that clears the current value. this pseudo-element is non-standard, supported only in internet explorer 10, internet explorer 11, and microsoft edge.::-ms-expandthe ::-ms-expand css pseudo-element is a microsoft extension that represents the button of a <select> menu control that opens or closes the drop-down menu. typically it is a triangle that points downward.::-ms-fillthe ::-ms-fill css pseudo-element is a microsoft extension that represents a progress bar displa...
Displaying notifications (deprecated) - Archive of obsolete content
this non standard api has been dropped in firefox 22 in favor of the standard api. to see how to use the standard api, please read: using web notifications mobile only in gecko 2.0 available only in firefox mobile as of gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system provided by the operating system. for example, on android, notifications appear in the bar at the top of the screen, and in the panel that appears when you drag that bar downward. creating a notification the first thing you need to do is create the notification object ...
Namespaces - Archive of obsolete content
mozilla.org/keymaster/gat...re.is.only.xul"; var b = <label>more text</label>; a.appendchild(b); gives <p xmlns="http://www.w3.org/1999/xhtml"> some text <label xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul">more text</label> </p> name() using name() on an xml object returns a qname object (qualified name). qname is a global constructor available in javascript implementations supporting e4x. qname objects have two properties of particular relevance. the localname property returns the name of the element, without any namespace prefix. the uri property returns the uri of the namespace that the element is in. var info = a.name(); info.localname; // returns 'p'. info.uri; // returns "http://www.w3.org/1999/xhtml" elements in no namespace return the empty string as their uri...
ArrayBuffer.transfer() - Archive of obsolete content
0 buf2.bytelength; // 80 new int32array(buf2)[0]; // 42 var buf3 = arraybuffer.transfer(buf2, 0); buf2.bytelength; // 0 but if you use the polyfill then the value is still 80 buf3.bytelength; // 0 polyfill you can partially work around this by inserting the following code at the beginning of your scripts, allowing use of much of the functionality of transfer() in browsers that do not natively support it. this is not the exact equivalent of this api because browsers that natively support it are be able to internally use the c++ function realloc() which extends the length of the memory and only copies it to a new location as-needed as opposed to the following pollyfill which always copies the whole thing to a new space of memory, but this function transfers data from one arraybuffer to anot...
Generator comprehensions - Archive of obsolete content
be problematic. generators enable lazy computation of sequences, with items calculated on-demand as they are needed. generator comprehensions are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as short hand syntax for creating generators. suppose we have an iterator it which iterates over a large sequence of integers. we want to create a new iterator that will iterate over their doubles. an array comprehension would create a full array in memory containing the doubled values: var doubles = [for (i in it) i * 2]; a generator comprehension on the other hand would create a new iterator which would create doubled values on demand as th...
Debug.debuggerEnabled - Archive of obsolete content
the debug.debuggerenabled property determines whether debugging is enabled for the script context. debugging may be enabled or disabled whether or not a debugger is attached. syntax var dbgenabled = debug.debuggerenabled; requirements supported in the following document modes: internet explorer 10 standards and internet explorer 11 standards. also supported in store apps (windows 8 and windows phone 8.1). not supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards. ...
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
ceasynccallbackstarting(opid); // process result of async operation. }, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows phone 8.1). not 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. not supported in windows 8. ...
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
ceasynccallbackstarting(opid); // process result of async operation. }, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows phone 8.1). not 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. not supported in windows 8. ...
Debug.setNonUserCodeExceptions - Archive of obsolete content
ions. setting this property to false is the same as never having set the property. for more information on debugging, see the active script debugging overview. example the following code shows how to set this property. (function () { debug.setnonusercodeexceptions = true; try{ var x = null; x.y(); } catch (e) { // catch the exception. } })(); requirements supported in the following document modes: internet explorer 10 standards and internet explorer 11 standards. also supported in store apps (windows 8 and windows phone 8.1). not supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards. ...
Debug.write - Archive of obsolete content
the script debugger. note: to run this example, you must have a script debugger installed and the script must run in debug mode. internet explorer 8 includes the javascript debugger. if you are using an earlier version of internet explorer, see how to: enable and start script debugging from internet explorer. var counter = 42; debug.write("the value of counter is " + counter); 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. also supported in store apps (windows 8 and windows phone 8.1). ...
Debug.writeln - Archive of obsolete content
script debugger. note: to run this example, you must have a script debugger installed and the script must run in debug mode. internet explorer 8 includes the javascript debugger. if you are using an earlier version of internet explorer, see how to: enable and start script debugging from internet explorer. var counter = 42; debug.writeln("the value of counter is " + counter); 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. also supported in store apps (windows 8 and windows phone 8.1). applies to: debug ...
Error.stackTraceLimit - Archive of obsolete content
stacktracelimit is set to infinity, the entire stack is shown. otherwise, touint32 is used to convert the value. example the following example shows how to set and then get the stack trace limit. try { var err = new error("my error"); error.stacktracelimit = 7; throw err; } catch(e) { document.write("error stack trace limit: ") document.write(error.stacktracelimit); } requirements supported in internet explorer 10 and in windows 8.x store apps. applies to: error object ...
ScriptEngine() - Archive of obsolete content
riptengine function gets the name of the scripting language in use. syntax scriptengine() remarks the scriptengine function returns "jscript", which indicates that javascript is the current scripting engine. example the following example illustrates the use of the scriptengine function: if (window.scriptengine) { console.log(window.scriptengine()); } // output: jscript 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. also supported in store apps (windows 8 and windows phone 8.1). ...
Microsoft JavaScript extensions - Archive of obsolete content
warning: these apis will only work in microsoft applications, and are not on a standards track. microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard javascript apis. objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion statements @cc-on @if @set other date.getvardate() error.description error.number error.stacktracelimit ...
New in JavaScript 1.1 - Archive of obsolete content
javascript versions netscape navigator 3.0 also introduced javascript language versions. <script language="javascript"> <!-- javascript for navigator 2.0. ...
New in JavaScript 1.2 - Archive of obsolete content
javascript versions netscape navigator 4.0 executes javascript language versions up to 1.2. note that netscape navigator 3.0 and earlier ignored scripts with the language attribute set to "javascript1.2" and higher. ...
New in JavaScript 1.3 - Archive of obsolete content
changed functionality in javascript 1.3 changes to date to conform with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) ...
New in JavaScript 1.6 - Archive of obsolete content
the following is a changelog for javascript 1.6. this version was included in firefox 1.5 (gecko 1.8), which was released in november 2005. the corresponding ecma standard is ecma-262 edition 3 and ecmascript for xml (e4x) with some additional features. several new features were introduced: e4x, several new array methods, and array and string generics. new features in javascript 1.6 support for ecmascript for xml (e4x) for creating and processing xml content within javascript has been added. see for details. array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug i...
New in JavaScript 1.7 - Archive of obsolete content
ying the javascript version. new features in javascript 1.7 the following features added with javascript 1.7 were not part of an ecma-262 standard at the time. in more recent firefox versions, the implementation is updated to work with semantics as specified in ecmascript edition 6. please see the reference pages for differences. iterators and generators array comprehensions let statement (support for let expression was dropped in gecko 41, see bug 1023609). const statement destructuring assignment (support for js1.7 style destructuring for-in was dropped in gecko 40, see bug 1083498). ...
New in JavaScript 1.8.1 - Archive of obsolete content
the following is a changelog for javascript 1.8.1. this version was included in firefox 3.5. javascript 1.8.1 is a modest update syntactically to javascript; the main change in this release is the addition of the tracemonkey just-in-time compiler, which improves performance. new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript. this makes the behavior of setting the values of properties more predictable. ...
for each...in - Archive of obsolete content
consider using for...of instead. firefox now warns about the usage of for each...in and it no longer works starting with firefox 57. please see warning: javascript 1.6's for-each-in loops are deprecated for migration help. the for each...in statement iterates a specified variable over all values of object's properties. for each distinct property, a specified statement is executed. syntax for each (variable in object) { statement } variable variable to iterate over property values, optionally declared with the var keyword. this variable is local to the function, not to the loop. ...
LiveConnect - Archive of obsolete content
documentation java plugin - liveconnect documentation this is likely the most up-to-date documentation of liveconnect. ...
JavaArray - Archive of obsolete content
ype parameter. properties length: the number of elements in the java array represented by javaarray. methods tostring: in javascript 1.4, this method is overridden by the inherited method java.lang.object.tostring. in javascript 1.3 and earlier, this method returns a string identifying the object as a javaarray. in javascript 1.4 and later, javaarray also inherits methods from the java array superclass, java.lang.object. examples example: instantiating a javaarray in javascript in this example, the javaarray bytearray is created by the java.lang.string.getbytes method, which returns an array. var javastring = new java.lang.string("hello world!"); var bytearray = javastring.getbytes(); example: instantiating a javaarray in javascript with the newinstance method in javascript 1.4, y...
JavaObject - Archive of obsolete content
ny java data brought into javascript is converted to javascript data types. when the javaobject is passed back to java, it is unwrapped and can be used by java code. see the core javascript 1.5 guide for more information about data type conversions. properties inherits public data members from the java class of which it is an instance as properties. it also inherits public data members from any superclass as properties. methods inherits public methods from the java class of which it is an instance. the javaobject also inherits methods from java.lang.object and any other superclass. examples example: instantiating a java object in javascript the following code creates the javaobject thestring, which is an instance of the class java.lang.string: var thestring = new packages.java.lang.st...
JavaPackage - Archive of obsolete content
avapackage and javaclass hierarchy reflect the java package and class hierarchy. although the packages and classes contained in a javapackage are its properties, you cannot use a for...in statement to enumerate them as you can enumerate the properties of other objects. properties the properties of a javapackage are the javaclass objects and any other javapackage objects it contains. examples suppose the redwood corporation uses the java redwood package to contain various java classes that it implements. the following code creates the javapackage red: var red = packages.redwood; see also javaarray, javaclass, javaobject, packages ...
Packages - Archive of obsolete content
obsolete since gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary a top-level object used to access java classes from within javascript code. the support for this object was removed in gecko 16, see liveconnect for details. created by the packages object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method. description the packages object lets you access the public methods and fields of an arbitrary java class from within javascript. the java, netscape, and sun properties represent the packages java.*, netscape.*, and sun.* respectiv...
java - Archive of obsolete content
created by the java object is a top-level, predefined javascript object. you can automatically access it without using a constructor or calling a method. ...
ParallelArray - Archive of obsolete content
the goal of parallelarray was to enable data-parallelism in web applications. the higher-order functions available on parallelarray attempted to execute in parallel, though they may fall back to sequential execution if necessary. to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports. syntax new parallelarray() new parallelarray([element0, element1, ...]) new parallelarray(arraylength, elementalfunction) parallelarray instances properties length reflects the number of elements in the parallelarray. methods map reduce scan scatter filter flatten partition get examples using map in parallel var p = new parallelarray([0, 1, 2, 3, 4]); var m = p.map(function (v) { ...
Sharp variables in JavaScript - Archive of obsolete content
this feature has been removed in bug 566700, firefox 12. form sharp variables have the form of a sharp sign (#) immediately followed by one or more digits. ...
Window.importDialog() - Archive of obsolete content
er. there may also be large incompatibilities between implementations and the behavior may change in the future. obsoletethis feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this function was only available in the original, xul-based version of firefox for android, which is no longer supported; for that reason, this function is obsolete and should never be used. summary because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. syntax newdialog = importdialog(aparent, asrc, aarguments) n...
Writing JavaScript for XHTML - Archive of obsolete content
(e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error. problem: i want to remain forward compatible! given the direction away from formatting attributes and the possibility of xhtml becoming eventually more prominent (or at least the document author having the possibility of later wanting to make documents available in xhtml for browsers that support it), one may wish to avoid features which are not likely to stay compatible into the future. solution: avoid html-specific dom the html dom , even though it is compatible with xhtml 1.0, is not guaranteed to work with future versions of xhtml (perhaps especially the formatting properties which have been deprecated as element attributes). the regular xml dom provides sufficient methods via t...
Building Mozilla XForms - Archive of obsolete content
firefox 3.5 and up: get the ...
Troubleshooting XForms Forms - Archive of obsolete content
ly from the filesystem, make sure that has .xhtml or .xml as the file ending. if you are loading the form from a server, make sure that it serves the files as either application/xhtml+xml or text/xml. check the xhtml 1.0 namespace declaration mozilla xforms is built upon the xhtml 1.0 specification, which is located at http://www.w3.org/1999/xhtml . ensure that your <html> element contains the supported namespace declaration: xmlns="http://www.w3.org/1999/xhtml" (instead of the newer, unratified version, xhtml 2.0, located at http://www.w3.org/2002/06/xhtml2 ) inline instance, no controls get bound have you remembered to use the correct namespace for the instance nodes? for an inline instance you most probably need to have <xf:instance xmlns=""> .... any instance, no controls get bou...
Requests For Enhancement - Archive of obsolete content
Archive › Web › XForms › RFE
build really powerful web apps and reduce the need for javascript by 90%. now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript! dan mccreary. one of the outstanding features of xforms is that it can work with any xml host language. natively, the mozilla xforms implementation supports xforms elements being hosted in xhtml and xul documents. but a form author is not restricted to only those xml languages that gecko knows. a lot of the xforms capabilities are reachable by using our custom controls interfaces. our custom control interfaces allows for the exchange of data between any xml element and and an xforms model. this means that an author can write powerful mozilla-bas...
XForms Input Element - Archive of obsolete content
t-used xforms element to show and change the instance data to which this xforms control is bound (see the spec). attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding special inputmode - not supported for this control incremental - supported. the default value is 'false'. mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xf...
XForms Label Element - Archive of obsolete content
output and choices elements must contain a label element. it is valid for a form control to have an empty label element. the label text can be specified in instance data, in a remote document, or as inline text. if more than one source of label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on labeled xforms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the label text. focus behavior - when a label element is clicked or its accesskey is activated then the form control that contains the...
XForms Range Element - Archive of obsolete content
introduction allows the user to choose a value from within a specific range of values (see the spec). attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special incremental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for incrementing/decrementing values start/end/step attributes if the value of the bound instance node is outside the range of values specified by the start and end attributes, then the range element receives a xforms-out-of-range event. if the bound value then becomes in range, the range element receives a xforms-in-range event. start specifies the lower bound of possible values, i.
XForms Upload Element - Archive of obsolete content
limit the types of files that the user can select from. visually, the upload control is shown as a file picker dialog that hides disallowed (filtered) file types. the xforms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element. attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64binary or xsd:hexbinary or any type derived from one of these. representations the xforms upload element is represented by visua...
Mozilla XForms User Interface - Archive of obsolete content
introduction this article is a quick reference of the xforms user interface elements. mainly this is aimed to document how xforms elements will be presented in mozilla since the xforms specifications give only a hint of how controls might be rendered. currently xforms can be hosted by xhtml and xul in seamonkey and firefox. later we have plans to support xforms hosted by svg. the xforms specs define two kinds of xforms ui elements, called 'form controls' and 'xforms user interface'. elements from the "form controls" group allows users to interact with instance data. the set of "xforms user interface" elements exist to aid form authors in combining host language markup and xforms markup together in order to build user interfaces. some of the 'form controls' can have multiple appearance...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
mily, to match the user's preferences setting, thus emulating the behavior of old browsers. this only happens when gecko is in "quirks" mode; in "standards" mode, all styles are inherited by tables as permitted by the css specification. in those cases where it is necessary to author documents in "quirks" mode, but the breaking of table inheritance is not desired, authors can use gecko's standards support to overcome the table-font rule shown above. the value -moz-initial is a proprietary value used to apply the user's (or browser's) default setting for a given property to an element. because it is not actually part of css, it is marked with the prefix -moz- in order to avoid confusion about what is or isn't part of css. overcoming legacy behavior all that is needed is a rule that overrides...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
that are now causing problems for some web sites. this technote explains the source of the problems and how to avoid encountering them. many authors make use of the css2 pseudo-class :hover to style their links. this innovation, first introduced by microsoft® internet explorer and later adopted into the css specification, is very popular for the styling of text links, particularly those that are supposed to look and act like javascript-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering behavior on some pages. hover and non-link elements section 5.11.3 of css2 defines the three dynamic pseudo-classes (:hover, :active, and :focus) and then goes on to say: css doesn't define which elements may be in the above states, or how the sta...
XUL Booster - Archive of obsolete content
create an extension you'll need an extension id; see generating guids. add an overlay you'll need the chrome address of the content you wish to overlay, ex. chrome://browser/content/browser.xul. learn more at creating_a_mozilla_extension:finding_the_file_to_modify to create an xul:overlay, create a xul fragment with a top level node that has an id matching an existing element, ex. ...
Anatomy of a video game - Game development
d. let us start by assuming that you will handle user input and update the game state every time you draw. we will branch out later. note: changing how your main loop deals with time is a debugging nightmare, everywhere. think about your needs carefully before working on your main loop. what most browser games should look like if your game can hit the maximum refresh rate of any hardware you support then your job is fairly easy. you can simply update, render, and then do nothing until vsync. /* * starting with the semicolon is in case whatever line of code above this example * relied on automatic semicolon insertion (asi). the browser could accidentally * think this whole example continues from the previous line. the leading semicolon * marks the beginning of our new line if the previou...
Introduction to game development for the Web - Game development
res, game data, or anything else, even if it's not in a native javascript format. web audio api this api for controlling the playback, synthesis, and manipulation of audio from javascript code lets you create awesome sound effects as well as play and manipulate music in real time. webgl lets you create high-performance, hardware-accelerated 3d (and 2d) graphics from web content. this is a web-supported implementation of opengl es 2.0. webrtc the webrtc (real-time communications) api gives you the power to control audio and video data, including teleconferencing and transmitting other application data back and forth between two users. want your players to be able to talk to each other while blowing up monsters? this is the api for you. websockets the websocket api lets you connect your...
Game monetization - Game development
ets — some devs make more money from the merchandise than from the games themselves, but it only works on very popular and recognizable games like angry birds. still, it could be another small stream of passive income. the more diversified your earnings are, the better your business stability. donations when all else fails you can try putting a donate button on your game's page and asking for support from the community. sometimes it works, but only if the player knows you and feels that it will help you in your situation. that's why carefully managing your community is so important. it worked with the js13kgames competition — every participant got a free t-shirt, and some even gave back a few bucks to help keep it going in years to come. summary there are many ways to earn money — e...
Game promotion - Game development
follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas. website and blog you should definitely create your own website containing all the information about your games, so people can see what you've worked on. the more information you can include the better — you should include screenshots, description, trailer, press kit, requirements, available platforms, support details and more. you'll get bonus points for allowing your users to directly play your games online — at least in demo form. also, you should do some work on seo to allow people to find your games more easily. you should also blog about everything related to your gamedev activities. write about your development process, nasty bugs you encounter, funny stories, lessons learned, and the ups...
Building up a basic demo with Babylon.js - Game development
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 concepts: camera, light and objects. environment setup to start developing with babylon.js, you don't need much. you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest babylon.js engine inside your directory. opening the babylon.js documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: babylon.js...
Building up a basic demo with the PlayCanvas engine - Game development
red on the screen. 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 concepts: camera, light and objects. environment setup to start developing with playcanvas, you don't need much. you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. creating a directory to store your experiments in. saving a copy of the latest playcanvas engine inside your directory. opening the playcanvas documentation in a separate tab — it is useful to refer to. html structure here's the html structure we will use. <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: playcanvas ...
GLSL Shaders - Game development
clearer to understand, so you can just focus on the shader code. three.js and other 3d libraries abstract a lot of things for you — if you wanted to create such an example in raw webgl, you'd have to write a lot of extra code to actually make it work. environment setup to start with the webgl shaders you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. html structure here's the html structure we will use. <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: shaders demo</title> <style> body { margin: 0; padding: 0; font-size: 0; } canvas { width: 10...
3D games on the Web - Game development
for rich gaming experiences on the web, the weapon of choice is webgl, which is rendered on html <canvas>. webgl is basically an opengl es 2.0 for the web — it's a javascript api providing tools to build rich interactive animations and of course, also games. you can generate and render dynamic 3d graphics with javascript that is hardware accelerated. documentation and browser support the webgl project documentation and specification is maintained by the khronos group, not the w3c as with most of the web apis. support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. the main browsers are all supporting webgl and all you need to focus on is optimizing the performance on the devices you use. there's an ongoing effort on releasing webgl 2.0 (b...
Crisp pixel art look with image-rendering - Game development
automatically do the up-scaling, which not only solves the blur problem, but also allows you to use the images in their original, smaller size, thus saving download time. also, some game techniques require algorithms that analyse images, which also benefit from working with smaller images. the css property to achieve this scaling is image-rendering. it is still experimental, but there is partial support in most browsers. the steps to achieve this effect are: create a <canvas> element and set its width and height attributes to the original, smaller resolution. set its css width and height properties to be 2x or 4x the value of the html width and height. if the canvas was created with a 128 pixel width, for example, we would set the css width to 512px if we wanted a 4x scale. set the <can...
Efficient animation for web games - Game development
we touch on css transitions and css animations, and javascript loops involving window.requestanimationframe. there are several techniques worth knowing that will improve the performance of your game or application whilst also using less battery life, especially on low-end devices. it is worth documenting some of these things, as there is evidence to suggest (in popular and widely-used ui libraries, for example) that they aren’t necessarily common knowledge. first off, let us discuss some basic ideas. ...
WebRTC data channels - Game development
this article explains more about this, and shows you how to use libraries to implement data channels in your game. what is a data channel? a webrtc data channel lets you send text or binary data over an active connection to a peer. in the context of a game, this lets players send data to each other, whether text chat or game status information. data channels come in two flavors. reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. this is analogous to a tcp socket. ...
asm.js - Game development
s is an intermediate programming language. asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of javascript that provides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses. the performance characteristics are closer to native code than that of standard javascript. using a subset of javascript asm.js is already supported by major web browsers. since asm.js runs in a browser it depends heavily on the browser and the hardware. ...
Paddle and keyboard controls - Game development
in each case is set to true. when the key is released, the variable is set back to false. both functions take an event as a parameter, represented by the e variable. from that you can get useful information: the key holds the information about the key that was pressed. most browsers use arrowright and arrowleft for the left/right cursor keys, but we need to also include right and left checks to support ie/edge browsers. if the left cursor is pressed, then the leftpressed variable is set to true, and when it is released, the leftpressed variable is set to false. the same pattern follows with the right cursor and the rightpressed variable. the paddle moving logic we've now set up the variables for storing the info about the pressed keys, event listeners, and relevant functions. next we'll g...
2D breakout game using Phaser - Game development
cript is the best way to get a solid knowledge of web game development. if you are not already familiar with pure javascript game development, we would suggest that you first work through this series' counterpart, 2d breakout game using pure javascript. after that, you can pick any framework you like and use it for your projects; we have chosen phaser as it is a good solid framework, with a good support and community available, and a good set of plugins. frameworks speed up development time and help take care of the boring parts, allowing you to concentrate on the fun stuff. however, frameworks are not always perfect, so if something unexpected happens or you want to write some functionality that the framework does not provide, you will need some pure javascript knowledge. note: this serie...
2D maze game with device orientation - Game development
easy with phaser. implementing the vibration api when collision detection works as expected let's add some special effects with the help from the vibration api. the best way to use it in our case is to vibrate the phone every time the ball hits the walls — inside the wallcollision function: if("vibrate" in window.navigator) { window.navigator.vibrate(100); } if the vibrate method is supported by the browser and available in the window.navigator object, vibrate the phone for 100 miliseconds. that's it! adding the elapsed time to improve replayability and give players the option to compete with each other we will store the elapsed time — players can then try to improve on their best game completion time. to implement this we have to create a variable for storing the actual num...
Visual typescript game engine - Game development
** * rtcserverport port used to connect multimedia server. * default value is 12034 */ private rtcserverport: number = 12034; /** * connectorport is access port used to connect * session web socket. */ private connectorport: number = 1234; /** * broadcasterport port used to connect multimedia server multirtc3. * i will use it for explicit video chat multiplatform support. * default value is 9001 */ private broadcasterport: number = 9001; /** * @description important note for this property: if you * disable (false) you cant use account system or any other * network. use 'false' if you wanna make single player game. * in other way keep it 'true'. */ private appusenetwork = false; /** * appuseaccountssystem if you don't want to ...
ASCII - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge ascii on wikipedia ...
Adobe Flash - MDN Web Docs Glossary: Definitions of Web-related terms
...
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
: a cooking recipe is a simple algorithm for humans. a sorting algorithm is often used in computer programming to explain a machine how to sort data. common algorithms are pathfinding algorithms such as the traveling salesman problem, tree traversal algorithms and so on. there are also machine learning algorithms such as linear regression, logistic regression, decision tree, random forest, support vector machine, recurrent neural network (rnn), long short term memory (lstm) neural network, convolutional neural network (cnn), deep convolutional neural network and so on. learn more general knowledge algorithm on wikipedia technical reference explanations of sorting algorithms explanations of algorithmic complexity ...
Bootstrap - MDN Web Docs Glossary: Definitions of Web-related terms
bootstrap is a free, open source html, css, and javascript framework for quickly building responsive websites. initially, bootstrap was called twitter blueprint and was developed by a team working at twitter. it supports responsive design and features predefined design templates that you can use out of the box, or customize for your needs with your code. you don't need to worry about compatibility with other browsers either, as bootstrap is compatible with all modern browsers and newer versions of internet explorer. ...
Code splitting - MDN Web Docs Glossary: Definitions of Web-related terms
ts can be split into multiple smaller files. then features required at page load can be downloaded immediately with additional scripts being lazy loaded after the page or application is interactive, thus improving performance. while the total amount of code is the same (and perhaps even a few bytes larger), the amount of code needed during initial load can be reduced. code splitting is a feature supported by bundlers like webpack and browserify which can create multiple bundles that can be dynamically loaded at runtime. see also bundling lazy loading http/2 tree shaking ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
number of active connections per domain, serving all the required resources from a single domain could be slow as assets need to be downloaded sequentially. with domain sharding, the required downloads are served from more than one domain, enabling the browser to simultaneously download needed resources. multiple domains, however, is an anti-pattern, as dns lookups slow initial load times. http2 supports unlimited concurrent requests making domain sharding an obsolete requirement when http/2 is enabled. see also transport layer security (tls) dns http/2 ...
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
e network is suited for transfers of large assets such as high resolution images, audio, and sd video. 4g 0ms ∞ the network is suited for hd video, real-time video, etc. ...
Gzip compression - MDN Web Docs Glossary: Definitions of Web-related terms
gzip is a file format used for file compression and decompression. it is based on the deflate algorithm that allows files to be made smaller in size which allows for faster network transfers. gzip is commonly supported by web servers and modern browsers, meaning that servers can automatically compress files with gzip before sending them, and browsers can uncompress files upon receiving them. learn more how to enable compression and gzip for page speed. gzip on wikipedia ...
Gecko - MDN Web Docs Glossary: Definitions of Web-related terms
gecko is the layout engine developed by the mozilla project and used in many apps/devices, including firefox and firefox os. web browsers need software called a layout engine to interpret html, css, javascript, and embedded content (like images) and draw everything to your screen. besides this, gecko makes sure associated apis work well on every operating system gecko supports, and that appropriate apis are exposed only to relevant support targets. this means that gecko includes, among other things, a networking stack, graphics stack, layout engine, a javascript virtual machine, and porting layers. since all firefox os apps are web apps, firefox os uses gecko as its app runtime as well. learn more general knowledge gecko on wikipedia technical reference the gecko documenta...
Google Chrome - MDN Web Docs Glossary: Definitions of Web-related terms
note that the ios version of chrome uses that platform's webview, not blink. learn more general knowledge google chrome on wikipedia for chrome users use one of these links if you're an everyday user. android ios desktop for web developers if you want to try the latest chrome features, install one of the pre-stable builds. ...
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
http/2 does not modify the application semantics of http in any way. all the core concepts found in http 1.1, such as http methods, status codes, uris, and header fields, remain in place. ...
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
(from "internationalization", a 20-letter word) is the best practice that enables products or services to be readily adapted to any target culture. internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. ...
Inheritance - MDN Web Docs Glossary: Definitions of Web-related terms
inheritance is a major feature of object-oriented programming. data abstraction can be carried up several levels, that is, classes can have superclasses and subclasses. as an app developer, you can choose which of the superclass's attributes and methods to keep and add your own, making class definition very flexible. some languages let a class inherit from more than one parent (multiple inheritance). learn more learn about it inheritance and the prototype chain ...
Internationalization - MDN Web Docs Glossary: Definitions of Web-related terms
n shortened to "i18n", is the adapting of a web site or web application to different languages, regional differences, and technical requirements for different regions and countries. internationalization is the process of architecting your web application so that it can be quickly and easily adapted to various languages and regions without much engineering effort when new languages and regions are supported. also so that a user can browse features to translate or localize the application to access all the content without breaking the layout. internationalization includes support for multiple character sets (usually via unicode), units of measure (currency, °c/°f, km/miles, etc.), date and time formats, keyboard layouts, and layout and text directions. ...
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects). json does not natively represent more complex data types like functions, regular expressions, dates, and so on. ...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
f the world's most commonly-used languages, owing to the recent growth and performance improvement of apis available in browsers. origins and history conceived as a server-side language by brendan eich (then employed by the netscape corporation), javascript soon came to netscape navigator 2.0 in september 1995. javascript enjoyed immediate success and internet explorer 3.0 introduced javascript support under the name jscript in august 1996. in november 1996, netscape began working with ecma international to make javascript an industry standard. since then, the standardized javascript is called ecmascript and specified under ecma-262, whose latest (tenth, es2019) edition is available as of june 2019. recently, javascript's popularity has expanded even further through the successful node.js...
Microsoft Internet Explorer - MDN Web Docs Glossary: Definitions of Web-related terms
ed-with-internet-explorer-9 http://windows.microsoft.com/en-us/internet-explorer/internet-explorer-help http://windows.microsoft.com/en-us/internet-explorer/make-ie-default-browser#ie=ie-11 technical reference http://windows.microsoft.com/en-us/internet-explorer/products/ie-8/system-requirements http://windows.microsoft.com/en-us/internet-explorer/products/ie-9/system-requirements http://support.microsoft.com/kb/969393 ...
Mobile First - MDN Web Docs Glossary: Definitions of Web-related terms
...
PNG - MDN Web Docs Glossary: Definitions of Web-related terms
png (portable network graphics) is a graphics file format that supports lossless data compression. learn more general knowledge png on wikipedia ...
POP3 - MDN Web Docs Glossary: Definitions of Web-related terms
pop3 (post office protocol) is a very common protocol for getting emails from a mail server over a tcp connection. pop3 does not support folders, unlike the more recent imap4, which is harder to implement because of its more complex structure. clients usually retrieve all messages and then delete them from the server, but pop3 does allow retaining a copy on the server. nearly all email servers and clients currently support pop3. ...
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
a parameter is a named variable passed into a function. parameter variables are used to import arguments into functions. note the difference between parameters and arguments: function parameters are the names listed in the function's definition. function arguments are the real values passed to the function. parameters are initialized to the values of the arguments supplied. two kinds of parameters: input parameters the most common kind; they pass values into functions. depending on programming language, input parameters can be passed several ways (e.g., call-by-value, call-by-address, call-by-reference). output/return parameters primarily return multiple values from a function, but not recommended since they cause confusion learn more general knowledge difference b...
Progressive web apps - MDN Web Docs Glossary: Definitions of Web-related terms
progressive web apps is a term used to describe the modern state of web app development. this involves taking standard web sites/apps that enjoy all the best parts of the web — such as discoverability via search engines, being linkable via urls, and working across multiple form factors — and supercharging them with modern apis (such as service workers and push) and features that confer other benefits more commonly attributed to native apps. these features include being installable, working offline, and being easy to sync with and re-engage the user from the server. learn more the app center on mdn progressive web apps on google developers ...
Python - MDN Web Docs Glossary: Definitions of Web-related terms
it was created by guido van rossum as a successor to another language (called abc) between 1985 and 1990, and is currently used on a large array of domains like web development, desktop applications, data science, devops, and automation/productivity. ...
QUIC - MDN Web Docs Glossary: Definitions of Web-related terms
lemented on udp. it was developed by google as a way to experiment with ways to improve tcp and web application delivery. as tcp is built into the kernel of many operating systems being able to experiment with changes, test them and implement modifications is an extremely slow process. the creation of quic allows developers to conduct experiments and try new things faster. quic was designed to support the semantics of http/2. it provides multiplexing, flow control, security and congestion control. key features of quic include: reduction in connection establishment time. improved congestion control. multiplexing without head-of-line blocking. forward error correction. connection migration. there is limited browser and server support for quic today. resources chromium projects ...
RTF - MDN Web Docs Glossary: Definitions of Web-related terms
three programmers in the microsoft word team created rtf in the 1980s, and microsoft continued to develop the format until 2008. however, many word-processing programs can still read and write rtf. ...
SMTP - MDN Web Docs Glossary: Definitions of Web-related terms
smtp (simple mail transfer protocol) is a protocol used to send a new email. like pop3 and nntp, it is a state machine-driven protocol. the protocol is relatively straightforward. primary complications include supporting various authentication mechanisms (gssapi, cram-md5, ntlm, msn, auth login, auth plain, etc.), handling error responses, and falling back when authentication mechanisms fail (e.g., the server claims to support a mechanism, but doesn't). ...
SOAP - MDN Web Docs Glossary: Definitions of Web-related terms
soap (simple object access protocol) is a protocol for transmitting data in xml format. firefox removed support for soap in 2008. learn more general knowledge soap on wikipedia soap in gecko-based browsers technical reference specification ...
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
a backend database. sql injection can gain unauthorized access to a database or to retrieve information directly from the database. many data breaches are due to sql injection. how it works after entering username and password, behind the gui the sql queries work as follows: "select count(*) from users where username=' " + txt.user.text+" ' and password=' "+ txt.password.text+" ' "; now suppose user enters the username: admin and password: passwd123, so after clicking on the log in button, sql query will run as follows: "select count(*) from users where username=' admin ' and password=' passwd123 ' "; if the credentials are correct, then the user is allowed to log in, so it's a very simple (and therefore insecure) mechanism. hackers use this insecurity to gain unauthorized acces...
Secure Sockets Layer (SSL) - MDN Web Docs Glossary: Definitions of Web-related terms
...
Server - MDN Web Docs Glossary: Definitions of Web-related terms
area networks or wide area networks such as the internet. ...
Shim - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge shim on wikipedia ...
Site - MDN Web Docs Glossary: Definitions of Web-related terms
the registrable domain of the host within the origin. this is computed by consulting a public suffix list to find the portion of the host which is counted as the public suffix (e.g. com, org or co.uk). the concept of a site is used in samesite cookies, as well as a web application's cross-origin resource policy. ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
re familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misguided. javascript symbols are different. symbol type is a new feature in ecmascript 2015. there is no ecmascript 5 equivalent for symbol. in some programming languages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string. for instance, we can alert almost any value, and it will work. symbols are special. they don’t auto-convert. for example: let sym = symbol("sym") alert(sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert o...
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
web content accessibility guidelines (wcag) are a recommendation published by the web accessibility initiative group at the w3c. they outline a set of guidelines for making content accessible primarily for people with disabilities but also for limited-resource devices such as mobile phones. wcag 2.0 which superseded wcag 1.0 was published as a w3c recommendation on 11 december 2008. it consists of 12 guidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. wcag uses three levels of conformance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content. conformance to this level is described as a. priority 2: web d...
WebExtensions - MDN Web Docs Glossary: Definitions of Web-related terms
webextensions is a cross-browser system for developing browser extensions in firefox. this system provides apis, which to a large extent are supported across different browsers like mozilla firefox, google chrome, opera browser, and microsoft edge . learn more technical reference browser extensions on mdn ...
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
b apps. ...
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
first web server, web browser, and webpage on his computer at the cern physics research lab in 1990. in 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the web was first made public. the system we know today as "the web" consists of several components: the http protocol governs data transfer between a server and a client. to access a web component, a client supplies a unique universal identifier, called a url (uniform resource location) or uri (uniform resource identifier) (formally called universal document identifier (udi)). html (hypertext markup language) is the most common format for publishing web documents. linking, or connecting resources through hyperlinks, is a defining concept of the web, aiding its identity as a collection of connected do...
XForms - MDN Web Docs Glossary: Definitions of Web-related terms
xforms is a convention for building web forms and processing form data in the xml format. no major browser supports xforms any longer—we suggest using html5 forms instead. learn more technical reference xforms documentation on mdn ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
he server. not all http responses can be cached, these are the following constraints for an http response to be cached: the method used in the request is itself cacheable, that is either a get or a head method. a response to a post or patch request can also be cached if freshness is indicated and the content-location header is set, but this is rarely implemented. (for example, firefox does not support it per https://bugzilla.mozilla.org/show_bug.cgi?id=109553.) other methods, like put or delete are not cacheable and their result cannot be cached. the status code of the response is known by the application caching, and it is considered cacheable. the following status code are cacheable: 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501. there are specific headers in the response, ...
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
ecognize character, including letters, numbers, punctuation marks, and whitespace. in earlier times, countries developed their own character sets due to their different languages used, such as kanji jis codes (e.g. shift-jis, euc-jp, etc.) for japanese, big5 for traditional chinese, and koi8-r for russian. however, unicode gradually became most acceptable character set for its universal language support. if a character set is used incorrectly (for example, unicode for an acticle encoded in big5), you may see nothing but broken characters, which are called mojibake. ...
Speculative parsing - MDN Web Docs Glossary: Definitions of Web-related terms
it parses ahead while scripts are being downloaded and executed. the html parser starts speculative loads for scripts, style sheets and images it finds ahead in the stream and runs the html tree construction algorithm speculatively. ...
WebM - MDN Web Docs Glossary: Definitions of Web-related terms
webm is royalty-free and is an open web video format natively supported in mozilla firefox. learn more general knowledge webm on wikipedia ...
MDN Web Docs Glossary: Definitions of Web-related terms
bots.txt round trip time (rtt) routers rss rtcp (rtp control protocol) rtf rtl (right to left) rtp (real-time transport protocol) and srtp (secure rtp) rtsp: real-time streaming protocol ruby s safe same-origin policy scm scope screen reader script-supporting element scroll container scrollport sctp sdp search engine second-level domain secure sockets layer (ssl) selector (css) self-executing anonymous function semantics seo serialization server server timing session hijacking sgml shadow tree ...
About Scriptable Interfaces - Interfaces
python there's an extension extensions/python that bridges the gap between xpcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts. ...
Assessment: Accessibility troubleshooting - Learn web development
u add paragraph elements, you'll notice the styling looking better. the images the images are currently inaccessible to screenreader users. can you fix this? the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. how can you allow them to still access the audio? the forms the <input> element in the search form at the top could do with a label, but we don't want to add a visible text label that would potentially spoil the design and isn't really needed by sighted users. how can you add a label that is only accessible to screenreaders? the two <input> elements in the comment form have...
Test your skills: CSS and JavaScript accessibility - Learn web development
ck, then ask us for help — see the assessment or further help section at the bottom of this page. css accessibility 1 in the first task you are presented with a list of links. however, their accessibility is pretty bad — there is no way to really tell that they are links, or to tell which one the user is focussed on. we'd like you to assume that the existing ruleset with the a selector is supplied by some cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to tell where they are in the list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. css accessibility 2 in this next...
CSS and JavaScript accessibility best practices - Learn web development
v> we will explain these attributes in our next article, which covers wai-aria in much more detail. note: some of you will probably be thinking about that fact that html5 forms have built-in validation mechanisms like the required, min/minlength, and max/maxlength attributes (see the <input> element reference for more information). we didn't end up using these in the demo because cross-browser support for them is patchy (for example ie10 and above only). note: webaim's usable and accessible form validation and error recovery provides some further useful information about accessible form validation. other javascript accessibility concerns there are other things to be aware of when implementing javascript and thinking about accessibility. we will add more as we find them. mouse-specif...
What is accessibility? - Learn web development
ructured in a tree of information called the accessibility tree. different operating systems have different accessibility apis available : windows: msaa/iaccessible, uiaexpress, iaccessible2 mac os x: nsaccessibility linux: at-spi android: accessibility framework ios: uiaccessibility where the native semantic information provided by the html elements in your web apps falls down, you can supplement it with features from the wai-aria specification, which add semantic information to the accessibility tree to improve accessibility. you can learn a lot more about wai-aria in our wai-aria basics article. summary this article should have given you a useful high-level overview of accessibility, shown you why it's important, and looked at how you can fit it into your workflow. you should n...
Backgrounds and borders - Learn web development
nt is scrolled, the background does not move. in effect, the background is fixed to the same position on the page, so it scrolls as the page scrolls. fixed: it causes an element's background to be fixed to the viewport so that it doesn't scroll when the page or element content is scrolled. it will always remain in the same position on the screen. local: this value was added later on (it is only supported in internet explorer 9+, whereas the others are supported in ie4+) because the scroll value is rather confusing and doesn't really do what you want in many cases. the local value fixes the background to the element it is set on, so when you scroll the element, the background scrolls with it. the background-attachment property only has an effect when there is content to scroll, so we've ma...
Cascade and inheritance - Learn web development
of its parent element. effectively, this "turns on inheritance". initial sets the property value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like initial. note: there is also a newer value, revert, which has limited browser support. note: see origin of css declarations in introducing the css cascade for more information on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: ...
Creating fancy letterheaded paper - Learn web development
to the bottom of the letter adds a semi-transparent gradient over the top of both of the previous backgrounds that gives the letter a bit of texture. make it slightly dark right near the top and bottom, but completely transparent for a large part of the center. add another background declaration that just adds the top image to the top of the letter, as a fallback for browsers that don't support the previous declaration. add a white background color to the letter. add a 1mm top and bottom solid border to the letter, in a color that is inkeeping with the rest of the color scheme. the logo to the <h1>, add the logo as a background image. add a filter to the logo to give it a subtle drop shadow. now comment out the filter and implement the drop shadow in a different (slightly m...
Organizing your CSS - Learn web development
in navigation */ ... you don't need to comment every single thing in your css, as much of it will be self-explanatory. what you should comment are the things where you made a particular decision for a reason. you may have used a css property in a specific way to get around older browser incompatibilities, for example: .box { background-color: red; /* fallback for older browsers that don't support gradients */ background-image: linear-gradient(to right, #ff0000, #aa0000); } perhaps you followed a tutorial to achieve something, and the css is a little non-obvious. in that case you could add the url of the tutorial to the comments. you will thank yourself when you come back to this project in a year or so, and can vaguely remember there was a great tutorial about that thing, but wher...
Attribute selectors - Learn web development
elector will match a value that begins with a — it only matches the first list item because the other two list items start with an uppercase a. the second selector uses the case-insensitive flag and so matches all of the list items. note: there is also a newer value s, which will force case-sensitive matching in contexts where matching is normally case-insensitive, however this is less well supported in browsers and isn't very useful in an html context. next steps now we are done with attribute selectors, you can continue on to the next article and read about pseudo-class and pseudo-element selectors. previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes a...
CSS building blocks - Learn web development
e terminology that relates to it. backgrounds and borders in this lesson we will take a look at some of the creative things you can do with css backgrounds and borders. from adding gradients, background images, and rounded corners, backgrounds and borders are the answer to a lot of styling questions in css. handling different text directions in recent years, css has evolved in order to better support different directionality of content, including right-to-left but also top-to-bottom content (such as japanese) — these different directionalities are called writing modes. as you progress in your study and begin to work with layout, an understanding of writing modes will be very helpful to you, therefore we will introduce them in this article. overflowing content in this lesson we will lo...
Test Your Skills: Fundamental layout comprehension - Learn web development
e to get into — it's very hard to help someone with a coding problem if you can't see their code. a link to the actual task or assessment page, so we can find the question you want help with. in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Grids - Learn web development
ther into the specification, read our guides to grid layout, which can be found below. ...
Multiple-column layout - Learn web development
ion. this specification gives us properties to control breaking of content in multicol and in paged media. for example, add the property break-inside with a value of avoid to the rules for .card. this is the container of the heading and text, and therefore we do not want to fragment this box. at the present time it is also worth adding the older property page-break-inside: avoid for best browser support. .card { break-inside: avoid; page-break-inside: avoid; background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; margin: 0 0 1em 0; } reload the page and your boxes should stay in one piece. multicol fragmentation body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 arial, helvetica, sans-serif; } <div cla...
Normal Flow - Learn web development
mal flow, and how the browser lays things out by default, move on to understand how to change this default display to create the layout needed by your design. previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Positioning - Learn web development
<dd>cane</dd> <dd>camera</dd> <dd>camel</dd> <dt>d</dt> <dd>duck</dd> <dd>dime</dd> <dd>dipstick</dd> <dd>drone</dd> <dt>e</dt> <dd>egg</dd> <dd>elephant</dd> <dd>egret</dd> </dl> the css might look as follows. in normal flow the <dt> elements will scroll with the content. when we add position: sticky to the <dt> element, along with a top value of 0, supporting browsers will stick the headings to the top of the viewport as they reach that position. each subsequent header will then replace the previous one as it scrolls up to that position. dt { background-color: black; color: white; padding: 10px; position: sticky; top: 0; left: 0; margin: 1em 0; } body { width: 500px; height: 1400px; margin: 0 auto; } dt { background-...
Practical positioning examples - Learn web development
you didn't get this all immediately — positioning is a fairly advanced topic, and you can always work through the articles again to aid your understanding. the next subject we'll turn to is flexbox. in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
CSS layout - Learn web development
ure used in css layouts, and before css grid layout they tended to be implemented using floats or other layout features. you imagine your layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. in this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project. supporting older browsers in this module we recommend using flexbox and grid as the main layout methods for your designs. however there will be visitors to your site who use older browsers, or browsers which do not support the methods you have used. this will always be the case on the web — as new features are developed, different browsers will prioritise different things. this article explains ...
Getting started with CSS - Learn web development
ly choosing the html element that you want to change, and using a css rule to change the way it looks. a good example is our <ul>, an unordered list. it has list bullets, and if i decide i don't want those bullets i can remove them like so: li { list-style-type: none; } try adding this to your css now. the list-style-type property is a good property to look at on mdn to see which values are supported. take a look at the page for list-style-type and you will find an interactive example at the top of the page to try some different values in, then all allowable values are detailed further down the page. looking at that page you will discover that in addition to removing the list bullets you can change them — try changing them to square bullets by using a value of square. adding a class...
How CSS is structured - Learn web development
searching mdn. note: you will learn more about selectors in the next module: css selectors. specificity you may encounter scenarios where two selectors select the same html element. consider the stylesheet below, with a p selector that sets paragraph text to blue. however, there is also a class that sets the text of selected elements to red. .special { color: red; } p { color: blue; } suppose that in our html document, we have a paragraph with a class of special. both rules apply. which selector prevails? do you expect to see blue or red paragraph text? <p class="special">what color am i?</p> the css language has rules to control which selector is stronger in the event of a conflict. these rules are called cascade and specificity. in the code block below, we define two rules for...
Styling links - Learn web development
inserted, and then specify the position as 100% of the way over to the right of the text content, and 0 pixels from the top. we also use background-size to specify the size we want the background image to be shown at — it is useful to have a larger icon and then resize it like this as needed for responsive web design purposes. this does however only work with ie 9 and later, so if you need to support those older browsers, you'll just have to resize the image and insert it as is. finally, we set some padding-right on the links to make space for the background image to appear in, so we aren't overlapping it with the text. a final word — how did we select just external links? well, if you are writing your html links properly, you should only be using absolute urls for external links — ...
How do you make sure your website works properly? - Learn web development
your hosting provider forgot to give you access rights to a directory). 404: not found self-explanatory. we'll discuss how to solve this below. 500: internal server error something went wrong on the server. for instance, maybe the server-side language (php, .net, etc.) stopped working, or the web server itself has a configuration problem. usually it's best to resort to your hosting provider's support team. 503: service unavailable usually resulting from a shortterm system overload. the server has some sort of problem. try again in a little while. as beginners checking our (simple) website, we'll deal most often with 200, 304, 403, and 404. fixing the 404 so what went wrong? at first glance, the image we asked for seems to be in the right place... but the network tool reported ...
What do common web layouts contain? - Learn web development
irectly related to the main content. it's a trap mica. this is a bit trickier. it looks like a three-column layout... ...but it's not. b1 and b2 float around the main content. remember that word "float"--it will ring a bell when you start learning about css. why would you think it's a three-column layout? because the image on the top-right is l-shaped, because b1 looks like a column supporting the shifted main content, and because the "m" and "i" of the mica logo create a vertical line of force. this is a good example of a classic layout supporting some design creativity. simple layouts are easier to implement, but allow yourself room to express your creativity in this area. a much trickier layout the opera de paris. basically a two-column layout, but you'll notice...
What HTML features promote accessibility? - Learn web development
iting link text: an explanation and an apology.">click here</a> to find out more.</p> access keys access keys provide easier navigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses alt or ctrl + the access key. the exact key combination varies by platform. <a href="somepage.html" accesskey="s">some page</a> skip links to aid tabbing, you can supply links that allow users to jump over chunks of your web page. you might want to allow someone to jump over a plethora of navigation links, for example, so they can just read a page’s main content rather than cycle through all of the links. <header> <h1>the heading</h1> <a href="#content">skip to content</a> </header> <nav> <!-- navigation stuff --> </nav> <section id="content"> <!-...
How does the Internet work? - Learn web development
t and the web. summary the internet is the backbone of the web, the technical infrastructure that makes the web possible. at its most basic, the internet is a large network of computers which communicate all together. the history of the internet is somewhat obscure. it began in the 1960s as a us-army-funded research project, then evolved into a public infrastructure in the 1980s with the support of many public universities and private companies. the various technologies that support the internet have evolved over time, but the way it works hasn't changed that much: internet is a way to connect computers all together and ensure that, whatever happens, they find a way to stay connected. active learning how the internet works in 5 minutes: a 5 minute video to understand the very bas...
How much does it cost to do something on the Web? - Learn web development
e complicated designs, touch up photos, or produce audio and video files. you need to upload content to a remote server (see hosting below), so you need a modem. your isp can rent internet connectivity to you for a few dollars per month, though your budget might vary, depending on your location. isp access make sure that you have sufficient bandwidth: low-bandwidth access may be adequate to support a 'simple' website: reasonably-sized images, texts, some css and javascript. that will likely cost you a few dozen dollars, including the rent for the modem. on the other hand, you'll need a high-bandwidth connection, such as dsl, cable, or fiber access, if you want a more advanced website with hundreds of files, or if you want to deliver heavy video/audio files directly from your web server...
What is the difference between webpage, website, web server, and search engine? - Learn web development
d the browser will display the website's main web page, or homepage (casually referred as "the home"): the ideas of a web page and a website are especially easy to confuse for a website that contains only one web page. such a website is sometimes called a single-page website. web server a web server is a computer hosting one or more websites. "hosting" means that all the web pages and their supporting files are available on that computer. the web server will send any web page from the website it is hosting to any user's browser, per user request. don't confuse websites and web servers. for example, if you hear someone say, "my website is not responding", it actually means that the web server is not responding and therefore the website is not available. more importantly, since a web ser...
How do you upload your files to a web server? - Learn web development
it's free and available for windows, macos and linux. to install filezilla go to the filezilla downloads page, click the big download button, then install from the installer file in the usual way. note: of course there are lots of other options. see publishing tools for more information. open the filezilla application; you should see something like this: logging in for this example, we'll suppose that our hosting provider (the service that will host our http web server) is a fictitious company "example hosting provider" whose urls look like this: mypersonalwebsite.examplehostingprovider.net. we have just opened an account and received this info from them: congratulations for opening an account at example hosting provider. your account is: demozilla your website will be visible at...
What is a URL? - Learn web development
the <audio> element), etc.; to display other html documents with the <iframe> element. note: when specifying urls to load resources as part of a page (such as when using the <script>, <audio>, <img>, <video>, and the like), you should generally only use http and https urls, with few exceptions (one notable one being data:; see data urls). using ftp, for example, is not secure and is no longer supported by modern browsers. other technologies, such as css or javascript, use urls extensively, and these are really the heart of the web. absolute urls vs relative urls what we saw above is called an absolute url, but there is also something called a relative url. let's examine what that distinction means in more detail. the required parts of a url depend to a great extent on the context in ...
What is a Domain Name? - Learn web development
ers the general purpose of the service behind the domain name. the most generic tlds (.com, .org, .net) don't require web services to meet any particular criteria, but some tlds enforce stricter policies so it is clearer what their purpose is. for example: local tlds such as .us, .fr, or .se can require the service to be provided in a given language or hosted in a certain country — they are supposed to indicate a resource in a particular language or country. tlds containing .gov are only allowed to be used by government departments. the .edu tld is only for use by educational and academic institutions. tlds can contain special as well as latin characters. a tld's maximum length is 63 characters, although most are around 2–3. the full list of tlds is maintained by icann. lab...
What is accessibility? - Learn web development
uage, so that screen readers read your text properly. make sure that a user can navigate to all widgets on a page solely with the keyboard, without getting trapped. (at least let them tab in and out.) and that's just the beginning. accessibility champions since 1999, the w3c has operated a working group called the web accessibility initiative (wai) promoting accessibility through guidelines, support material, and international resources. more details please refer to: wikipedia article about accessibility wai (w3c's web accessibility initiative) next steps accessibility can impact both a website's design and technical structure. from a design point of view, we suggest learning about designing for all types of users. if the technical side interests you more, you could learn ho...
How to structure a web form - Learn web development
ined inside a <p>. the first is a drop-down menu (<select>) for selecting credit card type. the second is an <input> element of type tel, for entering a credit card number; while we could have used the number type, we don't want the number's spinner ui. the last one is an <input> element of type date, for entering the expiration date of the card; this one will come up with a date picker widget in supporting browsers, and fall back to a normal text input in non-supporting browsers. these newer input types are reintroduced in the html5 input types. enter the following below the previous section: <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> </label> <select id="card" name="usercard"> <option value="visa">vi...
Sending forms through JavaScript - Learn web development
ting only the parts of the ui that require changes. sending arbitrary data asynchronously is generally called ajax, which stands for "asynchronous javascript and xml". how is it different? the xmlhttprequest (xhr) dom object can build http requests, send them, and retrieve their results. historically, xmlhttprequest was designed to fetch and send xml as an exchange format, which has since been superceded by json. but neither xml nor json fit into form data request encoding. form data (application/x-www-form-urlencoded) is made of url-encoded lists of key/value pairs. for transmitting binary data, the http request is reshaped into multipart/form-data. note: the fetch api is often used in place of xhr these days — it is a modern, updated version of xhr, which works in a similar fashion b...
Test your skills: Form validation - Learn web development
derstood our client-side form validation article. note: you can try out solutions locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. form validation 1 in this task, we are providing you with a simple support query form, and we want you to add some validation features to it: make all of the input fields mandatory to complete before the form can be submitted. change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation suitable for the data being asked for. give the "user name" field a required length of between 5 and 20 characters, t...
Your first form - Learn web development
before you go any further, make a local copy of our simple html template — you'll enter your form html into here. the <form> element all forms start with a <form> element, like this: <form action="/my-handling-form-page" method="post"> </form> this element formally defines a form. it's a container element like a <section> or <footer> element, but specifically for containing forms; it also supports some specific attributes to configure the way the form behaves. all of its attributes are optional, but it's standard practice to always set at least the action and method attributes: the action attribute defines the location (url) where the form's collected data should be sent when it is submitted. the method attribute defines which http method to send the data with (usually get or post...
Installing basic software - Learn web development
ese browsers and have them ready for testing. note: internet explorer is not compatible with some modern web features and it may not be able to run your project. you usually don't need to worry about making your web projects compatible with it, as very few people still use it — certainly don't worry too much about it while you are learning. you might sometimes run into a project that requires support for it. installing a local web server some examples will need to be run by a web server to work successfully. you can find out how to do this in how do you set up a local testing server? overview: getting started with the web next in this module installing basic software what will your website look like? dealing with files html basics css basics javascript basics publishi...
The web and web standards - Learn web development
rs can make use of it, even if they might not all get the same experience. in short, we are trying to make the web work for all, as much as possible. you'll come across the below concepts at some point in your studies. cross-browser compatibility is the practice of trying to make sure your webpage works across as many devices as possible. this includes using technologies that all the browsers support, delivering better experiences to browsers that can handle them (progressive enhancement), and/or writing code so that it falls back to a simpler but still usable experience in older browsers (graceful degradation). it also involves a lot of testing to see if anything fails in certain browsers, and then more work to fix those failures. responsive web design is the practice of making your fun...
Add a hitmap on top of an image - Learn web development
ntains several active regions (called "hotspots") that each link to a different resource. formerly, image maps were a popular navigation device, but it’s important to thoroughly consider their performance and accessibility ramifications. text links (perhaps styled with css) are preferable to image maps for several reasons: text links are lightweight, maintainable, often more seo-friendly, and support accessibility needs (e.g., screen readers, text-only browsers, translation services). how to insert an image map, properly step 1: the image not just any image is acceptable. the image must make it clear what happens when people follow image links. alt text is mandatory, of course, but many people never see it. the image must clearly indicate where hotspots begin and end. hotspots mus...
Use JavaScript within a webpage - Learn web development
bsite more accessible if you use it wisely, or it can become a disaster if you use scripting without care. to make javascript work in your favor, it's worth knowing about certain best practices for adding javascript: make all content available as (structured) text. rely on html for your content as much as possible. for example, if you've implemented a nice javascript progress bar, make sure to supplement it with matching text percentages inside the html. likewise, your drop-down menus should be structured as unordered lists of links. make all functionality accessible from the keyboard. let users tab through all controls (e.g., links and form input) in a logical order. if you use pointer events (like mouse events or touch events), duplicate the functionality with keyboard events. ...
Using data attributes - Learn web development
nt and css transitions (jsbin example). data values are strings. number values must be quoted in the selector for the styling to take effect. issues do not store content that should be visible and accessible in data attributes, because assistive technology may not access them. in addition, search crawlers may not index data attributes' values. the main issues to consider are internet explorer support and performance. internet explorer 11+ provides support for the standard, but all earlier versions do not support dataset. to support ie 10 and under you need to access data attributes with getattribute() instead. also, the performance of reading data-attributes compared to storing this data in a regular js object is poor. that said, though, for custom element-associated metadata, they are a...
Use HTML to solve common problems - Learn web development
Learn › HTML › Howto
create a simple web form how to structure a web form tabular information some information, called tabular data, needs to be organized into tables with columns and rows. 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 superscript and subscript, and representing computer code. how to use data attributes advanced text semantics how to take control of html line breaking how to mark changes (added and removed text) — see the <ins> and <del> elements. advanced images & multimedia how to add a responsive image to a webpage how to add vector image to a webpage how to add a hit map on top of an image i...
Creating hyperlinks - Learn web development
basic link is created by wrapping the text or other content, see block level links, inside an <a> element and using the href attribute, also known as a hypertext reference, or target, that contains the web address. <p>i'm creating a link to <a href="https://www.mozilla.org/">the mozilla homepage</a>. </p> this gives us the following result: i'm creating a link to the mozilla homepage. adding supporting information with the title attribute another attribute you may want to add to your links is title. the title contains additional information about the link, such as which kind of information the page contains, or things to be aware of on the web site. <p>i'm creating a link to <a href="https://www.mozilla.org/" title="the best place to find more information about mozilla's m...
Debugging HTML - Learn web development
ul> let's review the problems: the paragraph and list item elements have no closing tags. looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin. the first <strong> element has no closing tag. this is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text has been strongly emphasised. this section is badly nested: <strong>strong <em>strong emphasised?</strong> what is this?</em>. it is not easy to tell how this has been interpreted because of the previous problem. the href attribute value is missing a closing double quote. this seems to have caused the biggest problem — the link has n...
Document and website structure - Learn web development
you can't think of a better semantic text element to wrap your content, or don't want to add any specific meaning. for example: <p>the king walked drunkenly back to his room at 01:00, the beer doing nothing to aid him as he staggered through the door <span class="editor-note">[editor's note: at this point in the play, the lights should be down low]</span>.</p> in this case, the editor's note is supposed to merely provide extra direction for the director of the play; it is not supposed to have extra semantic meaning. for sighted users, css would perhaps be used to distance the note slightly from the main text. <div> is a block level non-semantic element, which you should only use if you can't think of a better semantic block element to use, or don't want to add any specific meaning. for exa...
HTML text fundamentals - Learn web development
e === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; italic, bold, underline... the elements we've discussed so far have clearcut associated semantics. the situation with <b>, <i>, and <u> is somewhat more complicated. they came about so people could write bold, italics, or underlined text in an era when css was still supported poorly or not at all. elements like this, which only affect presentation and not semantics, are known as presentational elements and should no longer be used, because as we've seen before, semantics is so important to accessibility, seo, etc. html5 redefined <b>, <i>, and <u> with new, somewhat confusing, semantic roles. here's the best rule of thumb: it's likely appropriate to use <b>, <...
Marking up a letter - Learn web development
ements containing machine-readable dates. the first address and first date in the letter should have a class attribute value of sender-column. the css you'll add later will cause these to be right aligned, as it should be in the case in a classic letter layout. mark up the five acronyms/abbreviations in the main text of the letter to provide expansions of each acronym/abbreviation. the six sub/superscripts 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). try to mark up at least two appropriate words in the text with strong importance/emphasis. there are two places where the letter should have a hyperlink. add appropriate links with titles. for the location that the links point to, you m...
Test your skills: Advanced HTML text - Learn web development
d html text 2 in this task we want you to add some semantics to the provided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is taken from accessibility. semantically mark up "html" and "css" as acronyms, providing expansions as tooltips. semantically associate machine-readable dates with the dates in the text. use subscript and superscript to provide correct semantics for the chemical formulae and dates, and make them display correctly. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors above. if you would like your work a...
Test your skills: Links - Learn web development
this is not strictly best practice, but we've done it here so that the pages don't open in the embedded <iframe>, getting rid of your example code in the process! try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. links 3 the following links link to an info page about narwhals, a support email address, and a pdf factfile that is 4mb in size. in this task we want you to: take the existing paragraphs with poorly-written link text, and rewrite them so that they have good link text. add a warning to any links that need a warning added. note: the first and third links in the example have the target="_blank" attribute set on them, so that when you click on them, they open th...
Introduction to HTML - Learn web development
make a link and discusses best practices for links. advanced text formatting there are many other elements in html for formatting text that we didn't get to in the html text fundamentals article. the elements here are less well-known, but still useful to know about. in this article, you'll learn about marking up quotations, description lists, computer code and other related text, subscript and superscript, contact information, and more. document and website structure as well as defining individual parts of your page (such as "a paragraph" or "an image"), html is also used to define areas of your website (such as "the header," "the navigation menu," or "the main content column.") this article looks into how to plan a basic website structure and how to write the html to represent this stru...
HTML table advanced features and accessibility - Learn web development
nesting tables it is possible to nest a table inside another one, as long as you include the complete structure, including the <table> element. thi...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
l tables should be used for tabular data — this is what they are designed for. unfortunately, a lot of people used to use html tables to lay out web pages, e.g. one row to contain the header, one row to contain the content columns, one row to contain the footer, etc. you can find more details and an example at page layouts in our accessibility learning module. this was commonly used because css support across browsers used to be terrible; table layouts are much less common nowadays, but you might still see them in some corners of the web. in short, using tables for layout rather than css layout techniques is a bad idea. the main reasons are as follows: layout tables reduce accessibility for visually impaired users: screenreaders, used by blind people, interpret the tags that exist in an...
General asynchronous programming concepts - Learn web development
threads. threads a thread is basically a single process that a program can use to complete tasks. each thread can only do a single task at once: task a --> task b --> task c each task will be run sequentially; a task has to complete before the next one can be started. as we said earlier, many computers now have multiple cores, so can do multiple things at once. programming languages that can support multiple threads can use multiple cores to complete multiple tasks simultaneously: thread 1: task a --> task b thread 2: task c --> task d javascript is single-threaded javascript is traditionally single-threaded. even with multiple cores, you could only get it to run tasks on a single thread, called the main thread. our example from above is run like this: main thread: render circles to ...
Graceful asynchronous programming with Promises - Learn web development
ck converts the basic request model used by many indexeddb methods to use promises (see this code, for example). conclusion promises are a good way to build asynchronous applications when we don’t know the return value of a function or how long it will take to return. they make it easier to express and reason about sequences of asynchronous operations without deeply nested callbacks, and they support a style of error handling that is similar to the synchronous try...catch statement. promises work in the latest versions of all modern browsers; the only place where promise support will be a problem is in opera mini and ie11 and earlier versions. we didn't touch on all promise features in this article, just the most interesting and useful ones. as you start to learn more about promises, yo...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
ngs at specific times and at a constant pace, regardless of how fast or slow your device might be. the general pattern you'd use looks something like this: let starttime = null; function draw(timestamp) { if (!starttime) { starttime = timestamp; } currenttime = timestamp - starttime; // do something based on current time requestanimationframe(draw); } draw(); browser support requestanimationframe() is supported in more recent browsers than setinterval()/settimeout(). interestingly, it is available in internet explorer 10 and above. so, unless you need to support older versions of ie, there is little reason to not use requestanimationframe(). a simple example enough with the theory! let's build your own personal requestanimationframe() example. you're going t...
Manipulating documents - Learn web development
.clonenode() instead. removing a node is pretty simple as well, at least when you have a reference to the node to be removed and its parent. in our current case, we just use node.removechild(), like this: sect.removechild(linkpara); when you want to remove a node based only on a reference to itself, which is fairly common, you can use childnode.remove(): linkpara.remove(); this method is not supported in older browsers. they have no method to tell a node to remove itself, so you'd have to do the following. linkpara.parentnode.removechild(linkpara); have a go at adding the above lines to your code. manipulating styles it is possible to manipulate css styles via javascript in a variety of ways. to start with, you can get a list of all the stylesheets attached to a document using docum...
A first splash into JavaScript - Learn web development
occurs (in this case the checkguess() function). note that we don't need to specify the parentheses when writing it inside addeventlistener(). try saving and refreshing your code now, and your example should work — to a point. the only problem now is that if you guess the correct answer or run out of guesses, the game will break because we've not yet defined the setgameover() function that is supposed to be run once the game is over. let's add our missing code now and complete the example functionality. finishing the game functionality let's add that setgameover() function to the bottom of our code and then walk through it. add this now, below the rest of your javascript: function setgameover() { guessfield.disabled = true; guesssubmit.disabled = true; resetbutton = document.crea...
Storing the information you need — Variables - Learn web development
t myname = 'chris'; let myname = 'bob'; you'd have to do this instead: let myname = 'chris'; myname = 'bob'; again, this is a sensible language decision. there is no reason to redeclare variables — it just makes things more confusing. for these reasons and more, we recommend that you use let as much as possible in your code, rather than var. there is no reason to use var, unless you need to support old versions of internet explorer with your code (it doesn't support let until version 11; the modern windows edge browser supports let just fine). updating a variable once a variable has been initialized with a value, you can change (or update) that value by simply giving it a different value. try entering the following lines into your console: myname = 'bob'; myage = 40; an aside on var...
What is JavaScript? - Learn web development
unning code in response to certain events occurring on a web page. we used a click event in our example above to detect when the button is clicked and then run the code that updates the text label. and much more! what is even more exciting however is the functionality built on top of the client-side javascript language. so-called application programming interfaces (apis) provide you with extra superpowers to use in your javascript code. apis are ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement. they do the same thing for programming that ready-made furniture kits do for home building — it is much easier to take ready-cut panels and screw them together to make a bookshelf than it is to work out th...
What went wrong? Troubleshooting JavaScript - Learn web development
nctions. in this case, the code was not run and the error was not thrown until the checkguess() function was run by line 86. have a look at line 78, and you'll see the following code: loworhi.textcontent = 'last guess was too high!'; this line is trying to set the textcontent property of the loworhi constant to a text string, but it's not working because loworhi does not contain what it's supposed to. let's see why this is — try searching for other instances of loworhi in the code. the earliest instance you'll find in the javascript is on line 48: const loworhi = document.queryselector('loworhi'); at this point we are trying to make the variable contain a reference to an element in the document's html. let's check whether the value is null after this line has been run. add the ...
Object-oriented JavaScript for beginners - Learn web development
ny existing object. with your finished exercise from the previous sections loaded in the browser, try this in your javascript console: let person2 = object.create(person1); now try these: person2.name; person2.greeting(); you'll see that person2 has been created based on person1—it has the same properties and method available to it. one limitation of create() is that ie8 does not support it. so constructors may be more effective if you want to support older browsers. we'll explore the effects of create() in more detail later on. test your skills! you've reached the end of this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: object-orien...
Aprender y obtener ayuda - Learn web development
see if anyone can help you. browser testing it is often a good idea to see if your problem is affecting all browsers, or whether it only occurs in one or a small number of browsers. if it is only affecting one browser, for example, you can use that browser to narrow down the search. example searches might look like: <video> playback doesn't work in the ios browser. firefox doesn't seem to support the beetlejuice api. using mdn the site you are already on has a wealth of information available to you — both reference material for looking up code syntax, and guides/tutorials for learning techniques. we've provided most of the answers to the questions you'll have about web development fundamentals in this part of mdn. if you are stuck, then it is good to re-read the associated artic...
The "why" of web performance - Learn web development
d media file sizes reduces both the time to load and a site's power consumption (see performance budgets). tracking performance is important. multiple factors, including network speed and device capabilities affect performance. there is no single performance metric; and differing business objectives may mean different metrics are more relavant to the goals of the site or the organization that it supports. how the performance of your site is perceivedd is user experience! conclusion web performance is important for accessibility and also for other website metrics that serve the goals of an organization or business. good or bad website performance correlates powerfully to user experience, as well as the overall effectiveness of most sites. this is why you should care about web performance. ...
Properly configuring server MIME types - Learn web development
s are: text/html for normal web pages text/plain for plain text text/css for cascading style sheets text/javascript for scripts application/octet-stream meaning "download this file" application/x-java-applet for java applets application/pdf for pdf documents technical background registered values for mime types are available in iana | mime media types. the http specification defines a superset of mime which is used to describe the media types used on the web. why are correct mime types important? if the web server or application reports an incorrect mime type for content, a web browser has no way, according to the http specification, of knowing that the author actually intended the content to be processed and displayed in a way different from that implied by the reported mime t...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Ember app structure and componentization - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Accessibility in React - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Componentizing our React app - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React interactivity: Events and state - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React interactivity: Editing, filtering, conditional rendering - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React resources - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Beginning our React todo list - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Componentizing our Svelte app - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Using Vue computed properties - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue conditional rendering: editing existing todos - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Creating our first Vue component - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Getting started with Vue - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Adding a new todo form: Vue events, methods, and models - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Focus management with Vue refs - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Rendering a list of Vue components - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue resources - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Styling Vue components with CSS - Learn web development
ed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Understanding client-side JavaScript frameworks - Learn web development
per into svelte's reactivity system. we'll also look at solving some accessibility focus issues, and more besides. 6. working with svelte stores in this article we will show another way to handle state management in svelte — stores. stores are global global data repositories that hold values. components can subscribe to stores and receive notifications when their values change. 7. typescript support in svelte we will now learn how to use typescript in svelte applications. first we'll learn what typescript is and what benefits it can bring us. then we'll see how to configure our project to work with typescript files. finally we will go over our app and see what modifications we have to make to fully take advantage of typescript features. 8. deployment and next steps in this final artic...
Handling common accessibility problems - Learn web development
slightly more complex for video and audio content. there is a way to define text tracks (e.g. subtitles) and display them when video is being played, in the form of the <track> element, and the webvtt format (see adding captions and subtitles to html5 video for a detailed tutorial). browser compatibility for these features is fairly good, but if you want to provide text alternatives for audio or support older browsers, a simple text transcript presented somewhere on the page or on a separate page might be a good idea. element relationships and context there are certain features and best practices in html designed to provide context and relationships between elements where none otherwise exists. the three most common examples are links, form labels, and data tables. the key to accessible l...
Setting up your own test automation environment - Learn web development
r framework that will install webdriver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc. see setting up a selenium-webdriver project for more details of selenium setups for different languages. different browsers require different drivers to allow webdriver to communicate with and control them. see platforms supported by selenium for more information on where to get browser drivers from, etc. we will cover writing and running selenium tests using node.js, as it is quick and easy to get started, and a more familiar environment for front end devs. note: if you want to find out how to use webdriver with other server-side environments, also check out platforms supported by selenium for some useful links. ...
Package management basics - Learn web development
he lodash package, as it's so useful). although the package manager will do it’s best to deduplicate packages you may want to investigate exactly which version is installed. more commands you can find out more about the individual commands for npm and yarn online. again, pnpm commands will have parity with npm, with a handful of additions. making your own commands the package managers also support creating your own commands and executing them from the command line. for instance, we could create the following command: npm run dev # or yarn run dev this would run a custom script for starting our project in “development mode”. in fact, we regularly include this in all projects as the local development setup tends to run slightly differently to how it would run in production. if you...
Chrome Worker Modules
tch (ex) { log("exception raised at " + ex.modulename) log("stack: " + ex.modulestack); } subtleties you shouldn’t mix both styles exports.foo = bar and module.exports = {foo: bar}. if you do, know that any call to module.exports will overwrite all calls to `exports.foo = bar. you should not modify exports or module.exports once your module initialization is complete. the module loader supports cyclic calls to require(). however, if you have cyclic requirements, some of the modules involved in the cyclic requirements may become visible by the other modules before they are fully evaluated. no attempt is made to fully isolate modules from each other. in particular, globals (string, math, object, self) and the worker global scope itself (this) are shared between workers. in other word...
Embedding API for Accessibility
comments/questions? please contact the mozilla accessibility community. mozilla needs to move in the direction of accessibility. here is the w3c's definition of accessibility for a user agent like mozilla. in part, being accessible means supporting a built-in accessibility apis for a platform, such as microsoft active accessibility or atk for linux and unix desktops. there are many other pieces, such as preferences to allow the user to change foreground and background colors, and font sizes. mozilla already supports some of these options. this document lays out what we already have, and what we'll need later, in the embedding api to support accessibility. text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::set...
Mozilla Plugin Accessibility
2. focus gets stuck in plugin. user cannot keyboard navigate out of a plugin we will apply the same solution as in problem 4 above. the plugin will be responsible for bubbling up shift+tab and tab when the user has reached the end of the tab cycle within the plugin. the bug tracking this work is bug 93149. ? no target 3. many plugins lack accessibility api support most plugins that work with mozilla do not yet support accessibility apis. a notable acception is the adobe pdf plugin on windows, which supports msaa. in other cases, vendors need to find or be convinced of the business justification so that resources are applied to the problem. plugin vendors. unknown 4. seamonkey has no message bar for plugin installation ...
ZoomText
d to install zoomtext 8.11.3. happy testing! you may wish to read through the current issues on this page before reporting bugs. send me email so that i'm aware that you're testing and let me know what bugs you're finding. my email address is aaronleventhal@moonset.net. issues for ai squared, from high to low priority docreader and appreader don't respect the structure of the document -- no support for columns. zoomtext text to speech doesn't always echo what it should -- need more details from testers. mozilla issues cannot tab into frames and iframes. cannot customize the sidebar with the keyboard only. comboboxes report incorrect bounds, causing zoomtext tracking to move to the wrong area of the screen. ...
Index
rd party library usage add-ons, extensions, review policy to complete the review process at addons.mozilla.org (amo), reviewers must be able to verify the code in your extension. you may include third-party libraries in your extension. in that case, when you upload your extension to amo, you will need to provide links to the library source code. 689 updates firefox supports automated updates to add-ons using json update manifests. add-ons hosted on amo automatically receive updates to new versions posted there. other add-ons must specify the location of their update manifests. ...
Frequently Asked Questions for Lightweight themes
he gallery, you can access it from the submissions dashboard. from there, you can view your current designs. by clicking on each, you can make changes to each design's settings. what's the maximum file size allowable for my lightweight theme? the theme you upload may not exceed 300 kb for the header or the footer image. couldn't find the answer you're looking for? consider visiting the firefox support website or the themes forum for more help. ...
What to do and what not to do in Bugzilla
ld and the bug can't be reproduced with a current build. the bug reporter has not responded to questions for one month and the bug can't be reproduced with a current build. the bug reporter reports that they can no longer see the bug and no other people report that they are still seeing the bug. resolving bugs as incomplete the problem is vaguely described with no steps to reproduce, or is a support request. the reporter should be directed to the product's support page for help diagnosing the issue. if there are only a few comments in the bug, it may be reopened only if the original reporter provides more info, or confirms someone else's steps to reproduce. if the bug is long, when enough info is provided a new bug should be filed and the original bug marked as a duplicate of it. resolv...
Continuous Integration
set of performance tests on a variety of real android phones. it reports to a custom dashboard known as phonedash. tests currently run are primarily startup tests. games benchmarking (firefox) under development, the games benchmarking harness (aka mozbench) will allow a number of games-related benchmarks to be run against firefox and chrome. eventually, the system will likely be expanded with support for android. post-job analysis and alerts there is some analysis of test data that occurs out-of-band after jobs complete. perfherder alerts we track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (specified per test). performance sheriffs review the list of alerts on a reg...
Creating JavaScript callbacks in components
method, this magic only works for callback interfaces with a single method, like nsidomeventlistener. the javascript function is passed the same arguments as defined by the callback method. so we could convert the example above to accept javascript functions in place of the stringparserobserver by making the following changes: [scriptable, function, uuid(...)] interface stringparserobserver : nsisupports { void onword(string word); }; [scriptable, uuid(...)] interface stringparser { void parse(string data); void addobserver(stringparserobserver observer); }; note the only change was adding function to the interface attributes of the callback interface. now we can create a callback javascript function to handle the onword event: function handleword(word) { alert(word); } var strin...
Creating reftest-based unit tests
ph as it should be displayed and then the reference page would include that graphic in an <img> element. more investigation into whether this will work is definitely warranted. experiments with this have shown it to be not as easy as one would hope. we'll see. here is a list of reftest opportunities files in the source. these are files that have been checked in to be tested. presumably, one was supposed to open the pages with a browser and look at them and see if they look right. it is hard to tell how many of these will be usable as reftests. if the file is associated with a bug, the bug should be examined. i have seen a case where the html file in the bug had a problem, but the checked-in version was "cleaned up" and not valid for testing. mozilla has used html generation tools in the pa...
Debugging on Mac OS X
hen select the "info" tab. set the executable by clicking on "none" and selecting "other...". a new dialog titled "choose an executable to launch" will pop up. browse to the .app file that you want to debug (firefox.app, nightlydebug.app etc). the .app file is typically found inside the dist folder in your build directory. if you are debugging firefox, thunderbird, or some other application that supports multiple profiles, using a separate profile for debugging purposes is recommended. see "having a profile for debugging purposes" below. select the "arguments" tab in the scheme editor, and click the '+' below the "arguments passed on launch" field. add "-p profilename", where profilename is the name of a profile you created previously. repeat that to also add the argument "-no-remote". also...
Debugging on Windows
ing vs hang and seeing the "downloading symbols for <library>" status at the bottom left of the main window. problems post-mortem debugging on windows 7 sp1 x64? if you attempt to use ns_debugbreak etc to perform post-mortem debugging on a 64bit windows 7, but as soon as you try and continue debugging the program crashes with an access violation, you may be hitting a windows bug relating to avx support. for more details, including a work-around see this blog post or this social.msdn thread. (and just in-case those links die, the work-around is to execute bcdedit /set xsavedisable 1 from an elevated command-prompt to disable avx support.) got a tip? if you think you know a cool mozilla debugging trick, feel free to discuss it with #developers and then post it here. originally by heikk...
HTTP logging
tes to, while ensuring that the sum of these files’ sizes will never go over the specified limit. note 1: the file with the largest number is not guarantied to be the last file written! we don’t move the files, we only cycle. using the rotate module automatically adds timestamps to the log, so it’s always easy to recognize which file keeps the most recent data. note 2: rotate doesn’t support append. when you specify rotate, on every start all the files (including any previous non-rotated log file) are deleted to avoid any mixture of information. the append module specified is then ignored. use 'sync' if your browser crashes or hangs by default, http logging buffers messages and only periodically writes them to disk (this is more efficient and also makes logging less likely to...
Gmake vs. Pymake
path issues on windows on windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. gmake uses msys paths ("/c/dev/foo"), while pymake uses native windows paths ("c:\dev\foo"). if you try to switch from gmake to pymake or pymake to gmake the build will fail unless you did a relative configure. a relative configure produces paths that look like "../../foo" which can be understood by gmake and pymake. to configure relatively, invoke configure or client.mk from your objdir. ...
Makefile - variables
t_install inhibit generating and copying exports/install targets into $(moz_objdir)/dist/install. .ns_printing objs obj_suffix filename suffix to use when writing object files. module instructs the build system where to install exported headers. simple_programs suppress_default_rules inhibit processing of makefile tier targets/directory processing will be unordered. tier build order dependencies - subdirectories for make to traverse prior to building current. xpidl_module module name to use when generating .xpt files, default to module. xpidlsrcs internal: a list of .idl files to genera...
How Mozilla's build system works
hree sub-tiers: export, libs, and tools. these sub-tiers roughly correspond to the actions of pre-build, main-build, and post-build. this naming, however, can be misleading because all three sub-tiers are part of the build: export is used to do things like copy headers into place. libs is reserved for most of the work, like compiling c++ source files. tools is used to install tests and other support tools. when make is invoked, it starts at the export sub-tier of the first tier, and traverses all the directories in that tier. then, it does the same thing for the libs sub-tier and, subsequently, the tools sub-tier. it then moves on to the next tier and continues until no tiers remain. to view information about the tiers, you can execute the following special make targets: com...
Old Thunderbird build
present on the system. check to make sure that the path in which you placed the source code has no spaces, and is not too long. searched the bug database for issues relating to your problem (e.g., platform-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a symlink. a symlink there is not supported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link errors like "lnk1102: out of memory" or "lnk1318: unexpected pdb error; ok (0)", try deleting the largest .pdb files before rushing out the door to buy more ram. clobbering (see below) will also r...
Simple SeaMonkey build
requires more disk space, about 3 gb, and twice as much available ram. mk_add_options moz_objdir=/path/to/comm-central/obj-sm-debug ac_add_options --enable-application=suite ac_add_options --enable-debug ac_add_options --disable-optimize normally a shared build suffices for debugging purposes but current nightly releases are actually static builds which require even more memory to link. the support for libxul builds is still experimental but it should work if you --disable-mailnews. on windows, the above commands will create the comm-central directory in %userprofile% which may be some subfolder of c:\documents and settings\ on systems upgraded from xp or below. the space in this directory name, or in your user name if it contains one, will cause the configure script to break. to (pos...
Simple Sunbird build
you can give it a try, but its likely that the build system will present you an error. instead it is suggested to build thunderbird with lightning. please refer to the simple thunderbird build guide. you can build a bleeding-edge, development version of sunbird using the commands below. for complete information, see the build documentation. installing build tools if your system is not listed below, see the build prerequisites page. ...
pymake
prerequisites if running windows, you need to have a windows build environment installed for using pymake to build mozilla. on other operating systems (linux, os x, etc), pymake itself only requires python 2.6 or higher (but not python 3). please note that python 2.7 is strongly recommended. usage if you use mach for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine. ...
Creating Custom Events That Can Pass Data
custom dom events that can be used to pass data. using this technique you can add extra parameters and query them. for example, if you want firefox to perform an action whenever something happens (i.e., something other than the standard mouse/keyboard events) and, depending on the data passed along with this event, you want firefox to react differently. note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript. (see bug 427537) requirements in order to do this you must be able to do all of the following: download mozilla source code build mozilla creating custom firefox extensions with the mozilla build system. this is the foundation for everything we'll do. what's in a name despite whatever you ma...
Customizing Firefox
...
Eclipse CDT Manual Setup
ically update the index" turning off automatic indexing prevents the cpu intensive indexer from running at various stages during the steps below before we're ready. select "general > content types", expand "text > c source file > c++ source file", click "add" and add "*.mm". eclipse cdt doesn't currently understand objective-c files (although there is a project that promises to add objective-c support), so for now, this is the best we can do to give eclipse a chance of expanding its understanding of the source into the objective-c files. select "general > editors > text editors". if you want line numbers, tick "show line numbers". if you want a column marker to mark the 80th column to help with formatting code to mozilla's 80 character line limit, tick "show print margin" and set the valu...
Contributing to the Mozilla code base
firefox for ios swift contribute to firefox for ios firefox focus for ios swift contribute to firefox focus for ios mozilla hubs javascript and/or html/css, vr contribute to mozilla hubs servo rust contribute to servo there are even many ways to contribute to the mozilla mission without programming. if getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see community webiste. perhaps you do not know programming yet, but you want to start learning? there are plenty of resources available on the mdn web docs! step 1: find something to work on bugs listed as 'assigned' are not usually a good place to start unless you're sure you have something worthy to contri...
Listening to events on all tabs
adding a listener to listen to progress events on all tabs, call the browser's addtabsprogresslistener() method: gbrowser.addtabsprogresslistener(myprogresslistener); myprogresslistener is an object that implements the callbacks used to provide notifications of progress events. removing a listener to remove a previously installed progress listener, call removetabsprogresslistener(): gbrowser.removetabsprogresslistener(myprogresslistener); implementing a listener the listener object itself has five methods it can implement to handle various events: onlocationchange called when the uri of the document displayed in the tab changes. ...
Developer guide
ext generation of searching mozilla's source code. in active development. searchfox another option for mozilla code searching. indexes js as well as c++, includes blame capabilities. in active development. mozilla build vm a virtualbox compatible virtual machine configured with all the software needed to build and work on firefox. taskcluster taskcluster is the task execution framework that supports mozilla's continuous integration and release processes. treeherder treeherder shows the status of the tree (whether or not it currently builds successfully). check this before checking in and out, to be sure you're working with a working tree. perfherder perfherder is used to aggregate the results of automated performance tests against the tree. crash tracking information about the so...
Index
mozilla.org-distributed firefox builds dependencies, and/or to build firefox. 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mozilla's end-user support site. 168 performance best practices for firefox front-end engineers best practices, developing firefox, developing mozilla, firefox, front-end, mozilla, performance this guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox. always keep in mi...
Cross Process Object Wrappers
ix cpows with normal message manager messages. it’s also a bad idea to use cpows for anything security-related, since you may get results that are not consistent with surrounding code that might use the message manager. safe and unsafe cpows the main reason cpows can be bad for responsiveness is that they make the chrome process block on the content process. essentially, the problem is this: suppose the content process is busy with some long-running operation (for example, garbage collection). in multiprocess firefox, the browser ui is still responsive, because it's running in a different process. but if the chrome process then tries to use a cpow, the chrome process will block until the content process is ready to respond. suddenly, what looked like a simple property access could block ...
Limitations of chrome scripts
r see any attempts to load web content, because they happen in the content process. with the shim the shim enables you to add content policies in the chrome process. it transparently registers an nsicontentpolicy in the content process, whose shouldload just forwards to the chrome process. the content to check is forwarded as a cpow. the chrome process then checks the content against the policy supplied by the add-on, and forwards the response back to the child to be enforced. to make the shim unnecessary: define and register nsicontentpolicy in the content process. if you need to ensure that the policy is only registered once, use a process script to register the policy. nsiwebprogresslistener this api will work in the chrome process. there is a shim that gives you access to the domwind...
Communicating with frame scripts
ssagefromchrome); message-manager-disconnect if you're using a message manager to communicate with a script that may be running in a different process, you can listen for the message-manager-disconnect observer notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages. for example, suppose we load a script into the current <browser> on some event, and keep the browser message manager in an array, so we can send it messages: var messagemanagers = []; ... // on some event var browsermm = gbrowser.selectedbrowser.messagemanager; browsermm.loadframescript("chrome://my-addon@me.org/content/frame-script.js", false); messagemanagers.push(browsermm); console.log(messagemanagers.leng...
Message manager overview
since javascript modules are singletons they will only be executed once per process even when they are loaded in multiple frame scripts. the jsm can then use the child process message manager to exchange messages with the parent process message manager. th...
Storage access policy: Block cookies from trackers
fox will grant storage access scoped to the first party for a particular third-party origin as described in this section. currently, firefox includes some web compatibility heuristics that grant storage access to third-party resources classified as trackers when a user interacts with those third parties. we do this when we expect that not granting access would cause the web page to break. we also support an initial implementation of the storage access api, through which embedded <iframe>s can request storage access by calling document.requeststorageaccess(). although both of these approaches provide the same level of storage access, we recommend third parties switch to using the storage access api in order to guarantee their access to storage. automatic storage access upon interaction in or...
Firefox and the "about" protocol
(question mark) > troubleshooting information) about:sync-log displays a synchronization protocol related to the sync feature about:telemetry displays telemetry data collected and sent to mozilla while firefox is running (in case the user enabled telemetry) about:url-classifier displays...
Firefox
ty matrixthe following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox.multiple firefox profilesa profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mozilla's end-user support site.performance best practices for firefox front-end engineersthis guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.priv...
mozbrowserloadend
the mozbrowserloadend event is fired when the browser <iframe> has finished loading all its assets, or has failed to load. this can be used when the embedder wants to stop spinning a loading indicator, or update the ui in some other way to indicate loading is complete. ...
mozbrowserusernameandpasswordrequired
s non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserusernameandpasswordrequired event is fired when the content within a browser <iframe> requires an http authentification. the embedder is supposed to retrieve the necessary credentials, usually using a dialog or a database of username/passwords, and then call authenticate() or cancel() as appropriate. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarg...
CSS <display-xul> component
firefox supports the following -moz- prefixed xul display values: syntax -moz-box obsolete since gecko 64 xul box, mostly equivalent to flex -moz-inline-box obsolete since gecko 64 xul inline box, mostly equivalent to inline-flex -moz-grid obsolete since gecko 62 xul grid -moz-inline-grid obsolete since gecko 62 xul inline grid -moz-grid-group obsolete since gecko 62 xul grid group -moz-grid-line obsolete since gecko 62 xul grid line -moz-stack obsolete since gecko 62 xul stack -moz-inline-stack obsolete since gecko 62 xul inline stack -moz-deck obsolete since gecko 62 xul deck -moz-popup obsolete since gecko 62 xul popup all xul display values, with the exception of -moz-box and -moz-inline-box, have been removed in bug 1288572. see this firefox site compati...
Chrome-only CSS reference
Mozilla › Gecko › Chrome › CSS
eter. ::-moz-tree-rowthe ::-moz-tree-row css pseudo-element is used to select rows and apply styles to tree rows.::-moz-tree-row(hover)the ::-moz-tree-row(hover) css pseudo-class will match an element if the mouse cursor is presently hovering over a tree row.::-moz-tree-separatoractivated by the properties attribute.::-moz-tree-twistyactivated by the properties attribute.css -moz-bool-pref() @supports functionthe -moz-bool-pref() @supports condition is available to gecko chrome and ua stylesheets to check if a boolean preference is enabled.css <display-xul> component</display-xul>firefox supports the following -moz- prefixed xul display values:overflow-clip-boxthe overflow-clip-box css property specifies relative to which box the clipping happens when there is an overflow. it is short han...
Gecko SDK
ged as a result of security updates. you do have to get and distribute the newest gecko components (gklayout.dll etc.), though. downloading for gecko versions before 2.0, you should choose the gecko sdk version for the earliest version of mozilla you wish to target. for gecko versions 2.0 and higher, you must recompile your component for each release as cross-version compatibility is no longer supported. in addition to the below versions, you can find other versions (including beta) here: xulrunner releases (files include "sdk" in the name). the sdk follows the same release schedule as firefox/thunderbird. once the sdk enters beta, it is suitable for building extensions; your component should work with release builds of the sdk without any modifications. due to the rapid release proces...
HTML parser threading
ain thread. onstartrequest does all sorts of initialization on the main thread. at that point, nothing has happened on the parser thread yet and the nshtml5streamparser lives fully on the main thread. passing data to the parser thread nshtml5streamparser gets some of its methods called on the main thread and some called on the parser thread. the method implementations assert which thread they are supposed to be called on. ondataavailable and onstoprequest on the main thread post runnables on to the parser thread. there runnables obtain mtokenizermutex and call dodataavailable and dostoprequest, repectively, on the parser thread. these two methods along with timerflush (discussed later) are the entry points from the parser thread event loop into nshtml5streamparser. the runnables hold mtokeniz...
Geckoview-Junit Tests
it <class> please note that unlike robocop tests, <class> needs to be specified using the fully qualified class name including the package, e.g. org.mozilla.geckoview.test.contentdelegatetest. to run just one test: mozilla-central$ mach geckoview-junit <class>#<test> to run more than one test: mozilla-central$ mach geckoview-junit <class1>#<test1> <class2>#<test2> mach geckoview-junit also supports running a list of tests that are specified in a text file. each test must be listed on its own line. for example: <class1>#<test1> <class2> <class3>#<test2> <class3>#<test3> to run the tests specified in the file: mozilla-central$ mach geckoview-junit --test-filters-file <path-to-filter-file> disabling one failing test there is no manifest listing the geckoview junit tests. to disab...
Getting Started with Chat
ients and chatzilla. mibbit does not require flash or any other plugins. channels here is a list of channels you should be aware of as a member of the mozilla community: (remember to use irc.mozilla.org and port 6697 or 6667 for your server settings) #qa a channel for qa discussion #developers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here. commands the following is a list of commands you should be familiar with. simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the specified channel until you quit your irc client or quit the channel /leave lea...
How to add a build-time test
at the build system knows about it. standalone executables to add a test that is written in c or c++ and which is called as a standalone executable, a few things must be done. for standalone executables, if one sets up the right variables, then the rules.mk file will do lots of magic and most of the heavy lifting. a simple example of adding a test is in . note that the following variables are supplied by the rules.mk file: cppsrcs, simple_programs, run_test_program. xpcshell tests here are the simple guidelines for adding an xpcshell test to the build system. for now, enclose your test-related code (in the makefile) with ifdef enable_tests run the test program from the "check" target in the makefile. (example to run the testcookie program) in the test program: if the tes...
JavaScript Tips
expect an object that implements several interfaces thus requiring you to write a queryinterface method. however, in javascript 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. dom elements dom elements are just xpcom objects with some of...
Add-on Manager
many functions in the add-on manager interface operate asynchronously returning results through callbacks passed to the functions. ...
Http.jsm
method get, post or put (this is automatically set if postdata exists). ...
JavaScript OS.Constants
too many levels of symbolic links. emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot allocate memory enospc no space on device enotdir is not a directory enxio device no configured or does not support operation eopnotsupp (not always available under windows) operation not supported. eoverflow (not always available under windows) value too large to be stored in datatype. eperm operation not permitted erange result too large etimedout (not always available under windows) operation timed out. ewouldblock (not always avail...
Promise
he instant state and value of a promise cannot be inspected synchronously from code, without calling the then() method. to help with debugging, only when inspecting a promise object manually, you can see more information as special properties that are inaccessible from code (this, at present, is implemented by randomizing the property name, for the lack of more sophisticated language or debugger support). these code-inaccessible, inspectable properties are: {{private:status}}: 0 for pending, 1 for fulfilled, or 2 for rejected. {{private:value}}: fulfillment value or rejection reason, for fulfilled or rejected promises only. {{private:handlers}}: array of objects holding references to functions registered by the then() method, for pending promises only. examples see the examples pa...
PromiseWorker.jsm
wrapped in this meta object like so: return new promiseworker.meta({ thebuf: abuf, othernontrans: 'this string is not transfered but copied' }, {transfers: [abuf]}); a simple demo showing this in live action can be found here: github :: promiseworker transfer arraybuffer - worker side rejecting the promise to reject the promise from the worker, simply throw. various error objects are supported; each one has its specific meaning; they're described below. supported built-in javascript error are following: evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror in addition to them, stopiteration is also supported (note that stopiteration is deprecated). you can also construct and throw your own custom error objects as needed. when custom error ...
XPCOMUtils.jsm
(that is, the object itself) is returned. otherwise, null is returned. function generateqi( interfaces ); parameters interfaces an array of interfaces implemented by the component. return value a queryinterface() function implementation. remarks when you implement an interface that inherits from another one, you should generally list all the base interfaces explicitly, except for nsisupports. for example, if your component implements nsistreamconverter: mycomponent.prototype = { queryinterface: xpcomutils.generateqi([ components.interfaces.nsirequestobserver, components.interfaces.nsistreamlistener, components.interfaces.nsistreamconverter, ]), // ...methods... } importrelative() imports a javascript code module given the calling javascript code module's g...
Bootstrapping a new locale
ommand line: $ cd [ab-cd]/browser/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following output from your terminal: aboutcerterror.dtd pageinfo.dtd aboutdialog.dtd pageinfo.properties aboutprivatebrowsing.dtd pagereportfirsttime.dtd aboutrobots.dtd places aboutsessionrestore.dtd preferences aboutsupport.dtd quitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing browser.properties sanitize.dtd credits.dtd search.properties enginemanager.dtd searchbar.dtd enginemanager.properties setdesktopbackground.dtd feeds shellservice.properties history ...
Localizing XLIFF files for iOS
firefox for ios uses the xliff xml-based file format to hold and transfer localization data. xliff (extensible localisation interchange file format) is a localization standard governed by the oasis standards body. 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 corruption. most translation tools support the xliff standard, making localizing the xliff files for firefox for ios easy to do using translation tools. editing the raw xliff file is also rather easy, especially if you're already familiar with xml. this tutorial will walk you through the steps you need to take to translation strings within an xliff file. string repository for firefox on ios the firefox-ios.xliff file is located in s...
Localizing with Mercurial
ck ok. a new shell window should appear. type hg --version in the new shell window. if you see a message about the version of mercurial (e.g. mercurial distributed scm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on windows, refer to the instructions on mercurial's download page. mercurial on mac osx installing hg on mac osx is super easy. you can install mercurial via macports through the terminal, like so: $ sudo port install mercurial you can also install it by downloading the dmg package from the hg download page. it has an install dialog that will walk you through the process. if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open a terminal window and type hg --...
Localizing with Pontoon
nal translation memory, mozilla transvision, open source translation memory, microsoft terminology and machine translation. other locales displays matching translations from other locales. search almost like machinery, but takes provided keyword as input parameter instead of the original string. by clicking a suggestion, it gets copied into translation area. publishing your localization suppose you now want to publish your l10n work by committing it to a repo. pontoon lets you do that too! actually, it does that for you by automatically syncing with repositories on hourly basis. you can now pat yourself on the back, do a little dance, go to sleep or do something else to celebrate your work! ...
Translation phase
t are localized using the l10n tools above: mozilla.org every user's first mozilla experience. addons.mozilla.org (amo) a portal for all users interested in finding add-ons for their local mozilla applications. read the guidelines on localizing amo, straight from the amo team. developer.mozilla.org (mdn) where you are now! help localize the mdn user interface for everyone in your region. support.mozilla.com (sumo) a portal for anyone who needs technical support for their mozilla applications. help localize the sumo user interface for everyone in your region. mozilla engagement campaigns individual campaigns created by mozilla to attract new contributors. hacks.mozilla.org for everyone interested in the leading-edge stuff that people are doing with mozilla firefox and the open we...
Localization formats
lizer can break everything.) very hard to update automatically, if not impossible. can be hard to tell what has changed .lang files historically, mozilla has used a gettext-like file to present content for localization. .lang files provide some features that differentiate it from gettext: .lang is not dependent on php/.po library, so if our webdev team sets up a site without gettext support, we still have .lang. (it should be noted that this is near impossibility since most sites will be set up with gettext support.) .lang files can be easily edited in a text editor with this setup, a localizer is given a "[something].lang" file containing all the strings needing localization. that file will have the following structure: ;getting started débuter avec firefox the english...
Setting up the infrastructure
create a new branch for l10n (optional if starting a new project). create a locale directory in your website (usually something like docroot/locale). ...
Web Localizability
web applications. how to set up the infrastructure for localization. why localizability is important there are many reasons why you should start thinking about making your web app localizable as soon as possible. you will make localizer's life easier, for which they will be grateful. you will have quality content, localized and adapted to the needs of the local market. extending you web app to support new languages will be easy. the content will be easier to maintain and update. you will end up writing more semanticly-correct code, which is good for your seo. by reviewing your content and code for l12y, you will find and fix bugs in your original language too. ...
Fonts for Mozilla's MathML engine
fig> <dir>/your/path/to/texmf-dist/fonts/opentype</dir> </fontconfig> finally, add this configuration file to the system font location list and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug tracker to improve math support. firefox os you must use the mathml-fonts add-on. note: we plan to bundle a math font in the default installation. other systems on other systems, consider installing a math font using your package manager. note that these fonts are generally delivered with tex distributions such as tex live, but you might need to follow specific instructions so that your system is aware of the fonts.
MathML In Action
<math display="block"> <mstyle id="zoomablemath" mathbackground="yellow"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mrow> <mo>-</mo> <mi>b</mi> </mrow> <mo>&#xb1;</mo> <msqrt> <mrow> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>-</mo> <mrow> <mn>4</mn> <mi>a</mi> <mi>c</mi> </mrow> </mrow> </msqrt> </mrow> <mrow> <mn>2</mn...
Various MathML Tests
ensor indices <mmultiscripts>: r i1 j2 k3 ; this with <none/>, a qp i a bit of calculus: ∫ a b f ( x ) dx ∂ ∂ x f ( x , y ) + ∂ ∂ y f ( x , y ) here is the alphabet with invisible portions wrapped by <mphantom> in between: a b c d e f g h i j k l m n o p q r s t u v w x y z . testing mathml <msub>: a b ; a i ; a i k testing mathml <msup>: d b 2 a x 2 2 x ( 1 2 ) y a x . testing mathml <munder>, <mover>, and <munderover>: abcd un abcd ov abcd under over . testing mathml <msubsup>: a p q a b + c x . testing mathml <mrow>: d ( a b ) x 2 + 4 * x + p q = 0 , with this <mfrac> hanging here d * t ( i + j n ) + p y * q p x * b x + a + c d in the midd...
Mozilla MathML Project
for a quick overview, see the slides for the innovation fairs at mozilla summit 2013. updates status of each tag result of the mathml 3 testsuite unofficial nightly builds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content community view mozilla forums... mailing list newsgroup rss feed irc channel wiki used by contributors - check out the latest developments and help us improving mathml in mozilla. ...
Mozilla Port Blocking
discard 11 systat 13 daytime 15 netstat 17 qotd 19 chargen 20 ftp data 21 ftp control 22 ssh 23 telnet 25 smtp 37 time 42 name 43 nicname 53 domain 77 priv-rjs 79 finger 87 ttylink 95 supdup 101 hostriame 102 iso-tsap 103 gppitnp 104 acr-nema 109 pop2 110 pop3 111 sunrpc 113 auth 115 sftp 117 uucp-path 119 nntp 123 ntp 135 loc-srv / epmap 139 netbios 143 imap2 179 bgp 389 ldap ...
Mozilla Web Services Security Model
e services directory: <webscriptaccess xmlns="http://www.mozilla.org/2002/soap/security"> <allow type="soapv"/> <allow type="soap"/> </webscriptaccess> good examples (needed.) references new security model for web services, the original proposal for the web-scripts-access.xml file format web services roadmap, documenting when web services features, including the security model, were first supported additional reading documentation of crossdomain.xml, a similar format used by macromedia flash player ...
Mozilla Development Strategies
horough code reviews when you review someone else's code, review thoroughly. if another engineer checks in code that causes regressions or introduces bugs, you might be the one who has to fix it later. save yourself (and others) time later by doing a solid code review. review your own code before you ask for reviews practice your reviewing skills on your own patch before you seek reviews and a super review. better that you catch something, than the reviewers or super reviewers. you might find a problem, or find that you left in some dump() or printf() statements, or have messed up the whitespace. if you're working on something massive, start a branch if you are working on something big, and you want to be able to check in incrementally without getting reviews, create a branch. but having...
Mozilla projects on GitHub
tools adapter that lets you debug various remote targets from the firefox developer tools. firefox-dev.tools a web page to help new mozilla contributors find bugs to work on that relate to the firefox developer tools. gecko-dev a read-only mirror of the mercurial repositories used for mozilla private code. kitsune kitsune is the platform that drives the mozilla support web site, sumo. kuma the django project that powers this site (mdn). mdn code samples for the mdn web site. mozbrick the mozilla brick project. mozilla-b2g the firefox os project. mozilla-appmaker the appmaker project -- a web tool to let non-programmers create apps. mozilla-l10n scripts and tools used by the localization...
Mozilla Style System Documentation
ss declaration-blocks.) due to the high similarity of these lists between elements in the content tree, mozilla stores the output of the selector matching process in a lexicographic tree, the rule tree. this double tree (style context tree and rule tree) allows for sharing of style data, which allows the data to take up less memory and allows the data computation to take less time. ...
Investigating leaks using DMD heap scan mode
r moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: xpcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and tracked by the xpcom leak tracking system. from this chart, you can see how many objects of a particular type were leaked through shutdown. this can come in handy during the manual analysis phase later, to get evidence to support your hunches. for instance, if you think that an nsfoo object might be holding your leaking object alive, you can use this to easily see if we leaked an nsfoo object. moz_cc_log_shutdown=1: this generates a cycle collector log during shutdown. creating this log during shutdown is nice because there are less things unrelated to the leak in the log, and various cycle collector optimizations ar...
Leak-hunting strategies and tips
(or allocations?) all tier 1 platforms build with --enable-trace-malloc leak tools for simple objects and summary statistics tracemalloc all allocations all tier 1 platforms build with --enable-trac...
Measuring performance using the PerfMeasurement.jsm code module
rom within the application itself or an add-on. the first thing you need to do is to import the module into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") you can then create a perfmeasurement object. you give the constructor a bit-mask of events you're interested in; see note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. for instance, let's measure instructions executed, cache references, and cache misses: let monitor = new perfmeasurement(perfmeasurement.cpu_cycles | perfmeasurement.cache_references | perfmeasurement.cache_misses); this creates a new perfmeasurement object, configured to re...
Memory Profiler
ges along the timeline. this gives some intuition of how and when a bulk of objects are allocated. however, it still relies on developers' wisdom, and sometimes chances, to dig out the problematical code snippet. this memory profiler is designed to solve the inconveniences and limitations. the goal is to identify the memory eager codes directly. the profiler is designed at the very beginning to support not only javascript but also native codes. naturally, not only javascript objects but also native allocations are tracked. the profile while recording is stored in memory in a very compact format. it's supposed to profile a very long time period without problem. timeline view this view shows the allocation event across the period of time. it shows the overall memory usage history. red is al...
Power profiling overview
for example, the gecko profiler takes samples at 1000hz using a timer. each of these samples can trigger a wakeup, which consumes power and obscures firefox's natural wakeup patterns. for this reason, integrating power measurements into the gecko profiler is unlikely to be useful, and other power profiling tools typically use much lower sampling rates (e.g. 1hz.) p-states intel processors also support multiple p-states. p0 is the state where the processor is operating at maximum frequency and voltage, and higher-numbered p-states operate at a lower frequency and voltage to reduce power consumption. processors can have dozens of p-states, but the transitions are controlled by the hardware and os and so p-states are of less interest to application developers than c-states. power and power-r...
dtrace
a good starting command for profiling wakeups is the following. ...
tools/power/rapl
irst line indicates the meaning of each column. the underscores in _pkg_, _gpu_ and _ram_ are present so that each column's name has five characters. the total power is the sum of the package power and the ram power. the package estimate is divided into three parts: cores, gpu, and "other". "other" is computed as the package power minus the cores power and gpu power. if the processor does not support gpu or ram estimates then " n/a " will be printed in the relevant column instead of a number, and it will contribute zero to the total. once sampling is finished — either because the user interrupted it, or because the requested number of samples has been taken — the following summary data is shown: 10 samples taken over a period of 10.000 seconds distribution of 'total' values: ...
turbostat
turbostat is a linux command-line utility that prints various measurements, including numerous per-cpu measurements. this article provides an introduction to using it. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. ...
A brief guide to Mozilla preferences
e the default values if he or she knows how. another disadvantage is that existing profiles will not be affected. this method is considered user-hostile. any use of this technique by software such as firefox extension to override normal user preference will result in being added to the firefox blocklist or the preferences being forcibly removed. note: because of abuse of user.js preferences, support for user.js may be removed in a future version of firefox. see bug 1543752. sticky preferences sticky preferences were introduced in firefox 40 via bug 1098343. sticky preferences are created when they are defined using sticky_pref(). these preferences act as default preferences but whenever a value is created for the preference, that value is always written even when it matches the defa...
accessibility.tabfocus
the preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key. note: on mac os x, if this preference is not set, the full keyboard access setting in system preferences > keyboard is honored. type:integer default value: 7 (windows and linux); 2 (mac os x) exists by default: no application support:gecko 1.7 status: active introduction: bugs: bug 140612 values 1 give focus only to text fields (default on mac osx) 2 give focus to all form elements except text fields. 4 give focus only to links and linked images. other you can add these values to combine their functionality. the value 7 (give focus to all elements) is the default on windows and linux. ...
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link. type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while holding the alt key starts the download of that link. false (default) no action triggered (see bug 736985). ...
browser.dom.window.dump.file
browser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true. changes require an application restart. type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system path for the file in which the content of the window.dump() calls get written, e.g. c:\dump.txt . it will be created if it doesn't exist yet. the line breaks have to be in the argument of the dump function, else successive dump calls will get logged into the same line. related browser...
browser.download.lastDir.savePerSite
browser.download.lastdir.savepersite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-website (host) base. if set to true, the data is stored as content preference. type:boolean default value:true exists by default: no application support:firefox 11.0 status: active; last updated 2012-02-15 introduction: pushed to nightly on 2011-12-11 bugs: bug 702748 values true (default) the last used directory for the website (host) serving the file for download will be preselected in the file picker. if no download directory for the current website has been stored, browser.download.lastdir will be used. false the last used directory for any download (stored in browser.download.lastdir) will be the preselected d...
browser.pagethumbnails.capturing_disabled
the preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often visited pages for fast navigation. type:boolean default value:true exists by default: no application support: firefox 14.0 status: active; last updated 2012-09-17 introduction: pushed to nightly on 2012-04-13 bugs: bug 726347 values false the application creates screenshots of visited web pages. true (default) the application doesn't create screenshots of visited web pages. ...
browser.search.context.loadInBackground
browser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background. type:boolean default value:false exists by default: yes application support: firefox 13.0 status: active; last updated 2012-02-17 introduction: pushed to nightly on 2012-02-15 bugs: bug 727131 values true new tab with search results will be opened in the background, focus stays on the current tab. false (default) new tab with search results will be opened in the foreground. ...
browser.urlbar.formatting.enabled
the preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. false all parts of the url are given the same color: black. ...
browser.urlbar.trimURLs
the preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden. type:boolean default value: true exists by default: yes application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden. if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden. examples: https://www.example.org/ becomes https://www.example.org, http://www.example.org/foobar becomes www.ex...
dom.event.clipboardevents.enabled
dom.event.clipboardevents.enabled lets websites get notifications if the user copies, pastes, or cuts something from a web page, and it lets them know which part of the page had been selected. the emitting of the oncopy, oncut and onpaste events are controlled by this preference. type:boolean default value:true exists by default: no application support: gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) status: active; last updated 2012-02-15 introduction: pushed to nightly on 2012-02-14 bugs: bug 542938 values true (default) the oncopy, oncut and onpaste events are enabled for web content. false the oncopy, oncut and onpaste events are disabled for web content. ...
javascript.options.showInConsole
the preference javascript.options.showinconsole controls whether errors or warnings in chrome code are shown in the error console. type:boolean default value: false (true in debug builds) exists by default: yes application support:firefox 1.0 status: active introduction:2002-02-26 bugs: bug 125181 bug 337875 values false only errors and warnings from content code are shown. true (default) errors and warnings from both chrome and content are shown in the error console. note: since the web console was introduced in firefox 4 specifically for debugging content, the default value for this preference has changed to true as of gecko 2.0. ...
mail.tabs.drawInTitlebar
starting in thunderbird 17.0, the tabs are drawn in the title bar. the old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false. type:boolean default value: true exists by default: yes application support:thunderbird 17.0 status: active; last updated 2012-09-17 introduction: pushed to daily on 2012-08-08 bugs: bug 771816 values true (default) the tabs are drawn in the title bar of the mail program. false the tabs are drawn in a separate tab bar, and the title bar shows the title of the current tab (e.g. the subject of the currently selected mail). ...
nglayout.debug.disable xul fastload
the preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used. never set nglayout.debug.disable_xul_fastload to true in a production environment; it exists solely to aid in debugging. in particular, add-ons should never change this preference.. type:boolean default value: false (true in debug builds) exists by default: yes application support:? status: active introduction:? bugs: values false (default) xul fastload is used. true xul fastload is disabled. ...
reader.parse-on-load.force-enabled
the preference reader.parse-on-load.force-enabled controls if the reader mode used in firefox mobile should be enabled independent of the memory available in the device. by default, the reader mode in firefox mobile is only enabled if the memory is greater than 384mb. type:boolean default value: false exists by default: yes application support:firefox mobile 23.0 status: active; last updated 2013-05-11 introduction: pushed to nightly on 2013-05-06 bugs: bug 867875 values true reader mode is enabled independent of memory available. false (default) reader mode is only enabled if memory available exceeds a threshold (currenlty 384mb). ...
ui.SpellCheckerUnderline
ui.spellcheckerunderline holds the colour which is used to underline words not recognized by the spellchecker. type:string default value:#ff0000 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values a color code like #ff0000 for red. ...
ui.SpellCheckerUnderlineStyle
ui.spellcheckerunderlinestyle holds the style which is used to underline words not recognized by the spellchecker. type:integer default value:5 exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-02-22 introduction: pushed to nightly on 2009-04-03 bugs: bug 338209 values the values are defined in nsstyleconsts.h. 0 no underlining 1 dotted 2 dashed 3 single solid line 4 two solid lines 5 (default) wavy ...
ui.alertNotificationOrigin
ui.alertnotificationorigin controls the position and direction from which popup notifications invoked by nsialertsservice are sliding in. ...
ui.textSelectBackground
ui.textselectbackground saves the color in which the background of a text selection in the user interface or in content will be styled. ...
ui.textSelectForeground
ui.textselectforeground saves the color in which the text of a text selection in the user interface or the content will be styled. ...
ui.tooltipDelay
ui.tooltipdelay stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip. type:integer default value:500 exists by default: no application support: gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2011-12-15 bugs: bug 204786 values integer (milliseconds, default: 500) the time for delay between the mouse stopping over the element and the tooltip appearing is stored in milliseconds and the default value is 500ms. ...
view_source.syntax_highlight
the preference view_source.syntax_highlight controls whether markup in the view source view is syntax highlighted. type:boolean default value: true exists by default: yes application support:firefox 1.0 status: active introduction: bugs: bug 52154 values true (default) syntax hightlighting is enabled. false syntax hightlighting is disabled. ...
Preferences system
" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for plat...
Localization Use Cases
solution l20n isolates each language so that grammatical requirements of one don't affect others. this takes the responsibility away from the developers and puts it in the hands of localizers, at the same time transforming it from a burden into an opportunity. in l20n, the english string could be as simple as: <availablesize "{{ $size }} {{ $unit }} available"> on the other hand, the...
AsyncTestUtils extended framework
create one or more new sets of messages and add them to the provided folders. like make_folders_with_sets, the messages are spread across the folders. folders create a folder let folderhandle = make_empty_folder(aoptionalfoldername); you do not have to specify a folder name - if you don't care, we'll make one up for you. if you need to get fancy about having flags set on the folder, we support that, but please check the method documentation. get / create the junk folder let junkfolder = get_junk_folder(); create a virtual folder (a folder whose contents are the result of a saved search) let virtualfolder = make_virtual_folder([afoldertosearch1, afoldertosearch2, ...], {subject: "", body: "", from: "", to: "", cc: "", recipient: "", invol...
NSPR Contributor Guide
brary, for example: libnspr4.dll nspr is mostly complete. new apis are driven mostly by the os vendors as they add new features. should you decide that there's something that nspr does not cover that should be covered, let's talk. your proposed api should encapsulate a relatively low level capability as would be found in a system call or libc. your new feature must be implemented on all platforms supported by nspr. when you consider a new api for nspr ask yourself if your proposed feature can implement it across all platforms supported by nspr. if several platforms cannot be made to implement your api, then it is not a good candidate for inclusion in nspr. before you begin what may be a substantial effort in making a candidate feature for nspr, talk to us. we may tell you that you have a good...
NSPR build instructions
t build, specify the --enable-64bit configure option. --target=x86_64-pc-mingw32 for 64-bit builds on windows, when using the mozillabuild environment. --enable-win32-target=win95 this option is only used on windows. nspr build generates a "winnt" configuration by default on windows for historical reasons. we recommend most applications use the "win95" configuration. the "win95" configuration supports all versions of windows. the "win95" name is historical; it should have been named "win32". to generate a "win95" configuration, specify the --enable-win32-target=win95 configure option. --enable-debug-rtl this option is only used on windows. nspr debug build uses the release c run-time library by default. to generate a debug build that uses the debug c run-time library, specify the --ena...
NSPR's Position On Abrupt Thread Termination
threads are not processes. abrupt termination has been available in the unix/c environment for some time (exit()), and i assume that the basic semantics defined there are applicable here. ...
Nonblocking IO In NSPR
(a nonblocking socket). the tcp connection on that socket has been closed (end of stream). these two cases can be distinguished by <tt>pr_poll()</tt>. if <tt>pr_poll()</tt> reports that the socket is readable (i.e., <tt>pr_poll_read</tt> is set in <tt>out_flags</tt>), and <tt>pr_available()</tt> returns 0, this means that the socket connection is closed. current status implemented across all supported platforms. original document information author: wan-teh chang last updated date: october 30, 1997 ...
Atomic Operations
this chapter describes the global functions you use to perform atomic operations. the functions define a portable api that may be reliably used in any environment. since not all operating environments provide access to such functions, their performance may vary considerably. atomic operations functions the api defined for the atomic functions is consistent across all supported platforms. however, the implementation may vary greatly, and hence the performance. on systems that do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms. for such systems, nspr performs atomic operations just as efficiently as the client could. therefore, to preserve portability, it is recommended that clients use the nspr api for atomic operations. the...
I/O Functions
ket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers functions that operate on pathnames a file or directory in a file system is specified by its pathname. nspr uses unix-style pathnames, which are null-terminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a pathname. nspr converts the slashes in a pathname to the directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some file systems also differentiate drives or volumes. pr_open pr_delete pr_getfileinfo pr_getfileinfo64 pr_rename pr_access ...
I/O Types
ect-oriented flavor. an i/o function on a prfiledesc structure is carried out by invoking the corresponding "method" in the i/o methods table (a structure of type priomethods) of the prfiledesc structure (the "object"). different kinds of i/o objects (such as files and sockets) have different i/o methods tables, thus implementing different behavior in response to the same i/o function call. nspr supports the implementation of layered i/o. each layer is represented by a prfiledesc structure, and the prfiledesc structures for the layers are chained together. each prfiledesc structure has a field (of type prdescidentity) to identify itself in the layers. for example, the netscape implementation of the secure sockets layer (ssl) protocol is implemented as an i/o layer on top of nspr's socket lay...
Logging
lication, compile using the nspr debug build headers and runtime. set one of the compile-time defines when you build your application. execution-time control of nspr's logging uses two environment variables. these variables control which modules and levels are logged as well as the file name of the log file. by default, no logging is enabled at execution time. ...
Long Long (64-bit) Integers
perform 64-bit integer operations. the functions define a portable api that can be used reliably in any environment. where 64-bit integers are desired, use of nspr's implementation is recommended to ensure cross-platform compatibility. most of the 64-bit integer operations are implemented as macros. the specific implementation of each macro depends on whether the compiler for the target platform supports 64-bit integers. for a specific target platform, if 64-bit integers are supported for that platform, define have_long_long at compile time. 64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported platforms. limits and initialization rela...
Network Addresses
well-known port numbers that are part of the prnetaddr structure. network address types and constants prhostent prprotoent pr_netdb_buf_size network address functions initializing a network address pr_initializenetaddr facilitates the use of prnetaddr, the basic network address structure, in a polymorphic manner. by using these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently. all nspr functions that require prnetaddr as an argument accept either an ipv4 or ipv6 version of the address. pr_initializenetaddr converting between a string and a network address pr_stringtonetaddr pr_netaddrtostring converting address formats pr_convertipv4addrtoipv6 getting host names and addresses ...
PL_HashTableDestroy
le and all the entries. syntax #include <plhash.h> void pl_hashtabledestroy(plhashtable *ht); parameter the function has the following parameter: ht a pointer to the hash table to be destroyed. description pl_hashtabledestroy frees all the entries in the table and the table itself. the entries are freed by the freeentry function (with the ht_free_entry flag) in the allocops structure supplied when the table was created. ...
PRSockOption
pr_sockopt_mcasttimetolive ip multicast time-to-live. pr_sockopt_mcastloopback ip multicast loopback. pr_sockopt_nodelay disable nagle algorithm. don't delay send to coalesce packets. pr_sockopt_maxsegment maximum segment size. pr_sockopt_last always one greater than the maximum valid socket option numerator. description the prsockoption enumeration consists of all the socket options supported by nspr. the option field of prsocketoptiondata should be set to an enumerator of type prsockoption. ...
PR_AtomicSet
. syntax #include <pratom.h> print32 pr_atomicset( print32 *val, print32 newval); parameters the function has the following parameter: val a pointer to the value to be set. newval the new value to assign to the val parameter. returns the function returns the prior value of the referenced variable. description pr_atomicset first reads the value of var, then updates it with the supplied value. the returned value is the value that was readbefore memory was updated. the memory modification is unconditional--that is, it isn't a test and set operation. ...
PR GetAddrInfoByName
<prnetdb.h> praddrinfo *pr getaddrinfobyname( const char *hostname, pruint16 af, printn flags); parameters the function has the following parameters: hostname the character string defining the host name of interest. af the address family. may be pr_af_unspec or pr_af_inet. flags may be either pr_ai_addrconfig or pr_ai_addrconfig | pr_ai_nocanonname. include pr_ai_nocanonname to suppress the determination of the canonical name corresponding to hostname returns the function returns one of the following values: if successful, a pointer to the opaque praddrinfo structure containing the results of the host lookup. use pr_enumerateaddrinfo to inspect the prnetaddr values stored in this structure. when no longer needed, this pointer must be destroyed with a call to pr_freead...
PR_GetRandomNoise
buf must be at least as large as specified in size. size the size, in bytes, of the requested random number. returns prsize value equal to the size of the random number actually generated, or zero. ...
PR ImportTCPSocket
etion, a pointer to the prfiledesc object created for the newly imported native tcp socket. if the import of the native tcp socket failed, null. description a native tcp socket osfd can be imported into nspr with pr_importtcpsocket. the caller gives up control of the native tcp socket osfd and should use the prfiledesc* returned by pr_importtcpsocket instead. although pr_importtcpsocket is a supported function, it is declared in "private/pprio.h" to stress the fact that this function depends on the internals of the nspr implementation. the caller needs to understand what nspr will do to the native file descriptor and make sure that nspr can use the native file descriptor successfully. for example, on posix systems, nspr will put the native file descriptor (an int) in non-blocking mode b...
PR_LoadLibrary
er array that names the library to be loaded, as returned by pr_getlibraryname. returns if successful, returns a reference to an opaque prlibrary object. if the operation fails, returns null. use pr_geterror to find the reason for the failure. description this function loads and returns a reference to the specified library. the returned reference becomes the library's identity. the function suppresses duplicate loading if the library is already known by the runtime. each call to pr_loadlibrary must be paired with a corresponding call to pr_unloadlibrary in order to return the runtime to its original state. ...
PR_NormalizeTime
to normalize a time after performing arithmetic operations directly on the field values of the calendar time object. for example, if you have a ] object that represents the date 3 march 1998 and you want to say "forty days from 3 march 1998", you can simply add 40 to the tm_mday field and then call pr_normalizetime(). to calculate the optional field values tm_wday and tm_yday. for example, suppose you want to compute the day of week for 3 march 1998. you can set tm_mday to 3, tm_month to 2, and tm_year to 1998, and all the other fields to 0, then call pr_normalizetime() with pr_gmtparameters. on return, tm_wday (and tm_yday) are set for you. to convert from one time zone to another. for example, if the input argument time is in time zone a and the input argument params represents t...
PR_OpenTCPSocket
creates a new tcp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_opentcpsocket(printn af); parameters the function has the following parameters: af the address family of the new tcp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. a tcp connection is established by a...
PR OpenUDPSocket
creates a new udp socket of the specified address family. syntax #include <prio.h> prfiledesc* pr_openudpsocket(printn af); parameters the function has the following parameters: af the address family of the new udp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_openudpsocket creates a new udp socket o...
PR_SetError
sets error information within a thread context. syntax #include <prerror.h> void pr_seterror(prerrorcode errorcode, print32 oserr) parameters the function has these parameters: errorcode the nspr (platform-independent) translation of the error. oserr the platform-specific error. if there is no appropriate os error number, a zero may be supplied. description nspr does not validate the value of the error number or os error number being specified. the runtime merely stores the value and returns it when requested. ...
PR_StringToNetAddr
ess. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description for ipv4 addresses, the input string represents numbers in the internet standard "." notation. ipv6 addresses are indicated as strings using ":" characters separating octets, with numerous caveats for shortcutting (see rfc #1884). if the nspr library and the host are configured to support ipv6, both formats are supported. otherwise, use of anything other than ipv4 dotted notation results in an error. ...
Thread Pools
nspr's thread pool is modeled on the thread pools described by david r. butenhof inprogramming with posix threads (addison-wesley, 1997). ...
Building NSS
use the following commands: hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss to get the source of a specific release, see nss releases. build build nss using our build script: nss/build.sh this builds both nspr and nss. build with make alternatively, there is a make target called "nss_build_all", which produces a similar result. this supports some alternative options, but can be a lot slower. make -c nss nss_build_all use_64=1 the make-based build system for nss uses a variety of variables to control the build. below are some of the variables, along with possible values they may be set to. build_opt 0 build a debug (non-optimized) version of nss. this is the default. 1 build an optimized (non-debug) version of n...
NSS CERTVerify Log
the log tells you what the problem was with the chain and what certificate in the chain failed. to create a log: #include "secport.h" #include "certt.h" certverifylog *log; arena = port_newarena(512); log = port_arenaznew(arena,log); log->arena = arena; you can then pass this log into your favorite cert verify function. on return: log->count is the number of entries. log->head is the first entry; log->tail is the last entry. ...
Certificate functions
to interact with certificate databases. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 ...
Cryptography functions
ations based on the pkcs #11 interface. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions pk11_algtagtomechanism mxr 3.2 and later pk11_authenticate mxr 3.2 and later pk11_blockdata mxr 3.2 and later pk11_changepw mxr 3.2 and later pk11_checkuserpassword mx...
Deprecated SSL functions
applications that want to use the ssl shared libraries must convert to calling the new replacement functions listed below. each function name is linked to its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. ...
Getting Started With NSS
y of mozilla firefox and other applications that make use of nss? we are looking forward to your contributions! we have a large list of tasks waiting for attention, and we are happy to assist you in identifying areas that match your interest or skills. you can find us on mozilla irc in channel #nss or you could ask your questions on the mozilla.dev.tech.crypto newsgroup. the nss library and its supporting command line tools are written in the c programming language. its build system and the automated tests are based on makefiles and bash scripts. over time, many documents have been produced that describe various aspects of nss. you can start with: the current primary nss documentation page from which we link to other documentation. a general overview of the applications that use nss an...
Using JSS
Mozilla › Projects › NSS › JSS › Using JSS
zilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functions and types nssckbi pkcs #11 module containing built-in root ca certificates. optional. freebl_* processor-specific optimized big-number arithmetic library. not present on all platforms. more information... fort fortezza support. optional swft pkcs #11 module implementing fortezza in software. optional. if you built jss from source, you have these libraries in the mozilla/dist/<platform>/lib directory of your build tree. if you are downloading binaries, get them from the binary release locations in the above table. you need to select the right version of the components, based on the...
NSS Key Log Format
first hex-encoded application traffic secret for the server side (for tls 1.3) early_exporter_secret: the hex-encoded early exporter secret (for tls 1.3, used for 0-rtt keys in older quic drafts). exporter_secret: the hex-encoded exporter secret (for tls 1.3, used for 1-rtt keys in older quic drafts) the rsa form allows ciphersuites using rsa key-agreement to be logged and was the first form supported by wireshark 1.6.0. it has been superseded by client_random which also works with other key-agreement algorithms (such as those based on diffie-hellman) and is supported since wireshark 1.8.0. the tls 1.3 lines are supported since nss 3.34 (bug 1287711) and wireshark 2.4 (early_exporter_secret exists since nss 3.35, bug 1417331). the size of the hex-encoded secret depends on the selected c...
NSS_3.12.2_release_notes.html
db/stanpcertdb.c should set the pr_not_implemented_error error. bug 456854: cert_decodecertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates. bug 459231: memory leak in cert fetching - aia extension. bug 459248: support intel aes extensions. bug 459359: forwardbuilderstate object is leaked when aia path incorrect bug 459481: nss build problem with gcc 3.4.6 on os/2 documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation. new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above ...
NSS 3.15.4 release notes
upgrade immediately. bug 919877 - (cve-2013-1740) when false start is enabled, libssl will sometimes return unencrypted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method. implemented ocsp server functionality for testing purposes (httpserv utility). support sha-1 signatures with tls 1.2 client authentication. added the --empty-password command-line option to certutil, to be used with -n: use an empty password when creating a new database. added the -w command-line option to pp: don't wrap long output lines. new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_rec...
NSS 3.15.5 release notes
s 3.15.5 are described in the "bugs fixed" section below. distribution information the hg tag is nss_3_15_5_rtm. nss 3.15.5 requires nspr 4.10.2 or newer. nss 3.15.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_5_rtm/src/ new in nss 3.15.5 new functionality added support for the tls application layer protocol negotiation (alpn) extension. two ssl socket options, ssl_enable_npn and ssl_enable_alpn, can be used to control whether npn or alpn (or both) should be used for application layer protocol negotiation. added the tls padding extension. the extension type value is 35655, which may change when an official extension type value is assigned by iana. nss autom...
NSS 3.16.1 release notes
/releases/nss_3_16_1_rtm/src/ new in nss 3.16.1 new functionality added the "ecc" flag for modutil to select the module used for elliptic curve cryptography (ecc) operations. new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure. only rsa private keys are supported now. in secmod.h secmod_internaltopubmechflags - converts from nss-internal to public representation of mechanism flags. new types in sslt.h ssl_padding_xtn - the value of this enum constant changed from the experimental value 35655 to the iana-assigned value 21. . new macros in secmod.h public_mech_ecc_flag - a public mechanism flag for elliptic curv...
NSS 3.16.2.3 release notes
he result of tls version fallback. notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid. previously nss would only validate the peer's public key before performing ecdh key agreement. now ec public keys are validated at import time. bugs fixed in nss 3.16.2.3 bug 1057161 - nss hangs with 100% cpu on invalid ec key bug 1036735 - add support for draft-ietf-tls-downgrade-scsv to nss compatibility nss 3.16.2.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.16.2.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions ...
NSS 3.17.1 release notes
option that enables tls_fallback_scsv. off by default. in sslerr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default. added support for linux on little-endian powerpc64. bugs fixed in nss 3.17.1 this bugzilla query returns all the bugs fixed in nss 3.17.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17.1 acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris ...
NSS 3.17.3 release notes
n nss 3.17.3 are described in the "bugs fixed" section below. distribution information the hg tag is nss_3_17_3_rtm. nss 3.17.3 requires nspr 4.10.7 or newer. nss 3.17.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_3_rtm/src/ new in nss 3.17.3 new functionality support for tls_fallback_scsv has been added to the ssltap and tstclnt utilities. notable changes in nss 3.17.3 the quickder decoder now decodes lengths robustly (cve-2014-1569). the following ca certificates were removed cn = gte cybertrust global root sha1 fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 cn = thawte server ca sha1 ...
NSS 3.17.4 release notes
/mozilla.org/security/nss/releases/nss_3_17_4_rtm/src/ new in nss 3.17.4 new functionality no new functionality is introduced in this release. this is a patch release to fix multiple bugs. notable changes in nss 3.17.4 bug 1084986: if an ssl/tls connection fails, because client and server don't have any common protocol version enabled, nss has been changed to report error code ssl_error_unsupported_version (instead of reporting ssl_error_no_cypher_overlap). bug 1112461: libpkix was fixed to prefer the newest certificate, if multiple certificates match. bug 1094492: fixed a memory corruption issue during failure of keypair generation. bug 1113632: fixed a failure to reload a pkcs#11 module in fips mode. bug 1119983: fixed interoperability of nss server code with a libressl client. ...
NSS 3.19 release notes
onstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions. notable changes in nss 3.19 the ssl 3 protocol has been disabled by default. nss now more strictly validates tls extensions and will fail a handshake that contains malformed extensions (bug 753136). in tls 1.2 handshakes, nss advertises support for the sha512 hash algorithm in order to be compatible with tls servers that use certificates with a sha512 signature (bug 1155922). bugs fixed in nss 3.19 this bugzilla query returns all the bugs fixed in nss 3.19: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.19 acknowledgements the nss develop...
NSS 3.25 release notes
hg tag is nss_3_25_rtm. nss 3.25 requires netscape portable runtime (nspr) 4.12 or newer. nss 3.25 source distributions are available on ftp.mozilla.org for secure https download at the following location. source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_25_rtm/src/ new in nss 3.25 new functionality implemented dhe key agreement for tls 1.3. added support for chacha with tls 1.3. added support for tls 1.2 ciphersuites that use sha384 as the prf. removed the limitation that allowed nss to only support certificate_verify messages that used the same signature hash algorithm as the prf when using tls 1.2 client authentication. several functions have been added to the public api of the nss cryptoki framework. new functions in nssckfw.h ...
NSS 3.27.1 release notes
mplementation has been re-disabled in the default build. previous versions of nss made tls 1.3 (draft) available only when compiled with nss_enable_tls_1_3. nss 3.27 set this value on by default, allowing tls 1.3 (draft) to be disabled using nss_disable_tls_1_3, although the maximum version used by default remained tls 1.2. however, some applications query the list of protocol versions that are supported by the nss library, enabling all supported tls protocol versions. because nss 3.27 enabled compilation of tls 1.3 (draft) by default, it caused those applications to enable tls 1.3 (draft). this resulted in connectivity failures, as some tls servers are version 1.3 intolerant, and failed to negotiate an earlier tls version with nss 3.27 clients. nss 3.27.1 once again requires nss_enable_tl...
NSS 3.33 release notes
ch is a minor release. distribution information the hg tag is nss_3_33_rtm. nss 3.33 requires netscape portable runtime (nspr) 4.17, or newer. nss 3.33 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_33_rtm/src/ notable changes in nss 3.33 tls compression is no longer supported. api calls that attempt to enable compression are accepted without failure. however, tls compression will remain disabled. this version of nss uses a formally verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been removed. when nss is compiled without nss_force_fips=1 startup checks are no longer performed. fixes cve-2017-7805, a potential us...
NSS 3.34 release notes
ions. new in nss 3.34 new functionality when listing an nss database. using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the listing. when using certutil, to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed. sslkeylogfile is now supported with tls 1.3, see bug 1287711 for details. sslchannelinfo has two new fields (bug 1396525) sslnamedgroup originalkeagroup holds the key exchange group of the original handshake, when the session was resumed. prbool resumed is pr_true when the session is resumed, and pr_false otherwise. rsa-pss signatures are now supported on certificates. certificates with rsa-pss or rsa-pk...
NSS 3.38 release notes
sed network security services (nss) 3.38, which is a minor release. distribution information the hg tag is nss_3_38_rtm. nss 3.38 requires nspr 4.19 or newer. nss 3.38 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_38_rtm/src/ new in nss 3.38 new functionality added support for the tls record size limit extension. when creating a certificate request (csr) using certutil -r, an existing orphan private key can be reused. parameter -k may be used to specify the id of an existing orphan key. the available orphan key ids can be displayed using command certutil -k. when using certutil -o to print the chain for a given certificate nickname, the new parameter --simple...
NSS 3.40 release notes
s) 3.40, which is a minor release. distribution information the hg tag is nss_3_40_rtm. nss 3.40 requires nspr 4.20 or newer. nss 3.40 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_40_rtm/src/ new in nss 3.40 new functionality the draft-00 version of encrypted sni support is implemented tstclnt now takes -n option to specify encrypted sni key new functions none notable changes in nss 3.40 the mozilla::pkix library has been ported from mozilla psm to nss. this is a c++ library for building certification paths. mozilla::pkix apis are not exposed in the libraries nss builds. it is easier to build nss on windows in mozilla-build environments. ...
NSS 3.41 release notes
256 fingerprint: 56c77128d98c18d91b4cfdffbc25ee9103d4758ea2abad826a90f3457d460eb4 cn = opentrust root ca g2 sha-256 fingerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.41 bug 1412829, reject empty supported_signature_algorithms in certificate request in tls 1.2 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1481271 - resend the same ticket in clienthello after helloretryrequest bug 1493769 - set session_id for external resumption tokens bug 1507179 - reject ccs after handshake is complete in tls 1.3 this bugzilla query returns...
NSS 3.44.1 release notes
ion information the hg tag is nss_3_44_1_rtm. nss 3.44.1 requires nspr 4.21 or newer. nss 3.44.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_1_rtm/src/ other releases are available in nss releases. ...
NSS 3.48 release notes
91742 - ensure des iv length is valid before usage from pkcs#11 bug 1588567 - enable mozilla::pkix gtests in nss ci bug 1591315 - update nsc_decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, optionally for legacy key3.db storage bug 1590972 - use -std=c99 rather than -std=gnu99 bug 1590676 - fix build if arm doesn't support neon bug 1575411 - enable tls extended master secret by default bug 1590970 - ssl_settimefunc has incomplete coverage bug 1590678 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1588244 - nss changes for delegated credential key strength checks bug 1459141 - add more cbc padding tests that missed nss 3.47 bug 1590339 - fix a memory leak in btoa.c bug 1589810 - fix uninitializ...
NSS 3.49 release notes
e bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
NSS 3.51.1 release notes
org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_1_rtm/src/ other releases are available in nss releases. notable changes in nss 3.51.1 bug 1617968 - update delegated credentials implementation to draft-07. bugs fixed in nss 3.51.1 bug 1619102 - add workaround option to include both dtls and tls versions in dtls supported_versions. bug 1619056 - update readme: tls 1.3 is not experimental anymore. bug 1618739 - don't assert fuzzer behavior in ssl_parsesessionticket. bug 1618915 - fix ubsan issue in ssl_parsesessionticket. bug 1608245 - consistently handle null slot/session. bug 1608250 - broken fipstest handling of ki_len. bug 1617968 - update delegated credentials implementation to draft-07. compatib...
NSS 3.51 release notes
g 1608892 - update dtls 1.3 implementation to draft-34. bug 1611209 - correct swapped pkcs11 values of ckm_aes_cmac and ckm_aes_cmac_general bug 1612259 - complete integration of wycheproof ecdh test cases bug 1614183 - check if ppc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation error for ‘getfipsenv’ "defined but not used" bug 1615208 - send dtls version numbers in dtls 1.3 supported_versions extension to avoid an incompatibility. bug 1538980 - secu_readderfromfile calls strstr on a string that isn't guaranteed to be null-terminated bug 1561337 - correct a warning for comparison of integers of different signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fip...
NSS 3.56 release notes
ble on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_56_rtm/src/ other releases are available in nss releases. notable changes in nss 3.56 nspr dependency updated to 4.28. the known issue where makefile builds failed to locate seccomon.h was fixed in bug 1653975. bugs fixed in nss 3.56 bug 1650702 - support sha-1 hw acceleration on armv8 bug 1656981 - use mpi comba and mulq optimizations on x86-64 macos. bug 1654142 - add cpu feature detection for intel sha extension. bug 1648822 - add stricter validation of dh keys in fips mode. bug 1656986 - properly detect arm64 during gyp build architecture detection. bug 1652729 - add build flag to disable rc2 and relocate to lib/freebl/deprecated. bu...
NSS Developer Tutorial
ons. the symbol export lists are the authoritative source of public functions. behavioral changes bug/quirk compatible: occasionally we cannot fix a bug, because applications may depend on the buggy behavior. we would need to add a new function to provide the desired behavior. similarly, new options often need to be disabled by default. nss review/feature approval process nss doesn’t have 'super reviewers'. we wish to increase the number of nss developers, who have broad understanding of nss. one review is usually enough for the review to pass. for critical code reviews, such as a patch release of a stable branch, two reviews may be more reasonable. for new features, especially those that appear controversial, try to find a reviewer from a different company or organization than your ...
Enc Dec MAC Output Public Key as CSR
treq_trailer "-----end new certificate request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } headertype; /* this is conditionalized because port_errortostring was introduced with nss 3.13. * though pr_errortostring was available, support for it in nss wasn't. * fixme: samples should determine the version of nss that's available and refuse * to run if not 3.13 or higher. */ #ifndef port_errortostring #ifndef sec_error_base #define sec_error_base (-0x2000) #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */ static void ...
NSS Sample Code Utilities_1
fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server environments * where prompting the user for a password or requiring it * to be entered in the command line is not a feasible option. * * this function supports password extraction from files with * multiple passwords, one for each token. in the single password * case a line would just have the password whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ char *filepasswd(pk11slotinfo *slot, prbool retry, void *arg) { char* phrases, *phrase; prfiledesc *fd; ...
sample2
ns_cert_trailer "-----end certificate-----" /* missing publically from nss versions earlier than 3.13 */ #ifndef sec_error_base #define sec_error_base (-0x2000) typedef enum { sec_error_io = sec_error_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13. on earlier versions of nss that * don't support error tables, pr_errortostring will return "unknown code". */ #ifndef port_errortostring #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5...
nss tech note5
eratekeypair<big> is the function to use</big>. see a sample program that uses this function. ...
nss tech note6
the chk files will no longer match the softoken and freebl shared libraries . 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 cryptographic module . the only way to meet this requirement is for your application never to modify the nss binaries. any offer of binary support that may have been previously made to you by nss developers is null and void. if your build process modifies nss libraries in any way (for example, to strip the symbols), it should consider not doing so for the reasons cited above. if you still decide to make unsupported changes, you can allow the softoken to come up in fips 140 mode of operation by regenerating the .chk files yourself. th...
NSS Tech Notes
tn1: how to use the nss asn.1 and quickder decoders. tn2: using the pkcs #11 module logger. tn3: all about certificate extensions. tn4: pulling certificate extension information out of ssl certificates. tn5: using nss to perform miscellaneous cryptographic operations. tn6: nss .chk files for the fips mode. ...
Notes on TLS - SSL 3.0 Intolerant Servers
ce option setting at: edit | preferences | privacy and security | ssl | enable tls, and turn it off if it is on for these earlier browsers. netscape 6.1 or mozilla 0.9.2 and later these browsers shipped with the tls option on but also included a graceful rollback mechanism on the client side when they encounter known tls/ssl 3.0 intolerant servers. firefox 2 and later starting with firefox 2, support for ssl 2.0 has been disabled by default; unless it is expressly re-enabled by the user using about:config. website administrators: how to avoid this problem? upgrade to a newer version if available, which corrects this problem. there will be other network clients which implement tls/ssl 3.0 specification correctly and have a problem with your site. let's not perpetuate the problem server...
PKCS11 module installation
pkcs #11 modules are external modules which add to firefox support for smartcard readers, biometric security devices, and external certificate stores. this article covers the two methods for installing pkcs #11 modules into firefox. users can use the preferences dialog to install or remove pkcs #11 module. extensions can programmatically manage pkcs #11 modules using the nsipkcs11 programming interface. note: the information in this article is specific to firefox 3.5 and newer. older versions of firefox may support the window.pkcs11 property for installing pkcs #11 modules. using the firefox preferences to install pkcs #11 modules save the pkcs #11 module to a permanent location on your local computer open the firefox preferences dialog. choose "advanced" > "encryption" > "secur...
PKCS 12 functions
the public functions listed here perform pkcs #12 operations required by some of the nss tools and other applications. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions sec_pkcs12addcertandkey mxr 3.2 and later sec_pkcs12addpasswordintegrity mxr 3.2 and later sec_pkcs12createexportcontext mxr 3.2 and later sec_pkcs12createpasswordprivsafe mxr 3.2 and later sec_pkcs12createunencryptedsafe mxr 3.
PKCS 7 functions
the public functions listed here perform pkcs #7 operations required by mail and news applications and by some of the nss tools. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. 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_pkcs7contentisencrypted mxr 3.4 and later ...
Build instructions
build_opt: if set to 1, means do optimized non-debug build. default is debug, non-optimized build. use_debug_rtl: if set to 1, on windows, causes build with debug version of the c run-time library. ns_use_gcc: on platforms where gcc is not the native compiler, tells nss to build with gcc instead of the native compiler. default is to build with the native compiler. use_64: on platforms that support both 32-bit and 64-bit abis, tells nss to build for the 64-bit abi. default is 32-bit abi, except on platforms that do not support a 32-bit abi. moz_debug_symbols: tells nss to build with debug symbols, even in an optimized build. on windows, in both debug and optimized builds, when using msvc, tells nss to put symbols in a .pdb file. required to build with msvc 8 (2005 express). default is ...
FC_GetMechanismInfo
name fc_getmechanisminfo - get information on a particular mechanism. syntax ck_rv fc_getmechanisminfo( ck_slot_id slotid, ck_mechanism_type type, ck_mechanism_info_ptr pinfo ); parameters fc_getmechanisminfo takes three parameters: slotid [input] type [input] . pinfo [output] . description fc_getmechanisminfo obtains information about a particular mechanism possibly supported by a token. a user may call fc_getmechanisminfo without logging into the token (to assume the nss user role). return value ckr_ok examples see also nsc_getmechanisminfo ...
FC_OpenSession
en a session between an application and a token. syntax ck_rv fc_opensession( ck_slot_id slotid, ck_flags flags, ck_void_ptr papplication, ck_notify notify, ck_session_handle_ptr phsession ); parameters fc_opensession has the following parameters: slotid [in] the id of the token's slot. flags [in] papplication notify [in] pointer to a notification callback function. not currently supported. phsession [out] pointer to a session handle. description fc_opensession opens a session between an application and the token in the slot with the id slotid. the nss cryptographic module currently doesn't call the surrender callback function notify. (see pkcs #11 v2.20 section 11.17.1.) a user may call fc_opensession without logging into the token (to assume the nss user role). return ...
FC_WaitForSlotEvent
name fc_waitforslotevent - waits for a slot event, such as token insertion or token removal, to occur. syntax ck_rv fc_waitforslotevent(ck_flags flags, ck_slot_id_ptr pslot ck_void_ptr preserved); parameters fc_waitforslotevent takes three parameters: [input] flags [input] pslot. preserved. description this function is not supported by the nss cryptographic module. return value fc_waitforslotevent always returns ckr_function_not_supported. examples see also fc_waitforslotevent ...
NSS_Initialize
ule db, just initialize the pkcs #11 module. nss_init_forceopen - continue to force initializations even if the databases cannot be opened. nss_init_norootinit - don't try to look for the root certs module automatically. nss_init_optimizespace - optimize for space instead of speed. use smaller tables and caches. nss_init_pk11threadsafe - only load pkcs#11 modules that are thread-safe, i.e., that support locking - either os locking or nss-provided locks . if a pkcs#11 module isn't thread-safe, don't serialize its calls; just don't load it instead. this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, the java sunpkcs11 provider. nss_init_pk11reload - ignore the ckr_cryptoki_already_initialized error when load...
NSS cryptographic module
the nss cryptographic module has two modes of operation: the non-fips (default) mode and fips mode. ...
NSS tools : ssltab
rt the browser to clear the session id cache. if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate. if you are using the default badcert callback, you can still connect through a dialog. if you are not using the default badcert callback, the one you supply must allow for this possibility. see also the nss security tools are also documented at [1]http://www.mozilla.org/projects/security/pki/nss/. additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [2]http://pki.fedoraproject.org/wiki/. for information specific...
NSS tools : ssltap
rt the browser to clear the session id cache. if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate. if you are using the default badcert callback, you can still connect through a dialog. if you are not using the default badcert callback, the one you supply must allow for this possibility. see also the nss security tools are also documented at [1]http://www.mozilla.org/projects/security/pki/nss/. additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [2]http://pki.fedoraproject.org/wiki/. for information specific...
gtstd.html
modules. ssl is built on top of nspr, which handles sockets, threads, and related low-level os operations. on any given server or client, one or more pkcs #11 modules may be available. figure 2.1 relationships among nss libraries, cryptographic modules, slots, and tokens as shown in the figure, ssl communicates with pkcs #11 modules through the pkcs #11 interface. any pkcs #11 module that supports pkcs #11 can be used with the nss libraries. netscape software uses a file called secmod.db to keep track of the modules available. a pkcs #11 module always has one or more slots, which may be implemented as physical hardware slots in some form of physical reader (for example, for smart cards) or as conceptual slots in software. each slot for a pkcs #11 module can in turn contain a token, ...
S/MIME functions
the public functions listed here perform s/mime operations using the s/mime toolkit. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions nss_cmscontentinfo_getbulkkey mxr 3.2 and later nss_cmscontentinfo_getbulkkeysize mxr 3.2 and later nss_cmscontentinfo_getcontent mxr 3.2 and later nss_cmscontentinfo_getcontentencalgtag mxr 3.2 and later nss_cmscontentinfo_getcontenttypetag mxr 3.2 and later ...
Utility functions
nitialization tasks and other services. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions atob_asciitodata mxr deprecated 3.2 use nssbase64_decodebuffer atob_convertasciitoitem mxr deprecated 3.2 use nssbase64_decodebuffer btoa_convertitemtoascii mxr deprecated 3.2 use nssbase64_encodeitem ...
NSS Tools certutil-tasks
tions just print a usage message. improve certificate listings. allow for sorting by name and trust. sorting by trust will return ca certs first. allow listing and lookup of keys by index and nickname. improve coherence of key and certificate nicknames. remove keys "stranded" without a certificate (except for the imminent (????) encryption key for password files). support importing keys from a file. improve hardware token support. (bugfix) some certificate extensions cause certutil to crash. (bugfix) certificate entries require a serial number; one should be generated automatically if not provided. (bugfix) null password is given to new key3.db; should prompt user for an initial password. (bugfix) listing provate keys does not work...
NSS Tools ssltap
t the browser to clear the session id cache. if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate. if you are using the default badcert callback, you can still connect through a dialog. if you are not using the default badcert callback, the one you supply must allow for this possibility. ...
NSS tools : signver
Mozilla › Projects › NSS › tools › signver
ng standard cryptographic techniques. the signature verification tool can also display the contents of the signed object. options -a displays all of the information in the pkcs#7 signature. -v verifies the digital signature. -d [sql:]directory specify the database directory which contains the certificates and keys. signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -a sets that the given signature file is in ascii format. -i input_file ...
NSS tools : ssltap
Mozilla › Projects › NSS › tools › ssltap
lear the session id cache. if you run the tool on a machine other than the ssl server to which you are trying to connect, the browser will complain that the host name you are trying to connect to is different from the certificate. if you are using the default badcert callback, you can still connect through a dialog. if you are not using the default badcert callback, the one you supply must allow for this possibility. see also the nss security tools are also documented at [1]http://www.mozilla.org/projects/security/pki/nss/. additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [2]http://pki.fedoraproject.org/wiki/. f...
Necko FAQ
a word rhyming with gecko and starting with the same letters as networking. that's all! any resemblance in flavor to the necco candy is purely coincidental. what do i need to build this library? see the code section on the main page. currently you'd need to get the mozilla tree and at least build nspr, and xpcom. todo put links! how does psm fit into this picture? todo how does the proxy support work? todo what about proxy auto config? todo what about socks support? todo when is the next stable release of this library going to be available? todo i'd like to use this library for my project. what licences apply? todo - mpl what do the page load options mean in the preferences? todo original document information author(s): gagan saksena last updated date: december ...
Pork Tool Development
g offset. this can be translated to an unboxedloc, which has a line and column offset (see renamer.cc:65). macro expansion this section refers to macro expansion when using mcpp (see installing pork). for the rename_class.cpp test, generate the file with "gcc -e -wp,-w0,-k rename_class.cpp > rename_class.cc" and run the renamer with "../renamer -rename foo bar rename_class.cc". for terminology, suppose "my_foo" --> "foo". then any post-location variables refer to "foo" and pre-location variables refer to "my_foo". cppsourceloc wraps sourceloc, providing information about macro expansion. cppsourceloc will change the previously provided location information (in variable cpp_source_loc._loc) from post-location to pre-location. all values from the ast refer to the post-location. notes the #s...
Pork Tools
in this case all of the callsites are modified to: a) getter_addrefs case: getter(getter_addrefs(foo)) -> foo = getter() b) all other cases: getter(&foo) -> foo = getter().get() ...
Rhino and BSF
this framework has been embedded in a number of open source projects, including the xsl processor xalan and the xml/java build tool ant. ...
Rhino documentation
serialization how to serialize javascript objects and functions in rhino. runtime a brief description of the javascript runtime. small footprint hints for those interested in small-footprint embeddings. examples a set of examples showing how to control the javascript engine and build javascript host objects. using rhino with bean scripting framework (bsf) how to use rhino with apps that support bsf (bean scripting framework) from the apache jakarta project. external references scripting languages for java (link broken? try this at http://archive.is/ssvxq ) an article comparing and contrasting rhino and jython. rhino contributors interested in contributing to rhino? check out the rhino wish list. ...
Rhino downloads archive
-07-27 changes in 1.5r2 rhino15r2.zip rhino 1.5r1 2000-09-10 changes in 1.5r1 rhino15r1.zip rhino 1.4r3 1999-05-10 initial public release rhino14r3.zip rhino 1.6r1 through 1.6r6 implement e4x using xmlbeans library. if you would like to use e4x you need to add xbean.jar from xmlbeans distribution to your class path. in rhino 1.6r6 and later the e4x support has been rewritten to rely solely on the dom3 apis supported natively by java 1.5. (pre-java 1.5 users can use dom3 using java's endorsed standards override mechanism if they have a dom3-capable xml parser.) if neither xmlbeans nor dom3 are present, e4x is not available. if you are looking for js.jar for xslt or for ibm's bean scripting framework (bsf), please read the following note and th...
The JavaScript Runtime
interpretation beginning with rhino 1.4 release 2, an interpretive mode is supported. when scripts are compiled in interpretive mode, an internal representation of the compiled form is created and stored rather than generating a java class. execution proceeds by evaluating this compiled form using support routines in rhino. compilation to java bytecodes for improved performance, rhino may compile javascript scripts to java bytecodes. the generated bytecodes in turn depend upon runtime support routines. each javascript script or function is compiled to a separate class. compilation of javascript source to class files is supported. it is possible to specify the class files as well as the packages to generate into. types and values there are six fundamental types in javascript. the...
Rhino scopes and contexts
e collected until there are no active references to the shared scope potentially leading to memory leaks. in addition if a script alters some of the standard objects, the library may not work properly for other scripts. such bugs are hard to debug and to remove a possibility for them to occur one can seal the shared scope and all its objects. a notion of a sealed object is a javascript extension supported by rhino and it means that properties can not be added/deleted to the object and the existing object properties can not be changed. any attempt to modify sealed object throws an exception. to seal all objects in the standard library passtrue for the sealed argument when calling context.initstandardobjects(scriptableobject, boolean): scriptableobject sealedsharedscope = cx.initstandardobjec...
Scripting Java
ies: javaexception: the original exception thrown by the java method rhinoexception: the exception wrapped by the rhino runtime the instanceof operator can be used to query the type of an exception: try { java.lang.class.forname("nonexistingclass"); } catch (e) { if (e.javaexception instanceof java.lang.classnotfoundexception) { print("class not found"); } } rhino also supports an extension to the try...catch statement that allows to define conditional catching of exceptions: function classforname(name) { try { return java.lang.class.forname(name); } catch (e if e.javaexception instanceof java.lang.classnotfoundexception) { print("class " + name + " not found"); } catch (e if e.javaexception instanceof java.lang.nullpointerexception) { ...
Shumway
e point to allow plugin-free compatibility with swf-based games and animations. shumway has certain limitations compared to adobe flash player especially when unavoidable patents (such as those surrounding flash drm) get in the way. some of its current limitations are just temporary, however. there are a few situations where a user may use shumway to view your content: their platform does not support adobe flash player. the user did not install adobe flash player. the user has adobe flash player disabled (or set to "click-to-enable") for performance or security reasons. there might be a time where users want to experience your content but flash is no longer supported by adobe. to emphasize a point: the current behavior is that shumway works on any swf file unless (or until) the adobe...
Creating JavaScript jstest reftests
t repository and read about here. an update script exists in the js/src/tests directories to fetch and reformat the test262 suite, see test262-update.py. writing a new test file please read the high level advice for test writing in the parent article here. jstests has a special requirement: the call to reportcompare in every jstest is required by the test harness. except in old tests or super strange new tests, it should be the last line of the test. comparison functions and shared test functionality the jstest runner loads the code in js/src/tests/shell.js for every test. additionally, it loads every shell.js and broswer.js file in the subdirectories on the path from js/src/tests to the location of your test. if you have functionality several tests share in a given folder, you c...
How to embed the JavaScript engine
until buttons appear. then click the view source button, and copy the code from the window that appears. compile the helloworld application and link to the spidermonkey library. run the helloworld executable at the command line: ./helloworld how to call c functions from javascript say the c function is named doit and it would like at least two actual parameters when called (if the caller supplies fewer, the js engine should ensure that undefined is passed for the missing ones): #define doit_minargs 2 // [spidermonkey 24] use jsbool instead of bool. static bool doit(jscontext *cx, unsigned argc, jsval *vp) { js::callargs args = callargsfromvp(argc, vp); /* * look in argv for argc actual parameters, set *rval to return a * value to the caller. * * ex. add two argument...
64-bit Compatibility
ways that will work on both 32-bit and 64-bit jit backends. what widths are the random typedefs everywhere? the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: pointers uintptr_t, intptr_t, ptrdiff_t, (probably) size_t jsval jsuword, jsword length of a string, though the actual length cannot exceed 30 bits jsuintptr, jsintptr, jsptrdiff, jsuptrdiff, jssize, jsuword, jsword (let's not use these, kthx) the following types are 32-bit on 32-bit platforms. for all intents and purposes they are also 32-bit on 64-bit platforms: intn, uintn jsintn, jsuintn, jsbool general problems with pointers when performing bitwise operations on pointer values, make sure that both operands are 64-bit. the compiler can implicitly sign or zero extend op...
Functions
function may read the local variables and arguments of its immediate enclosing function from the stack, as if by magic. (jscontext::display caches the enclosing function's stack frame.) if that function is also algol-like, its child can read locals and variables from the next enclosing function, and so on. the compiler detects these cases and makes such functions null closures too. flat closures. suppose a function reads some variables from enclosing functions but is not algol-like. if the function does not assign to any closed-on vars/args, and it only reads closed-on local variables and arguments that never change value after the function is created, then the function can be implemented as a flat closure. when a flat closure is created, all the closed-on values are copied from the stack int...
Exact Stack Rooting
tedobject obj(cx, js_newobject(cx, clasp, nullptr(), nullptr()); common pitfalls the c++ type system allows us to eliminate the possibility of most common errors; however, there are still a few things that you can get wrong that the compiler cannot help you with. there is basically never a good reason to do any of these. if you think you do need to do one of these, ask on one of spidermonkey's support forums: maybe we've already solved your problem using a different mechanism. storing a js::rootedt on the heap. it would be very easy to violate the lifo constraint if you did this. use a different rooting mechanism if you store a gcpointer on the heap. there are moz_stack_class annotations that will cause a separate static analysis to fail if these are detected. storing a js::handlet on ...
Invariants
me slot being allocated to more than one property would be a problem for obvious reasons.) all jsshapes in dictionary-mode objects have the in_dictionary flag set. all jsshapes in property trees have it cleared. if an object is inextensible, its dslots will never again change. (we don't bother locking when accessing slots of a sealed object. the locking is going away regardless.) compartments suppose obj = js_getscopechain(cx) is not null. then cx->compartment == obj->compartment(). when a new object is created, it is automatically created in cx->compartment, but its parent and prototype are often determined by examining the scope chain. the object and its proto and parent must be in the same compartment. so it is utterly crucially important that this invariant always be true if objects ...
Property cache
property has a stub getter and has a slot (i.e. it is not jsprop_shared). the slot index is vword.toslot(). vword.isobject() the property has a stub getter and its value is vword.toobject(). this special kind of entry is used only for jof_call instructions and only when the result is a function. it helps the jit avoid extra loads and guards when calling methods. branded scopes exist to support this case. when a property cache entry of this type is created, the scope of the object that contains the property is branded. the "branded scope guarantee" documented above ensures that any changes to function-valued own properties of that object will bump its shape, conservatively invalidating all property cache entries of this type for that object (and jit code that might inline a call to ...
Introduction to the JavaScript shell
reflect.parse() see parser api. note: this function is intended only for use when testing the javascript engine. seal(object[, deep]) seals the specified object, or an object graph if deep is true. by sealing an object or object graph, you disable modification of those objects. sleep(dt) added in spidermonkey 1.8 only in js_threadsafe builds. sleep for dt seconds. fractions of a second are supported. returns true on success, false if the sleep was interrupted. stackquota([number]) get or set the script stack quota. throwerror() throws an error from the js_reporterror() function. note: this function is intended only for use when testing the javascript engine. trap([function, [pc,]] expression) sets a trap at the specific point in the javascript code. when the bytecode at the of...
JS::CloneFunctionObject
quires request. in a js_threadsafe build, the caller must be in a request on this jscontext. funobj js::handleobject the function to clone. scopechain js::autoobjectvector the new function's scope chain. description js::clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj. if scopechain is supplied, it uses scopechain as its enclosing scope. if scopechain is omitted, it creates a new function object in cx's global. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. the new object's prototype is function.prototype; js_newobject : choosing a default prototype explains exactly how this is computed. js::clonefu...
JS::PersistentRooted
e, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. these roots can be used in heap-allocated data structures, so they are not associated with any particular jscontext or stack. they are registered with the jsruntime itself, without locking, so they require a full jscontext to be initialized, not one of its more restricted superclasses. initialization may take place on construction, or in two phases if the no-argument constructor is called followed by init(). note that you must not use an persistentrooted in an object owned by a js object: whenever one object whose lifetime is decided by the gc refers to another such object, that edge must be traced only if the owning js object is traced. this applies not only to js ...
JSClass.call
the jsclass.call and jsclass.construct hooks are called when a custom object is used like a function. these hooks are of type jsnative. note that when a custom object is called, a this argument is calculated for it just as if it were a function. that is, the obj argument received by the jsnative is the this argument, not the custom object that was called! // suppose this object has jsclass.call and jsclass.construct hooks. var custom = new specialcustomobject(); custom(); // the jsclass.call hook receives the global object as the obj parameter. new custom(); // the jsclass.construct hook receives the global object as the obj parameter. var x = { specialmethod: custom }; x.specialmethod(); // the jsclass.call hook receives x as the obj parameter. new x.specialmethod()...
JSClass.flags
its value is the logical or of zero or more of the following constants: flag meaning jsclass_has_private this class uses private data. if this flag is set, each instance of the class has a field for private data. the field can be accessed using js_getprivate and js_setprivate. mxr id search for jsclass_has_private jsclass_private_is_nsisupports mozilla extension. the private field of each object of this class points to an xpcom object (see nsisupports). this is only meaningful if spidermonkey is built with xpconnect and the jsclass_has_private flag is also set. mxr id search for jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 objects are dom. mxr id s...
JSConvertOp
t parameter. on success, *vp receives the converted value. description jsconvertop callback specifies conversion behavior for objects having this class, implementing the ecmascript [[defaultvalue]] behavior for them. on success it must return a primitive value in *vp. implementations of this hook have historically been required to accept any type. however, the engine itself only requires support for jstype_string, jstype_number, and jstype_void, if js_convertvalue is not used. if you do not use the js_convertvalue method, you may omit support for other types. (support for the other types may eventually be removed.) the callback returns true to indicate success or false to indicate failure. jsclass hooks jsclass offers the following hook: the jsclass.convert callback implemen...
JSFUN_BOUND_METHOD
me browsers, its use is discouraged since it could be removed at any time. try to avoid using it. flag that indicates a function nominally associated with an object is bound, instead, to that object's parent. syntax jsfun_bound_method description this macro exists only for backward compatibility with existing applications. its use is deprecated. future versions of the javascript engine may not support or recognize this macro. jsfun_bound_method is a flag that indicates a method associated with an object is bound to the method's parent, the object on which the method is called. see also jsfun_global_parent bug 429507 ...
JSNative
*cx, unsigned argc, js::value *vp); name type description cx jscontext * the context in which the native function is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec). vp js::value * the arguments, the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below. description jsnative is the type of native implementations of javascr...
JSObjectOps.defaultValue
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the javascript engine calls the jsobjectops.defaultvalue and jsclass.convert callbacks to convert objects to primitive values. ...
JSObjectOps.defineProperty
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.defineproperty callback is called whenever an object property is defined. it implements js_defineproperty. ...
JSObjectOps.destroyObjectMap
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.destroyobjectmap callback is called to destroy a jsobjectmap when its reference count goes to zero. ...
JSObjectOps.dropProperty
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.dropproperty callback releases a jsproperty. ...
JSObjectOps.enumerate
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.enumerate callback implements iteration over object properties. the type of the callback is jsnewenumerateop. for native objects, the enumerate callback first checks the jsclass_new_enumerate flag of the object's class. if the flag is present, enumerate simply delegates the call to jsclass.enumerate. otherwise, it invokes the jsclass.enumerate hook as an old-style jsenumerateop to give the object an opportunity to define any remaining lazy properties. ...
JSObjectOps.getAttributes
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.getattributes and setattributes callbacks are called to access the attributes of a property. ...
JSObjectOps.getProperty
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. jsobjectops.getproperty, setproperty, and deleteproperty are high-level callbacks that implement object property accesses. ...
JSObjectOps.lookupProperty
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. ...
JSObjectOps.newObjectMap
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.newobjectmap callback is called whenever a new object is created. ...
JSObjectOps.setProto
details of the api may change from one release to the next. this documentation should be considered spidermonkey internals documentation, not api documentation. see bug 408416 for details. the jsobjectops.setproto and setparent callbacks implement the js_setprototype and js_setparent functions. ...
JSVAL_LOCK
to lock a value, use local roots with js_addroot. ...
JSVAL_UNLOCK
to unlock a value, use local roots with js_removeroot. ...
JS_AliasElement
jsint alias number to assign to the element. description js_aliaselement assigns an alternate index number for an element or numeric property associated with a native object. obj is the object to which the element belongs. name is the element's current index in the object, and alias is the alternate index to assign to the element. this feature is deprecated, meaning that it is currently supported only for backward compatibility with existing applications. future versions of the engine may no longer support this function. an alias does not replace an element's current index number; it supplements it, providing a second way to reference the element. if the alias is successfully created and associated with the property, js_aliaselement returns js_true. adding an alias element does not ...
JS_AliasProperty
har * alias name to assign to the property. description js_aliasproperty assigns an alternate name for a property associated with a native object. obj is the object to which the property belongs. name is the property's current name in the object, and alias is the alternate name to assign to the property. notes this feature has been removed. an alias does not replace a property's name; it supplements it, providing a second way to reference a property. if the alias is successfully created and associated with the property, js_aliasproperty returns js_true. creating an alias does not change the length of the property array. if the property name you specify does not exist, js_aliasproperty reports an error, and returns js_false. if the property is currently out of scope, already exists, o...
JS_BufferIsCompilableUnit
est on this jscontext. obj js::handleobject the global object, or null. utf8 const char * string containing the script to compile. length size_t the length of utf8 in characters. description given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until js_bufferiscompilableunit is true, then pass it to the compiler. see also mxr id search for js_bufferiscompilableunit js::evaluate js::compile js::compileoffthread js::compilefunction js_decompilescript ...
JS_DefineOwnProperty
descriptor js::handlevalue this should be an jsval consisting of an object interpretable as property descriptor. bp bool * true if successful. description js_defineownproperty implements the ecmascript defined function object.defineproperty. so the same restrictions apply as for that function (e.g. it is not possible to change a non-configurable property). descriptor is supposed to be a property descriptor, this means you need to create an object with properties such as value, writable, get or set. see object.defineproperty for a list of possible fields. a getter or setter defined with this functions will be observable from js code. see also js_setproperty js_getpropertydescriptorbyid object.defineproperty bug 1017323 ...
JS_GetGlobalObject
hich to retrieve the global object. description this function is obsolete: use js_getglobalforobject or js_getglobalforscopechain instead. the concept of a global object belonging to a context will likely be phased out in future versions of spidermonkey. js_getglobalobject retrieves the global object for a specified jscontext *, cx. this returns null if cx has no global object. spidermonkey supports applications that have multiple global objects, such as the various window objects in a web browser. the object returned by js_getglobalobject is not necessarily the same thing as the global object seen by any javascript code that runs in cx! if a function is executing, the global object used by that function is determined when the function is created. furthermore, some jsapi functions, such...
JS_InitClass
hese functions, if any, are added to the new class's constructor. (this is the javascript equivalent of public static methods in c++ or java.) description js_initclass initializes a jsclass and (optionally) makes it visible to javascript code. this is one way to create jsobjects whose properties and methods are implemented in native c/c++. if you need a native function but you don't need to support instances or inheritance, js_initclass might be overkill. js_definefunction is simpler. a jsapi class consists of a jsclass structure, a constructor, a prototype object, and properties and functions. the jsclass is an internal data structure that is not exposed outside the javascript engine. it specifies the name of the class, its flags, and its property access functions. these include native...
JS_MapGCRoots
ping entries */ #define js_map_gcroot_stop 1 /* stop mapping entries */ #define js_map_gcroot_remove 2 /* remove and free the current entry */ typedef int (*jsgcrootmapfun)(void *rp, const char *name, void *data); description call js_mapgcroots to map the gc's roots table using map(rp, name, data). the root is pointed at by rp; if the root is unnamed, name is null; data is supplied from the third parameter to js_mapgcroots. the map function should return js_map_gcroot_remove to cause the currently enumerated root to be removed. to stop enumeration, return js_map_gcroot_stop. to continue mapping, return js_map_gcroot_next. these constants are flags; you can or them together. this function acquires and releases rt's gc lock around the mapping of the roots table, so the...
JS_NewObject
function that combines js_newobject and js_defineproperty. obsolete ? starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can create a new object in a specific compartment using the components.utils.createobjectin() method. choosing a default prototype like many jsapi functions, js_newobject selects an appropriate prototype for the newly created object if you don't supply one yourself. if the new object's class (here, clasp) is a built-in class, then its associated prototype is used as the new object's prototype. otherwise, object.prototype is used as the new object's prototype. previous behaviour obsolete since jsapi 45 here's how the process works in detail: first, we must identify a global object. if the parent is non-null, we assume it is part of a sco...
JS_ParseJSON
ter parsing (and optionally, processing by the reviver). if an error occurs, the value left in *vp is undefined. description use these functions to parse a sequence of characters as json. the parsing rules applied by these methods are exactly those specified by ecmascript 5. various json extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported. mxr id search for js_parsejson mxr id search for js_parsejsonwithreviver ...
JS_PopArguments
y js_pusharguments. syntax void js_poparguments(jscontext *cx, void *mark); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. mark void * pointer to a void * which holds the stack frame pointer previously supplied by js_pusharguments. description js_poparguments frees the stack frame pointer previously allocated by js_pusharguments and unroots the jsvals which have been associated with it (those returned by js_pusharguments as well). see also js_pusharguments js_convertvalue js_addargumentformatter js_convertarguments bug 542091 ...
JS_PushArguments
m types defined in cx using js_addargumentformatter. for example, if format is "biob", then there must be four arguments after format. their types must be jsbool, jsdouble, jsobject *, and jsbool. if successful, js_pusharguments would return a pointer to the first element of an array of four jsvals: a boolean, a number, an object (or null), and a boolean. on success, js_pusharguments fills in the supplied markp pointer and returns a pointer to the first element of an array of jsval which are automatically rooted as necessary (protected from the gc temporarily). the application must call js_poparguments using the supplied markp stack pointer when done with this stack frame, to free the memory and unroot the jsvals. on error or exception, js_pusharguments returns null. to perform the opposite c...
JS_SaveExceptionState
object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. the jsexceptionstate created by this function automatically roots any pending exception object which needs to be protected from the gc. this function returns null if the engine was not built with support for exceptions. see also mxr id search for js_saveexceptionstate jsexceptionstate js_restoreexceptionstate js_dropexceptionstate ...
JS_THREADSAFE
we have recently made major changes to this feature. until recently, sharing objects among threads would mostly work, although scripts could easily make it crash. we have now completely removed that feature. each thread that uses the javascript engine must essentially operate in a totally separate region of memory. ...
JS_ValueToId
ger index of array to convert. chars js::twobytechars the string to convert. key jsprotokey the prototype key to convert. idp js::mutablehandleid out parameter. on success, *idp receives the converted jsid. description js_valuetoid converts a specified js::value, v, to a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a specified string to a jsid. js_indextoid converts a specified integer index to an integer jsid. js::protokeytoid converts a specifi...
Profiling SpiderMonkey
ests to work from: media:profiling-ammo.zip 3.) once you have some changes you'd like to try, you can just rebuild the js/src directory, since it produces its own shared library, even in libxul and static builds. make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available. see the documentation on the --enable-jprof mozconfig option. we're working to add support for other profilers, such as oprofile, intel vtune, and callgrind. when we have js scriptable profiling options available for all tier 1 platforms, we'll look at adding global start/stop profiling functions. if you'd like to profile something at a higher level of detail than the js shark functions allow, there are corresponding c functions available at the bottom of jsdbgapi.h. costs of threa...
SpiderMonkey 1.8
not safe to be shared among threads. this includes iterators and generators (bug 349263) and arrays (bug 417501). in short, applications that share objects among threads in such a way that two threads could access an array, iterator, or generator object at the same time should not use spidermonkey 1.8. there is a minor known bug in the new javascript 1.8 functionality. when javascript 1.8 support is enabled, the parser accepts some incorrect programs by inserting a semicolon where it should instead throw a syntaxerror (bug 384758). this bug will be fixed in 1.8.1. migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with previous releases. it is source-compatible with spidermonkey 1.7 though, which means you can probably just recompile and relink your application...
SpiderMonkey 52
previous spidermonkey releases. it also contains new language and api features described in detail below. ...
SpiderMonkey releases
rball that is built into a binary that runs our smoke tests, but we do not maintain it nor actively test its suitability for general embedding. we have periodically created "releases", but they are best-effort and incomplete. we do happily accept patches, and make some effort to keep the tip of the gecko tree minimally working as an embeddable source package. we are very limited in our ability to support older versions, including those labeled as "releases" on this page. the easiest way to fetch the version corresponding to the current firefox release is to visit the treeherder page for the release repository and click on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded: mozjs-57.0.1.tar.bz2". past releases spidermonkey...
TPS Bookmark Lists
k paths must begin with one of the following: "menu": the normal bookmarks menu "toolbar": the bookmarks toolbar "tags": the tags folder "unfiled": the unfiled bookmarks folder "places": the places root folder ("menu", "toolbar", and "unfiled" are all children of this) sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". tps does not support forward slashes as part of a folder name. folder contents the contents for a folder are given as an array of objects, representing various bookmark types, described below. bookmark objects valid properties are: uri: the bookmark uri. required. title: the bookmark title. optional. defaults to the bookmark uri. loadinsidebar: true or false. optional. toggles the "load in sidebar" property. des...
TPS Formdata Lists
note 2, sync currently does not sync formdata dates, so the date field is ignored when performing verify and verify-not actions. see bug 552531. ...
TPS Pref Lists
a prefs asset list is an array of objects with name and value keys, representing browser preferences. for example: var prefs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref lists and phase actions the only actions supported for preference asset lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences. to find the list of valid preferences, go to about:config on a browser that has weave installed, and search for services.sync.prefs.sync. for a more detailed test example, see the tps prefs unit test. ...
Zest tools
it is being developed alongside zest and can be expected to showcase the latest zest features. ...
Zest
onward development of zest, and teams or individuals who develop security tools are especially welcome to join and help shape zest's future. zest topics usecases reporting security vulnerabilities to developers reporting security vulnerabilities to companies defining active and passive scanner rules deep integration with security tools runtimes the runtime environments that support zest tools the tools that include support zest implementation the state of zest development videos simon demoed zest at appsec usa in november 2013, and the full video of my talk is available on youtube. the zest part of the talk starts at 23:47. more details https://github.com/mozilla/zest - the code on github http://groups.google.com/group/mozilla-zest - th...
Secure Development Guidelines
bbv: stack overflow example: void foo(char *bar) { char c[12]; strcpy(c, bar); } int main(int argc, char **argv) { foo(argv[1]); } bbv: stack overflow before the stack overflow bbv: stack overflow after the stack overflow bbv: heap overflow dynamic memory malloc() calloc() heapalloc() mmap() not on the sta...
Security and the jar protocol
inotes has since been updated so that it no longer needs remote jars, so they have been disabled again in firefox 55. you may re-enable the feature if necessary by setting the network.jar.block-remote-files preference to false. java archive (jar) files are simply zip compressed bundles of files. ...
Handling Mozilla Security Bugs
urity developers (i.e., those whose bugs are often singled out as security-relevant or who have security-relevant bugs assigned to them), and security qa people who are the qa contacts for those bugs. exploit hunters with a good track record of finding significant mozilla security vulnerabilities. representatives of the various companies and groups actively distributing mozilla-based products. super-reviewers and drivers. the bugzilla administrators will technically be in the mozilla security bug group as well, mainly because they already have visibility into all bugzilla data hosted through mozilla.org. the mozilla security bug group will have a private mailing list, security-group@mozilla.org, to which everyone in the security bug group will be subscribed. this list will act as a foru...
ROLE_CELL
« gecko roles page represents a cell within a table. also, see role_table. ...
ROLE_ROW
« gecko roles page represents a row of cells within a table. also, see role_table. ...
AT Development
introduction software accessibility: where are we today? the accessibility of computer software has seen drastic improvements over the past two decades. this article (from 2007) reviews the progress and technology as it has developed. guidelines at apis implementation by gecko at vendors guide to support gecko-based applications like firefox, thunderbird and so on. accessibility architecture how the accessibility hierarchy is implemented in mozilla (some issues aren't addressed by previous guide). building xulrunner with python how to build xulrunner with python on windows. then comtypes gives access to msaa and iaccessible2. references at apis implementation references shows how gecko handles atk, iaccessible2, msaa and universal access api accessible w...
Mork
Mozilla › Tech › Mork
mork is a database file format invented by david mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source. starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format. the information on this page was constructed by reading the source code of the mork database in mozilla and attempting to codify what it parses as faithfully as possible. in a few cases, constructs that the parser supported but were never used in mozilla's code are left unspecified. mork structure mork is a schema-less database format. at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables. rows need not be in a table, nor need they be i...
Manipulating bookmarks using Places
var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. // an nsinavbookmarkobserver var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onite...
Querying Places
see displaying places information using views for more information and examples. containers containers hold lists of other containers and result nodes. each result has a container representing the root of the query. it can be retrieved using the root attribute of the result. for general queries, this root container is a nsinavhistoryqueryresultnode with the query parameters and options that you supplied in the original query. for queries mapping to one bookmark folder, this will be a nsinavhistorycontainerresultnode. containers can be open or closed. this corresponds to the open and closed state in a tree view, and can also be mapped to showing and hiding menus. to get at a container's contents, you must first open the container. most container types populate themselves lazily, so opening ...
Using the Places history service
will infer this information for you. modifying pages in history nsiglobalhistory2.setpagetitle: called by gecko when the <title> element is encountered. nsiglobalhistory3.setgeckoflags: called by gecko to store rendering information about a page. currently, this is used to store whether there was a scrollbar, which allows more efficient layout if the page is revisited. however, this is not yet supported by the navhistory implementation. nsibrowserhistory.removepage: removes a given uri and all of its visits from the history database. this is called by the ui when the user deletes a history entry. nsibrowserhistory.removepagesfromhost: called from the ui when the user deletes a group associated with a host or domain. this function allows you to delete pages from a specific host, or pages ...
Preferences API
you can also create a xul-based options window easily to allow user modify some preferences. many applications including firefox and thunderbird have an additional tool for power users, about:config, which can be used to tweak the preferences without ui. ...
extIApplication
(see [1]), use getextensions() instead obsolete since gecko 2.0 prefs readonly attribute extipreferencebranch the preferences object for the application. defaults to an empty root branch. storage readonly attribute extisessionstorage the storage object for the application. events readonly attribute extievents the events object for the application. supports: "load", "ready", "quit", "unload" the following interfaces are only available to firefox: attribute type description bookmarks readonly attribute fuelibookmarkroots the root bookmarks object for the application. windows readonly attribute nsivariant an array of browser windows within the application. activewindow readonly ...
extIExtension
run after install prefs readonly attribute extipreferencebranch the preferences object for the extension. defaults to the "extensions.<extensionid>." branch. storage readonly attribute extisessionstorage the storage object for the extension. events readonly attribute extievents the events object for the extension. supports: "uninstall" methods fixme: see also see extapplication.js line:395 for the implementation of firstrun. a preference "install-event-fired" under your extensions preferences branch (e.g. extensions.your_extension_id.install-event-fired) will be set to false after your extension has been installed. you may need to reset this preference in about:config during testing. also, see the ...
extISessionStorage
e usually accessed via application.storage. return type method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage item exists with the given name. boolean has(in astring aname) parameters aname the name of an item return value true if an item exists with the given name, false otherwise. set() sets the value of a storage item with the given name. void set(in astring aname, in nsivariant avalue) parameters aname the name of an ite...
Creating a Python XPCOM component
. this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application. this is not necessary when your components are loaded by mozilla as the python loader modifies sys.path. then you can import xpcom in any python module (mostly, in your component). defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsisupports.idl" [scriptable, uuid(2b324e9d-a322-44a7-bd6e-0d8c83d94883)] interface nsipysimple : nsisupports { attribute string yourname; void write( ); void change(in string avalue); }; this is the same as the nsisimple interface used here. theoretically, because several components can share an interface, the same file could be used. pay special attention to types here - python and javasc...
Fun With XBL and XPConnect
); ]]> </property> so we've defined a property on the widget called autocompletesession. the initial value of this property evaluates to an xp-connect object. now accesses to autocompletesession will return the xp-connect object. exposing the xpcom interfaces one somewhat nasty trick you need to do is to manually expose the interfaces of the xpcom object that you want your widget to support. all you have to do is specifically defining a method on the xbl widget which forwards the method call to the xpcom object. <method name="autocomplete"> <argument name="asearchstring"/> <argument name="resultlistener"/> <body> <![cdata[ return this.autocompletesession.autocomplete(null, anonymouscontent[0], asearchstring, this.autocompletel...
How to build an XPCOM component in JavaScript
from mozdev mirrors. if an interface exists that meets your needs, then you do not need to write an idl, or compile a typelib, and may skip to the next section. if you don't find a suitable pre-existing interface, then you must define your own. xpcom uses a dialect of idl to define interfaces, called xpidl. here's the xpidl definition for our helloworld component: helloworld.idl #include "nsisupports.idl" [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsihelloworld : nsisupports { string hello(); }; note that you must generate a new uuid for each xpcom component that you create. see generating guids for more information. compiling the typelib your interface definition must be compiled into a binary format (xpt) in order to be registered and used within mozilla ...
Preface
ble web browser, where it's easiest and most practical to illustrate xpcom's functionality. a full description of the component in this tutorial can be found in the what we'll be working on section of the tutorial. despite what old documentation says, xpcom should not be used to make npapi plugins scriptable. starting with gecko 1.7.5 (firefox 1.0) a special npapi extension for scriptability is supported, see scripting plugins. organization of the tutorial the following list provides an overview of the steps that we will take to build an xpcom component called weblock, which provides site blocking functionality to gecko-based browsers. each one of these steps has its own chapter, in which a number of topics associated with the step are discussed. create the generic module code for the...
Making cross-thread calls using runnables
lt. #include "nsthreadutils.h" class piresulttask : public nsrunnable { public: piresulttask(picallback callback, const nsacstring& result) : mcallback(callback) , mresult(result) , mworkerthread(do_getcurrentthread()) { moz_assert(!ns_ismainthread()); // this should be running on the worker thread } ns_imethod run() { moz_assert(ns_ismainthread()); // this method is supposed to run on the main thread! mcallback(mresult); // if we don't destroy the thread when we're done with it, it will hang around forever... bad! // but thread->shutdown must be called from the main thread, not from the thread itself. mworkerthread->shutdown(); } private: picallback mcallback; nscstring mresult; nscomptr<nsithread> mworkerthread; }; class picalculateta...
Components.isSuccessCode
ntext) { copyinprogress = true; }, onstoprequest: function(request, context, statuscode) { copyinprogress = false; // did the copy fail? ...
Components.results
result codes, with each value being that of the corresponding result code. elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... if(something_unexpected_happened) throw components.results.ns_error_unexpected; the elements of the components.results object can be enumerated using a for-in loop. usage implementing nsisupports the standard nsisupports is usually implemented in javascript by using components.results to get a failure return value if does not implement the given interface. note the common use of an abbreviation for components.results, cr: const ci = components.interfaces, cr = components.results; function class() { /* ... */ } class.prototype = { /* ... */ queryinterface: function(id) { ...
Components.utils.Sandbox
. default: false. wantglobalproperties an array of strings. each string is the name of an object that you want to make available as a global to code running in the sandbox. the exception is "-promise": the promise constructor is available by default for sandboxes, and you use this option to remove it from the sandbox. note that "-promise" is removed in firefox 37. ...
Components.utils.cloneInto
eventlistener("click", function() { console.log(window.addonscriptobject.greeting); // "hello from add-on" }, false); of course, you don't have to assign the clone to the window itself: you can assign it to some other object in the target scope: contentwindow.foo.addonscriptobject = cloneinto(addonscriptobject, contentwindow); you can also pass it into a function defined in the page script. ...
Components.utils.evalInWindow
returns the result of evaluating the script. if this is just native (for example, a dom node), then the function relies on xraywrappers to wrap the returned content, otherwise the result is structured-cloned. this does impose some restrictions on the sorts of things that can be returned: in particular, the result can't contain any functions, because functions can't be structured-cloned. ...
Components.utils.import
t was introduced in firefox 3 and is used for sharing code between different scopes easily. for example, you can import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files. see using javascript code modules for more details. note: prior to gecko 2.0, javascript code modules could only be loaded using file: or resource: urls. gecko 2.0 adds support for loading modules from chrome: urls, even those inside jar archives. syntax components.utils.import(url [, scope]); // or, if you use a tool such as jslint which reports compiler errors for the above, components.utils["import"](url [, scope]); parameters url a string of the url of the script to be loaded. the url must point to a file on the disk, possibly in a jar. scope an opti...
Components.utils.unwaiveXrays
ransitive: it waives xrays not just for the given object, but for all properties of the object (and their properties, and so on). the unwaivexrays operation undoes the operation, so xray vision is restored transitively as well. syntax xray = components.utils.unwaivexrays(obj); parameters obj the object for which we wish to restore xrays. returns the object with xrays restored. example suppose a page script adds an expando to its global window: // page script foo = "i'm an expando"; by default, chrome code won't see foo, because it sees the content window with xray vision, but the chrome code can waive xray protection. the chrome code can then use unwaivexrays to restore xray protection: // chrome code // contentwindow is an xray var isxray = components.utils.isxraywrapper(gbrow...
Components.utils.waiveXrays
r the initial object is an xray or not. syntax waived = components.utils.waivexrays(obj); parameters obj the object for which we wish to waive xrays. returns if the argument obj is an xray, this function returns a wrapper that transitively waives xray behavior on the underlying object and anything that comes off the object. if obj is not an xray, this function just returns obj. ...
Other Resources
other resources embedding mozilla xpconnect - javascript-xpcom bridge blackconnect - java-xpcom bridge (no longer supported) xpidl to java types - from blackconnect ...
XPConnect wrappers
n order to preserve api compatibility, an xpcwrappednative is created around the xpcwrappedjs. security wrappers exposed to chrome to learn about security wrappers, see the article on script security in gecko. note that a previous version of the current page recommended using __exposedprops__ to expose objects from chrome to content. this is now deprecated and we are in the process of removing support for it. if you need to make objects or functions defined in chrome code accessible to content, use components.utils.cloneinto or components.utils.exportfunction. ...
XPCshell Test Manifest Expressions
run by specifying them in a manifest file. you can add conditions to tests in order to control when tests get run. the conditions accept a simple boolean expression syntax, described here. operators in order of decreasing precedence: () == != && || literal values booleans: the literal strings true and false. integers: a series of contiguous digits. only decimal integers are supported. strings: any series of characters enclosed in double quotes " or single quotes '. no escape sequences are supported. variables variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by write...
nsCategoryManager
« xpcom api reference summary the xpcom category manager. class id 16d222a6-1dd2-11b2-b693-f38b02c021b2 contractid @mozilla.org/categorymanager;1 supported interfaces nsicategorymanager remarks this component is a singleton and should therefore be accessed via the xpcom service manager. ...
nsDirectoryService
« xpcom api reference summary the xpcom directory service. this service returns the locations of "well known" directories in an os-independent manner. for instance, it can give you the path of the system's temporary directory, desktop directory, current working directory, and so on. class id f00152d0-b40b-11d3-8c9c-000064657374 contractid @mozilla.org/file/directory_service;1 supported interfaces nsiproperties nsidirectoryservice remarks this component is a singleton and should therefore be accessed via the xpcom service manager. example code #include "nsxpcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory. */ nsresult gettempdi...
nsLocalFile
example code function getfilesize(path) { var file = components.classes["@mozilla.org/file/local;1"]. ...
nsObserverService
« xpcom api reference the xpcom observer service. class id d07f5195-e3d1-11d2-8acd-00105a1b8860 contractid @mozilla.org/observer-service;1 supported interfaces nsiobserverservice remarks this component is a singleton and should therefore be accessed via the xpcom service manager. it should be used from the main thread only. ...
nsScriptableInputStream
« xpcom api reference summary a component implementing nsiscriptableinputstream. class id 7225c040-a9bf-11d3-a197-0050041caf44 contractid @mozilla.org/scriptableinputstream;1 supported interfaces nsiscriptableinputstream, nsiinputstream remarks this component should be accessed via the xpcom component manager. example code const nsiscriptableinputstream = components.interfaces.nsiscriptableinputstream; function consumestream(inputstream) { var factory = components.classes["@mozilla.org/scriptableinputstream;1"]; var sis = factory.createinstance(nsiscriptableinputstream); sis.init(inputstream); try { while (true) { var chunk = sis.read(512); if (chunk.length == 0) break; // ok, chunk now contains a portion of the stream's ...
NS_InitXPCOM3
#include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting xpcom service manager. you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. ...
NS_NewLocalFile
resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newlocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (ns_failed(rv)) return rv; note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned s...
NS_NewNativeLocalFile
aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os has no problem dealing with them. do not use this function (on windows) unless it is guaranteed that the full path involved is always ascii. example code // create a local file th...
nsresult
« xpcom api reference the nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes. for a list of defined result values, see error codes returned by mozilla apis. note: on compilers that do not support strongly-typed enums (that is, compilers that don't support this feature of c++11), it falls back to being an unsigned 32-bit integer, as in past versions of gecko. note: prior to gecko 19.0, nsresult was not strongly typed. as a result, it was possible for code to misuse it, such as returning an nsresult value from a function whose signature indicates it returns a boolean. because nsresult is strongly typed, code like the following will result in an error at compile time: bool foo() { ... ...
Core XPCOM functions
ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_reallocreallocates a block of memory using t...
nsACString_internal
r= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members. methods constructors void nsacstring_internal(const nscsubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring. parameters nscsubstringtuple& tuple void nsacstring_internal(char*, pruint32, pruint32) - source parameters char* data pruint32 length pruint32 flags beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) c...
nsAString_internal
tor= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members. methods constructors void nsastring_internal(const nssubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring. parameters nssubstringtuple& tuple void nsastring_internal(prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 length pruint32 flags beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(...
nsAutoString
it is normally not a good idea to use this class on the heap, because it will allocate space which may be wasted if the string it contains is significantly smaller or any larger than 64 characters. ...
nsCAutoString
it is normally not a good idea to use this class on the heap, because it will allocate space which may be wasted if the string it contains is significantly smaller or any larger than 64 characters. ...
nsCOMPtr
« xpcom api reference summary this utility class simplifies managing xpcom interface references from c++ code. #include "nscomptr.h" remarks consult using nscomptr for more info. to use this class, you must link your component or application against the xpcom glue library. the class itself and the supporting functions that are used with it are not frozen, but they are available as part of the xpcom glue library for easy reuse. ...
nsXPIDLCString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl. names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const char* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appe...
nsXPIDLString
class declaration nstxpidlstring extends nststring such that: (1) mdata can be null (2) objects of this type can be automatically cast to |const chart*| (3) getter_copies method is supported to adopt data allocated with ns_alloc, such as "out string" parameters in xpidl. names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const prunichar* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat...
IAccessible2
iaccessible2 use queryservice as follows: // pacc is a reference to the accessible object's iaccessible interface. iserviceprovider *pservice = null; hr = pacc->queryinterface(iid_iserviceprovider, (void **)&pservice); if(succeeded(hr)) { iaccessible2 *pia2 = null; hr = pservice->queryservice(iid_iaccessible, iid_iaccessible2, (void**)&pia2); if (succeeded(hr) && pia2) { // the control supports iaccessible2. // pia2 is the reference to the accessible object's iaccessible2 interface. } } see also iaccessible ...
IAccessibleAction
to actions that can be executed for accessible objects. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object. each action can be performed or queried for a name, description or associated key bindings. actions are needed more for ats that assist the mobility impaired, such as on-screen keyboards and voice command software. by providing actions directly, the at can pr...
IAccessibleComponent
t background([out] ia2color background ); [propget] hresult foreground([out] ia2color foreground ); [propget] hresult locationinparent([out] long x, [out] long y ); methods background() returns the background color of this object. [propget] hresult background( [out] ia2color background ); parameters background the returned color is the background color of this object or, if that is not supported, the default background color. return value s_ok. foreground() returns the foreground color of this object. [propget] hresult foreground( [out] ia2color foreground ); parameters foreground the returned color is the foreground color of this object or, if that is not supported, the default foreground color. return value s_ok. locationinparent() returns the location of the upper left cor...
IAccessibleEditableText
criptable this interface provides clipboard capability to text objects. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface is typically used in conjunction with the iaccessibletext interface and complements that interface with the additional capability of clipboard operations. note that even a read only text object can support the copy capability so this interface is not limited to editable objects. the substrings used with this interface are specified as follows: if startoffset is less than endoffset, the substring starts with the character at startoffset and ends with the character just before endoffset. if endoffset is lower than startoffset, the result is the same as a call with the two arguments exchanged. the...
IAccessibleTable
d. return value e_invalidarg if bad [in] passed. s_ok. summary() returns the summary description of the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult summary( [out] iunknown accessible ); parameters accessible returns a reference to an implementation dependent accessible object representing the table's summary or a null pointer if the table does not support a summary. return value s_false if there is nothing to return, [out] value is null. s_ok. unselectcolumn() unselects one column, leaving other selected columns selected (if any). hresult unselectcolumn( [in] long column ); parameters column 0 based index of the column to be unselected. return value e_invalidarg if bad [in] passed. s_ok. unselectrow() unselects one row, leaving other sel...
IAccessibleText
is method it must return s_false. typically this feature would not be implemented by an application. however, if the application developer was not satisfied with how screen readers have handled the reading of sentences this boundary type could be implemented and screen readers could use the application's version of a sentence rather than the screen reader's. the rest of the boundary types must be supported. this enum is used in textbeforeoffset(), textatoffset(), and textafteroffset(). method overview hresult addselection([in] long startoffset, [in] long endoffset ); [propget] hresult attributes([in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); [propget] hresult caretoffset([out] long offset ); [propget] hresult characterextents([in] long of...
IAccessibleValue
other-licenses/ia2/accessiblevalue.idlnot scriptable this interface gives access to a single numerical value. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) the iaccessiblevalue interface represents a single numerical value and should be implemented by any class that supports numerical value like progress bars and spin boxes. this interface lets you access the value and its upper and lower bounds. method overview [propget] hresult currentvalue([out] variant currentvalue ); [propget] hresult maximumvalue([out] variant maximumvalue ); [propget] hresult minimumvalue([out] variant minimumvalue ); hresult setcurrentvalue([in] variant value ); methods currentvalue() returns the value of this object as a number.
IDispatch
js/src/xpconnect/idl/xpcidispatch.idlscriptable this interface is not to be used directly, it is to be used internally for xpconnect's idispatch support. inherits from: nsisupports last changed in gecko 1.7 ...
IJSDebugger
js/ductwork/debugger/ijsdebugger.idlscriptable provides the javascript debugger service. you should usually interface with this using the javascript code module instead of directly. see the javascript debugger api guide for details. 1.0 66 introduced gecko 9.0 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/jsdebugger;1 as a service: var jsdebugger = components.classes["@mozilla.org/jsdebugger;1"] .createinstance(components.interfaces.ijsdebugger); note: you should almost never directly use this service; instead, you should use the javascript code module that does this for you. the only time you should directly use this interface to create the debugger objec...
amIInstallCallback
toolkit/mozapps/extensions/amiinstalltrigger.idlscriptable a callback function that web pages can implement to be notified when triggered installs complete. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void oninstallended(in astring aurl, in print32 astatus); methods oninstallended() called when an install completes or fails. void oninstallended( in astring aurl, in print32 astatus ); parameters aurl the url of the add-on being installed. astatus 0 if the install was successful or negative if not. ...
amIInstallTrigger
toolkit/mozapps/extensions/amiinstalltrigger.idlscriptable 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, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility. constant value description skin 1...
amIWebInstallInfo
toolkit/mozapps/extensions/amiwebinstalllistener.idlscriptable this interface is used by the default implementation of amiwebinstalllistener to communicate with the running application and allow it to warn the user about blocked installs and start the installs running. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void install(); attributes attribute type description installs nsivariant an array of addoninstall objects. read only. originatinguri nsiuri the uri that started the installs. for example, the referring page for a link to an xpi download. read only. originatingwindow nsidomwindow ...
amIWebInstallListener
sions/amiwebinstalllistener.idlscriptable starts all installs. the registered amiwebinstalllistener is used to notify about new installs triggered by websites. the default implementation displays a confirmation dialog when add-ons are ready to install and uses the observer service to notify when installations are blocked. ...
amIWebInstallPrompt
toolkit/mozapps/extensions/amiwebinstalllistener.idlscriptable called when installation by websites is currently disabled. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void confirm(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow. methods confirm() gets a confirmation that the user wants to start the installs. void confirm( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindo...
amIWebInstaller
toolkit/mozapps/extensions/amiwebinstaller.idlscriptable this interface is used to allow web pages to start installing add-ons. ...
imgIContainer
image/public/imgicontainer.idlscriptable represents an image in the gecko rendering engine. it provides access to frames as thebes surfaces and lets users extract subregions as other imgicontainer objects. it also provides methods for drawing images onto thebes contexts. internally, this interface also manages animation of images. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var imgicontainer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); metho...
imgIContainerObserver
image/public/imgicontainerobserver.idlscriptable an interface to implement to listen to activities on an imgicontainer object. 1.0 66 introduced gecko 1.7 inherits from: nsisupports last changed in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9) if you wish to listen for activities on an imgicontainer, you should implement the framechanged() method. method overview void framechanged(in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only! methods native code only!framechanged called when the frame for an image container has changed. void framechanged( in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect ); parameters arequest th...
imgIDecoder
method overview void close(); void flush(); void init(in imgiload aload); unsigned long writefrom(in nsiinputstream instr, in unsigned long count); methods close() closes the stream. void close(); parameters none. flush() flushes the stream. void flush(); parameters none. ...
imgIEncoder
post-multiplied alpha us used (for example 50% transparent red is 0x...
jsdIStackFrame
js/jsd/idl/jsdidebuggerservice.idlscriptable please add a summary to this article. inherits from: jsdiephemeral last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) strict mode is on. warnings reported as errors. makes eval() use the last object on its 'obj' param's scope chain as the ecma 'variables object'. private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. opt_* values above, or'd together. last version set on this context. scripts typically select this with the "language" attribute. see the version_* consts on jsdidebuggerservice. unique tag among all valid jsdicontext objects, useful as a hash key. private data for this context, if it is an nsisupports, |null| otherwise. retrieve ...
mozIAsyncFavicons
simply queryinterface() the nsifaviconservice to this interface. as an alternative, you can just use placesutils.favicons from javascript. ...
mozIAsyncHistory
toolkit/components/places/moziasynchistory.idlscriptable this interface allows you to add multiple visits to a single url in a batch. ...
mozIColorAnalyzer
preference is given to colors that are more interesting. ...
mozIJSSubScriptLoader
js/xpconnect/idl/mozijssubscriptloader.idlscriptable this interface can be used from privileged javascript to load and run javascript code from the given url at runtime. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3) implemented by: @mozilla.org/moz/jssubscript-loader;1. to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. method overview jsval loadsubscript(in string url, in object targetobj optional, in string charset optional); ...
mozIPersonalDictionary
extensions/spellcheck/idl/mozipersonaldictionary.idlscriptable this interface represents a personal dictionary. 1.0 66 introduced gecko 1.4.1 inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/spellchecker/personaldictionary;1. to access this service, use var personaldictionary = components.classes["@mozilla.org/spellchecker/personaldictionary;1"] .getservice(components.interfaces.mozipersonaldictionary); method overview void addcorrection(in wstring word,in wstring correction, in wstring lang); void addword(in wstring word, in wstring lang); boolean check(in wstring word, in wstring lang); void endsession(); void getcorrection(in wstring word, [array, size_is(count)] out ws...
mozIPlaceInfo
guid string read only: the globally unique id of the place. ...
mozIPlacesAutoComplete
toolkit/components/places/public/moziplacesautocomplete.idlscriptable this interface provides some constants used by the places autocomplete search provider as well as methods to track opened pages for autocomplete purposes. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term. match_boundary_anywhere 1 match first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term. match_boundary 2 match on word boundaries in each searchable...
mozIRepresentativeColorCallback
void oncomplete( in boolean success, [optional] in unsigned long color ); parameters success true if analysis was successful, false otherwise. ...
mozIStorageAggregateFunction
that returns one value from a series of values. there are a number of already defined aggregate functions provided by sqlite. objects implementing this interface can be registered with mozistorageconnection.createaggregatefunction(). storage/public/mozistorageaggregatefunction.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onstep(in mozistoragevaluearray afunctionarguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the query. the implementation should store or perform some work to prepare to return a value. note this callback is executed on the thread that the statement or trigger is executing on. if you use m...
mozIStorageBindingParams
the mozistoragebindingparams interface is used to bind values to parameters prior to calling mozistoragestatement.executeasync(). storage/public/mozistoragebindingparams.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create mozistoragebindingparams objects by calling the mozistoragebindingparamsarray.newbindingparams(). method overview void bindbyindex(in unsigned long aindex, in nsivariant avalue); void bindblobbyindex(in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyindex(in unsigned long aindex, in double avalue); native code only! void bindint32byi...
mozIStorageBindingParamsArray
mozistoragebindingparamsarray interface is a container for mozistoragebindingparams objects, and is used to store sets of bound parameters that will be used by the mozistoragestatement.executeasync(). storage/public/mozistoragebindingparamsarray.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports you can only create these objects by calling the mozistoragestatement.newbindingparamsarray(). method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array. ...
mozIStorageCompletionCallback
this interface should be implemented to handle callbacks from asynchronous storage api routines. storage/public/mozistoragecompletioncallback.idlscriptable please add a summary to this article. last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview void complete(); methods complete() called when an asynchronous storage routine has completed. void complete(); parameters none. ...
mozIStorageFunction
onsumers to add functions that are available to sql queries and triggers. there are a number of already defined functions provided by sqlite. objects implementing this interface can be registered with mozistorageconnection.createfunction(). storage/public/mozistoragefunction.idlscriptable please add a summary to this article. last changed in gecko 1.9.1.4 (firefox 3.5.4) inherits from: nsisupports method overview nsivariant onfunctioncall(in mozistoragevaluearray afunctionarguments); methods onfunctioncall() the implementation of the function. this is called by the database engine when the function registered with mozistorageconnection.createfunction() is used in an executing sql statement or trigger. note this callback is executed on the thread that the stateme...
mozIStoragePendingStatement
the mozistoragependingstatement interface represents a pending asynchronous database statement, and offers the cancel() method which allows you to cancel the pending statement. storage/public/mozistoragependingstatement.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void cancel(); methods cancel() cancels the pending statement. fails only if you attempt to cancel the operation more than once. note: for read statements, such as select, once you cancel the statement, you will receive no further notifications about results. void cancel(); parameters none. return value in versions of gecko prior to gecko 1.9.2, this returned a boolean value that was true if th...
mozIStorageProgressHandler
the mozistorageprogresshandler interface lets storage consumers receive callbacks during the execution of sqlite requests. storage/public/mozistorageprogresshandler.idlscriptable 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 boolean onprogress(in mozistorageconnection aconnection); methods onprogress() the onprogress() method is called periodically while an sqlite operation is ongoing. this allows you to monitor the progress and possibly display status information to the user. boolean onprogress( in mozistorageconnection aconnection ); parameters <tt>aconnection</tt> a mozistorageconnection connection indicating the connection for which the callback w...
mozIStorageResultSet
the mozistorageresultset interface represents a set of results from a storage statement. storage/public/mozistorageresultset.idlscriptable 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 mozistoragerow getnextrow(); methods getnextrow() returns the next row from the result set. mozistoragerow getnextrow(); parameters none. return value a mozistoragerow object containing the next row from the result set, or null if there are no more results. see also storage mozistorageconnection mozistoragestatement ...
mozIStorageStatementCallback
the mozistoragestatementcallback interface represents a callback handler that the storage api calls with result, error, and completion notifications while handling asynchronous database queries. storage/public/mozistoragestatementcallback.idlscriptable 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 handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the statement has finished executing normally. reason_canceled 1 the statement stopped executing b...
mozIStorageVacuumParticipant
add more details here. ...
mozIStorageValueArray
the mozistoragevaluearray interface obtains provides methods to obtain data from a given result. for an introduction on how to use this interface, see the storage overview document. storage/public/mozistoragevaluearray.idlscriptable please add a summary to this article. ...
mozIThirdPartyUtil
netwerk/base/public/mozithirdpartyutil.idlscriptable 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, [optional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [optional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party. this is done as follows: if achannel is an nsihttpchannel and has the 'forceallowthirdpart...
mozIVisitInfo
this may be null. sessionid long read only: the sessionid of this visit. transitiontype long read only: the transition type used to get to this visit. ...
mozIVisitInfoCallback
void handleerror( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult indicating the reason ...
mozIVisitStatusCallback
toolkit/components/places/moziasynchistory.idlscriptable this interface provides callback handling functionality for moziasynchistory.isurivisited 1.0 66 introduced gecko 11.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) method overview void isvisited(in nsiuri auri, in boolean avisitedstatus); methods isvisited() called when the moziasynchistory.isurivisited() method's check to determine whether a given uri has been visited has completed. implement this method to determine the results of the request. void isvisited( in nsiuri auri, in boolean avisitedstatus ); parameters auri the uri that was checked to see if it's been visited. avisitedstatus true if the specifie...
nsIAboutModule
netwerk/protocol/about/nsiaboutmodule.idlscriptable this interface is implemented to add an 'about:' page. the contract id ends with a parameter that corresponds to the name of the about page. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long geturiflags(in nsiuri auri); nsichannel newchannel(in nsiuri auri); constants constant value description uri_safe_for_untrusted_content (1 << 0) a flag that indicates whether a uri is safe for untrusted content. if it is, web pages and so forth will be allowed to link to this about: uri. otherwise, only chrome will be able to link to it. allow_script (1 << 1) a flag that indicates whether sc...
nsIAccessNode
the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. ...
GetAccessibleRelated
parameters arelationtype[in] the relation type between the accessible (see constants listed in relations documentation). ...
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action index supported by accessible. nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action. return values returns array of localized string of global keyboard accelerator. exceptions thrown ns_error_invalid_arg the given index doesn't correspond to default action (not zero). remark key bindings are supported for default action only. see also nsiaccessible.defaultkeybinding nsiaccessible.keyboardshortcut ...
GetRelation
y this method returns accessible relation for this accessible object by index. nsiaccessiblerelation getrelation( in unsigned long aindex ); parameters aindex[in] the index for which relation is to be retrieved. return value returns nsiaccessiblerelation object for this accessible. exception thrown ns_error_invalid_arg indicates that the given index is invalid. remark currently we do not support multiple relations so the zero index may be valid only. refer to relations documentation for more info. see also nsiaccessible.relationscount nsiaccessible.getrelations() nsiaccessible.getaccessiblerelation() ...
GetState
refer to states documentation for more information. ...
nsIAccessibleCaretMoveEvent
accessible/public/nsiaccessibleevent.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description caretoffset long return caret offset. read only. ...
nsIAccessibleCoordinateType
constants constant value description coordtype_screen_relative 0x00 the coordinates are relative to the screen. ...
nsIAccessibleDocument
accessible/public/nsiaccessibledocument.idlscriptable an interface for in-process accessibility clients that wish to retrieve information about a document. when accessibility is turned on in gecko, there is an nsiaccessibledocument for each document whether it is xul, html or whatever. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) you can queryinterface to nsiaccessibledocument from the nsiaccessible or nsiaccessnode for the root node of 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 getcac...
nsIAccessibleEvent
may return null if no accessible is available. read only. ...
nsIAccessibleHyperText
accessible/public/nsiaccessiblehypertext.idlscriptable this interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents. a typical implementation is to implement this interface on the small text object such as a paragraph of text. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long linkindex); long getlinkindex(in long charindex); long getselectedlinkindex(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object. read only. note: renamed from links in gecko 1.9 methods getlink() ...
nsIAccessibleImage
accessible/public/nsiaccessibleimage.idlscriptable this interface allows in-process accessibility clients to retrieve information about an image. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible. this method is the same as nsiaccessible.getbounds() excepting coordinate origin parameter. void getimageposition( in unsigned long coordtype, out long x, out long y ); parameters coordtype specifies coordinates origin (for available constants refer to nsiaccessiblecoordinatetype). x the x coor...
nsIAccessibleProvider
obsolete since gecko 1.9 accessibletype long value representing the type of accessible object. see constants for details. read only. ...
nsIAccessibleRelation
accessible/public/nsiaccessiblerelation.idlscriptable this interface gives access to an accessibles set of relations. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: be carefull, do not change constants until atk has a structure to map gecko constants into atk constants. method overview nsiaccessible gettarget(in unsigned long index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation. read only. targetscount unsigned long returns the number of targets for this relation. read only. constants c...
nsIAccessibleRetrieval
accessible/public/nsiaccessibleretrieval.idlscriptable an interface for in-process accessibility clients wishing to get an nsiaccessible or nsiaccessnode for a given dom node. ...
nsIAccessibleScrollType
scroll_type_bottom_right 0x01 scroll the bottom right of the object or substring to the bottom right of the window (or as close as possible). ...
nsIAccessibleSelectable
accessible/public/nsiaccessibleselectable.idlscriptable an interface for the accessibility module and in-process accessibility clients for dealing with getting and changing the selection of accessible nodes. inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long index); nsiaccessible refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected. read only. constants constant value description eselection_add 0 eselection_remove 1 eselection_getstat...
nsIAccessibleStateChangeEvent
read only. methods isenabled() boolean isenabled(); parameters none. ...
nsIAccessibleTable
accessible/public/nsiaccessibletable.idlscriptable please add a summary to this article. ...
nsIAccessibleTableCell
the result differs from 1 if the specified cell spans multiple columns. read only. columnheadercells nsiarray return an array of column header cells for this cell. read only. ...
nsIAccessibleTableChangeEvent
accessible/public/nsiaccessibleevent.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description numrowsorcols long return the number of rows or cols. read only. roworcolindex long return the row or column index. read only. ...
nsIAccessibleText
accessible/public/nsiaccessibletext.idlscriptable please add a summary to this article. ...
nsIAccessibleTextChangeEvent
read only. modifiedtext domstring the inserted or removed text. read only. ...
nsIAccessibleTreeCache
ure is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. a private interface to operate with tree accessible. accessible/public/nsiaccessibletreecache.idlnot scriptable please add a summary to this article. ...
nsIAccessibleValue
minimumincrement double read only. minimumvalue double read only. methods setcurrentvalue() obsolete since gecko 1.9 (firefox 3) return a success condition of the value getting set. that is if the value is within the range of minimumvalue - maximumvalue. ...
nsIAccessibleWin32Object
accessible/public/msaa/nsiaccessiblewin32object.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description hwnd voidptr handle to the external window implementing iaccessible. read only. native code only! ...
nsIAnnotationObserver
toolkit/components/places/public/nsiannotationservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void onitemannotationremoved(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item. if aname is empty, then all annotations for the given item have been deleted. this is not called when annotations are expired (normally happens when the applica...
nsIAppShell
widget/public/nsiappshell.idlnot scriptable interface for the native event system layer. this interface is designed to be used on the main application thread only. ...
nsIAppStartup_MOZILLA_2_0
toolkit/components/startup/public/nsiappstartup.idlscriptable this lets you get information about the times at which key application startup events occurred. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 4.0 this interface was merged into the nsiappstartup interface. ...
nsIApplicationCache
each entry in the cache can be marked with a set of types, specified in the constants section. ...
nsIApplicationCacheChannel
1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void markofflinecacheentryasforeign(); attributes attribute type description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly provided and none is available from the notification callbacks. the default value is false. ...
nsIApplicationCacheContainer
netwerk/base/public/nsiapplicationcachecontainer.idlscriptable this interface is used by objects that can be associated with an application cache. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description applicationcache nsiapplicationcache the application cache with which the object is associated. see also offline resources in firefox nsiapplicationcache nsiapplicationcachechannel nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheNamespace
if a load from the cache fails to match on an exact cache entry, the namespace entries are searched for a substring match. ...
nsIApplicationCacheService
netwerk/base/public/nsiapplicationcacheservice.idlscriptable this interface manages the set of application cache groups that manage offline resources for web applications. ...
nsIApplicationUpdateService
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that handles performing background update checks. it also provides utilities for selecting and downloading update patches. ...
nsIAsyncVerifyRedirectCallback
netwerk/base/public/nsiasyncverifyredirectcallback.idlscriptable implement this interface to receive a callback that lets you know whether an asynchronous redirect was verified or vetoed. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface implements the callbacks passed to the nsichanneleventsink.asynconchannelredirect() method. method overview void onredirectverifycallback(in nsresult result); methods onredirectverifycallback() implements the asynchronous callback passed to nsichanneleventsink.asynconchannelredirect(). the result of the redirect decision is passed through this callback. void onredirectverifycallback( in nsresult result ); para...
nsIAuthPrompt
netwerk/base/public/nsiauthprompt.idlscriptable this interface allows the networking layer to pose a user/password prompt to obtain the values needed for authentication. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is implemented by @mozilla.org/login-manager/prompter;1. to create an instance, use: var authprompt = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt); method overview boolean prompt(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, in wstring defaulttext, out wstring result); boolean promptpassword(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword...
nsIAuthPromptAdapterFactory
netwerk/base/public/nsiauthpromptadapterfactory.idlscriptable an interface for wrapping nsiauthprompt interfaces to make them usable via an nsiauthprompt2 interface. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiauthprompt2 createadapter(in nsiauthprompt aprompt); methods createadapter() wrap an object implementing nsiauthprompt so that it's usable via nsiauthprompt2. nsiauthprompt2 createadapter( in nsiauthprompt aprompt ); parameters aprompt the nsiauthprompt to wrap. return value an nsiauthprompt2. see also nsiauthprompt nsiauthprompt2 ...
nsIAuthPromptProvider
prompt_proxy 1 proxy authentication request. methods getauthprompt() this method requests a prompt interface for the given prompt reason. ...
nsIAutoCompleteInput
toolkit/components/autocomplete/public/nsiautocompleteinput.idlscriptable this interface monitors the input in a text field and displays an autocomplete panel at the appropriate time. ...
nsIAutoCompleteItem
xpfe/components/autocomplete/public/nsiautocompleteresults.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description classname string class name used to define some style through css like the colors, an icon url, and so on. comment wstring an extra comment that will be displayed next to the value but that will not be part of the value itself. param nsisupports parameter use by the search engine. value astring the result value using astring to avoid excess allocations. ...
nsIAutoCompleteListener
xpfe/components/autocomplete/public/nsiautocompletelistener.idlscriptable this interface is deprecated. it only exists for legacy ldap autocomplete session support. new code should use toolkit autocomplete interfaces. inherits from: nsisupports last changed in gecko 1.7 method overview void onautocomplete(in nsiautocompleteresults result, in autocompletestatus status); void onstatus(in wstring statustext); attributes attribute type description param nsisupports private parameter used by the autocomplete widget. methods onautocomplete() called by the autocomplete session when the search is done or over. as of gecko 1.9.1, can also be called with partial results, in a similar manner to the toolkit autocomplete interface. void onautocomplete( in nsiautocompleter...
nsIAutoCompleteObserver
toolkit/components/autocomplete/public/nsiautocompletesearch.idlscriptable 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 onsearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); void onupdatesearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); methods onsearchresult() called when a search is complete and the results are ready. void onsearchresult( in nsiautocompletesearch search, in nsiautocompleteresult result ); parameters search the search object that processed this search. result the search result object. onupdatesearchresult() called to update with new results. void onupdatesearchresult( in nsi...
nsIAutoCompleteResult
toolkit/components/autocomplete/nsiautocompleteresult.idlscriptable this interface is implemented by results of autocomplete search. inherits from: nsisupports last changed in gecko 1.7 see nsiautocompletesearch ...
nsIAutoCompleteSearch
results can be sent to the listener either synchronously or asynchronously, depending on the implementation. ...
nsIBinaryInputStream
integer read from the stream. read16() reads from the stream. pruint16 read16(); parameters none. return value a 16-bit integer read from the stream. read32() reads from the stream. pruint32 read32(); parameters none. return value a 32-bit integer read from the stream. read64() reads from the stream. warning: this method is available from javascript; however javascript does not support 64-bit integers. pruint64 read64(); parameters none. return value a 64-bit integer read from the stream. readarraybuffer() read opaque bytes from the stream, storing the results in an arraybuffer. unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); parameters alength the number of bytes that should be read. aarraybuffer the arraybuffer in which to store...
nsIBlocklistPrompt
xpcom/system/nsiblocklistservice.idlscriptable this interface is used, if available, by the default implementation of nsiblocklistservice to display a confirmation user interface to the user before blocking extensions or plugins. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void prompt([array, size_is(acount)] in nsivariant aaddons, [optional] in pruint32 acount); methods prompt() prompt the user about newly blocked addons. the prompt is then responsible for soft-blocking any addons that need to be afterwards. void prompt( [array, size_is(acount)] in nsivariant aaddons, in pruint32 acount optional ); parameters aaddons an array of add...
nsIBlocklistService
xpcom/system/nsiblocklistservice.idlscriptable please add a summary to this article. ...
nsICRLInfo
read only. lastupdate prtime the time this crl was created at. read only. lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the environment locale. read only. nameindb astring the key identifying the crl in the database. read only. ...
nsICRLManager
security/manager/ssl/public/nsicrlmanager.idlscriptable please add a summary to this article. ...
nsICache
access_read 1 access requested - i only want to read, if there isn't an entry just fail. access granted - you can read from this descriptor. ...
nsICacheDeviceInfo
read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. totalsize unsigned long get the total size of the stored cache entries. read only. ...
nsICacheEntryInfo
read only. datasize unsigned long get the cache entry data size. read only. deviceid string get the id for the device that stores this cache entry. read only. expirationtime pruint32 get the expiration time of the cache entry (in seconds since the epoch). read only. ...
nsICacheListener
the status parameter equals ns_ok on success. see nsicacheservice for accessgranted values. ...
nsICacheMetaDataVisitor
boolean visitmetadataelement( in string key, in string value ); parameters key the key for visiting the meta data for a cache entry. value the value for visiting the meta data for a cache entry. ...
nsICacheService
netwerk/cache/public/nsicacheservice.idlscriptable handles visiting and evicting entries operations along with the creating of cache sessions and creation of temporary client ids operations for offline caching. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is no longer supported and planned to be removed soon: use nsicachestorageservice instead. at the time of writing there is no documentation for nsicachestorageservice but comments are available in the source. note: starting in gecko 2.0, cache i/o is handled asynchronously. method overview nsicachesession createsession(in string clientid, in nscachestoragepolicy storagepolicy, in boolean streambased);...
nsICacheSession
netwerk/cache/public/nsicachesession.idlscriptable 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. ...
nsICacheVisitor
boolean visitdevice( in string deviceid, in nsicachedeviceinfo deviceinfo ); parameters deviceid specifies the device being visited. deviceinfo specifies information about this device. ...
nsICancelable
netwerk/base/public/nsicancelable.idlscriptable this interface provides a means to cancel an operation that is in progress. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void cancel(in nsresult areason); methods cancel() call this method to request that this object abort whatever operation it may be performing. void cancel( in nsresult areason ); parameters areason a failure code indicating why the operation is being canceled. it is an error to pass a success code. ...
nsIChannelEventSink
these methods are called before onstartrequest. ...
nsIChannelPolicy
netwerk/base/public/nsichannelpolicy.idlscriptable a container for policy information to be used during channel creation. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface exists to allow the content policy mechanism to function properly during channel redirects. channels can be created with this interface placed in the property bag and upon redirect, the interface can be transferred from the old channel to the new channel. attributes attribute type description contentsecuritypolicy nsisupports a nsicontentsecuritypolicy object to determine if the load should be allowed. loadtype unsigned long indicates what type of content is being loaded, for example nsiconten...
nsIChromeRegistry
chrome/public/nsichromeregistry.idlscriptable provides access to the chrome registry; you can use this to get information about chrome documents that have been registered. ...
nsIClipboardCommands
webshell/public/nsiclipboardcommands.idlscriptable an interface for embedding clients who wish to interact with the system-wide os clipboard. mozilla does not use a private clipboard, instead it places its data directly onto the system clipboard. the webshell implements this interface. ...
nsIClipboardDragDropHookList
you should access these capabilities indirectly by sending commands using the nsiclipboarddragdrophooks interface. ...
nsIClipboardHelper
void copystring( in astring astring ); parameters astring the string to copy to the clipboard. copystringtoclipboard() this method copies string to given clipboard. ...
nsIClipboardOwner
the nsiclipboardowner interface notifies the clipboard owner about the current status of ownership of the clipboard transferable at given situation and time. widget/public/nsiclipboardowner.idlscriptable 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 losingownership(in nsitransferable atransferable); methods losingownership() this method notifies the owner of the clipboard transferable that the transferable is being removed from the clipboard. it results into a ns_ok if there are no errors. void losingownership( in nsitransferable atransferable ); parameters atransferable the transferable. see also nsiclipboard nsitransferable ...
nsICommandController
content/xul/document/public/nsicontroller.idlscriptable an enhanced controller interface that supports passing parameters to commands. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/embedcomp/base-command-controller;1. to create an instance, use: var commandcontroller = components.classes["@mozilla.org/embedcomp/base-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method overview void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsi...
nsICommandLine
toolkit/components/commandlines/public/nsicommandline.idlscriptable represents the command line used to invoke a xul application. this may be the original command line of this instance or a command line provided remotely by another instance of the application. 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) components may implement the nsicommandlinehandler interface to add custom command line handling behavior. definitions arguments any values found on the command line. switches flags. in normalized form, these are preceded by a single dash. some flags may take parameters; for example: "-url <param>" or "-install-xpi <param>". method overview long findflag(in astring aflag,...
nsICommandLineHandler
the entries in this category are read in alphabetical order, and each category value is treated as a service contract id implementing this interface. ...
nsIConsoleListener
xpcom/base/nsiconsolelistener.idlscriptable this interface allows you to listen for messages sent to the console. inherits from: nsisupports last changed in gecko 1.7 method overview void observe(in nsiconsolemessage amessage); methods observe() called by the nsiconsoleservice when a message is posted to the console. listeners must first be attached to the service using nsiconsoleservice.registerlistener() void observe( in nsiconsolemessage amessage ); parameters amessage the nsiconsolemessage being posted. ...
nsIConsoleService
xpcom/base/nsiconsoleservice.idlscriptable 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. it is used to log various messages, warnings, and errors and to obtain the logged messages. ...
nsIContainerBoxObject
attributes attribute type description docshell nsidocshell read only. the nsidocshell object that manages the contained document. ...
nsIContentPref
nsicontentpref dom/interfaces/base/nsicontentprefservice2.idlscriptable a content preference 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) attributes attribute type description domain astring read only. name astring read only. value nsivariant read only. see also nsicontentprefservice2 nsicontentprefcallback2 ...
nsIContentPrefCallback2
this will be called exactly once for each method invocation, and afterward no other callback methods will be called. void handlecompletion( in unsigned short reason );...
nsIContentPrefObserver
dom/interfaces/base/nsicontentprefservice.idlscriptable this interface allows code to easily watch for changes to the values of content preferences. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void oncontentprefremoved(in astring agroup, in astring aname); void oncontentprefset(in astring agroup, in astring aname, in nsivariant avalue); methods oncontentprefremoved() called when a content preference is removed. void oncontentprefremoved( in astring agroup, in astring aname ); parameters agroup the group to which the removed preference belonged; this may be the uri of a web site. this value is null if the preference was global, applying to all web sites. a...
nsIContentPrefService
synchronous interface nsicontentprefservice2 instead. provides a way for extensions and browser code to save preferences for specific websites. preferences are saved as key/value pairs on a per-website basis. dom/interfaces/base/nsicontentprefservice.idlscriptable please add a summary to this article. last changed in gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports implemented by: @mozilla.org/content-pref/service;1. to create an instance, use: var contentprefservice = components.classes["@mozilla.org/content-pref/service;1"] .getservice(components.interfaces.nsicontentprefservice); method overview void addobserver(in astring aname, in nsicontentprefobserver aobserver); nsivariant getpref(in nsivariant agroup...
nsIContentPrefService2
specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. ...
nsIContentSniffer
see netwerk/build/nsnetcid.h about ns_content_sniffer_category. ...
nsIContentView
content/base/public/nsiframeloader.idlscriptable represents a scrollable content view whose contents are actually drawn by a separate process; this is part of the electrolysis multi-process support framework. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) see working with content views for details on how to use this api. note: currently, only <frame> and <iframe> elements are handled as content views. support for using this api for all scrollable elements is coming; see bug 618975 for details. method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); ...
nsIContentViewManager
see getting access to content views for details. ...
nsIConverterOutputStream
acharset, in unsigned long abuffersize, in prunichar areplacementcharacter ); parameters aoutstream the underlying output stream to which the converted strings will be written. acharset the character set to use for encoding the characters. a null charset will be interpreted as utf-8. abuffersize how many bytes to buffer. a value of 0 means that no bytes will be buffered. implementations not supporting buffering may ignore this parameter. areplacementcharacter the replacement character to use when an unsupported character is found. a value of 0x0000 will cause an exception to be thrown upon attempts to write unsupported characters. exceptions thrown ns_error_loss_of_significant_data if areplacementcharacter is not encodable in the selected character encoding and an attempt is made to w...
nsICookie
expires = 0 represents a session cookie. expires = 1 represents an expiration time earlier than jan 1, 1970. read only. host autf8string the host (possibly fully qualified) of the cookie. read only. ...
nsICookieAcceptDialog
remember_decision 1 value for remembering a decision. hostname 2 value for holding the hostname object. ...
nsICookieConsent
the policy for the given uri and channel is also returned. nscookiestatus getconsent( in nsiuri uri, in nsihttpchannel httpchannel, in boolean isforeign, out nscookiepolicy policy ); parameters uri the uri to find the policy for. ...
nsICookieManager
an optional interface for accessing or removing the cookies that are in the cookie list. netwerk/cookie/nsicookiemanager.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports this interface is intended to be used as a service. it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of ty...
nsICookiePermission
the nsicookiepermission interface is used to test for cookie permissions netwerk/cookie/nsicookiepermission.idlscriptable please add a summary to this article. ...
nsICookiePromptService
the nsicookiepromptservice interface is to open a dialog to ask to permission to accept the cookie. extensions/cookie/nsicookiepromptservice.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie. accept_cookie 1 holds the value for accepting the cookie. accept_session_cookie 2 holds the value for accepting the session cookie. methods cookiedialog() opens a dialog that asks for permission to accept a cookie. long cookiedialog...
nsICookieStorage
erbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this interface represents the storage repository for cookies. modules/plugin/base/public/nsicookiestorage.idlnot scriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store. void getcookie( in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookie...
nsICurrentCharsetListener
intl/uconv/idl/nsicurrentcharsetlistener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharsetlistener;1. to create an instance, use: var currentcharsetlistener = components.classes["@mozilla.org/intl/currentcharsetlistener;1"] .createinstance(components.interfaces.nsicurrentcharsetlistener); method overview void setcurrentcharset(in wstring charset); void setcurrentcomposercharset(in wstring charset); void setcurrentmailcharset(in wstring charset); methods setcurrentcharset() void setcurrentcharset( in wstring charset ); parameters charset setcurrentcomposercharset() void setcurrentcomposercharset( in wstring charset ); parameter...
nsICycleCollectorListener
xpcom/base/nsicyclecollectorlistener.idlscriptable interface to pass to the cycle collector to get information about the cycle collector graph while it is being built. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the order of calls will be call to begin(); then for every node in the graph a call to noteobject() and calls to noteedge() for every edge starting at that node; then a call to begindescriptions(); then for every black node in the cycle collector graph a call to either describerefcountedobject() or to describegcedobject(); and then a call to end(). if begin() returns an error none of the other functions will be called. method overview void begin(); void begindescri...
nsIDBChangeListener
there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access...
nsIDBFolderInfo
nsidbfolderinfo - careful, pulled from the wrong (cvs) repo! mailnews/db/msgdb/public/nsidbfolderinfo.idlscriptable ??? add brief description of interface ??? inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(...
nsIDNSListener
void onlookupcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve. arecord the dns record corresponding to the hostname that was resolved. ...
nsIDNSRecord
netwerk/dns/nsidnsrecord.idlscriptable this interface represents the result of a dns lookup. since a dns query may return more than one resolved ip address, the record acts like an enumerator, allowing the caller to easily step through the list of ip addresses. inherits from: nsisupports last changed in gecko 1.7 method overview prnetaddr getnextaddr(in pruint16 aport); native code only! acstring getnextaddrasstring(); boolean hasmore(); void rewind(); attributes attribute type description canonicalname acstring for example, www.mozilla.org --> rheet.mozilla.org. read only. methods native code only!getnextaddr this function copies the value of the next ip address into the given prnetaddr struct and increments the internal address iterator. prnetaddr getnext...
nsIDNSRequest
netwerk/dns/nsidnsrequest.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void cancel(); methods cancel() called to cancel a pending asynchronous dns request. the listener will passed to asyncresolve will be notified immediately with a status code of ns_error_abort. void cancel(); parameters none. ...
nsIDOMClientRect
dom/interfaces/base/nsidomclientrect.idlscriptable represents a rectangular box. the type of box is specified by the method that returns such an object. it is returned by functions like element.getboundingclientrect. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description bottom float y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. read only. height float height of the rectangle box (this is identical to bottom minus top). read only. left float x-coordinate, relative to the viewport origin, of the left of the rectangle box. read only. right ...
nsIDOMEvent
everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
nsIDOMEventGroup
dom/interfaces/events/nsidomeventgroup.idlscriptable this interface is the interface implemented by all event targets in the document object model. inherits from: nsisupports last changed in gecko 1.7 method overview boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one. boolean issameeventgroup( in nsidomeventgroup other ); parameters other instance of nsidomeventgroup object to compare against. return value returns true if the two objects are the same, otherwise false. see also document object model (dom) level 3 events specification ...
nsIDOMEventTarget
...
nsIDOMFileList
the nsidomfilelist interface contains a list of nsidomfile objects describing the files selected by the user for a "file" input field on a web form. gecko 1.9.2 note starting in gecko 1.9.2, this is also used by the datatransfer object to support dragging and dropping files into web applications. this interface implements the dom filelist object. please see that documentation for details. see also filelist datatransfer drag and drop ...
nsIDOMFileReader
the nsidomfilereader interface provides a way to read data from a file specified by an nsidomfile. content/base/public/nsidomfilereader.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports implemented by: @mozilla.org/files/filereader;1. to create an instance, use: var filereader = components.classes["@mozilla.org/files/filereader;1"].createinstance(components.interfaces.nsidomfilereader); this interface implements the dom filereader object; see that documentation for details. examples os.file for the main thread - example - save canvas to disk see also file api specification working draft nsidomfile nsidomfilelist nsidomfileexception ...
nsIDOMFontFace
it's returned in a list you can get using inidomutils.getusedfontfaces(). attributes font source attributes these attributes indicate how the font was found during the font matching process. note: the same physical font may have been found in multiple ways within a range. ...
nsIDOMFontFaceList
read only. methods item() returns the nsidomfontface object at the specified index into the list. ...
nsIDOMGeoPosition
read only. ...
nsIDOMGeoPositionAddress
dom/interfaces/geolocation/nsidomgeopositionaddress.idlscriptable this interface describes the geographical address of a location, including street, city, and country information, for example. this information may or may not be available, depending on the geolocation service being used. 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute. note: this needs to be moved into the dom reference. attributes attribute type description city domstring the city. read only. country domstring the country. read only. countrycode obsolete since gecko 11 domstring removed...
nsIDOMGeoPositionError
read only. ...
nsIDOMGeoPositionOptions
the nsidomgeopositionoptions interface is used to specify options for geolocation operations. dom/interfaces/geolocation/nsidomgeopositionoptions.idlscriptable 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 attributes attribute type description enablehighaccuracy boolean if true, high accuracy mode is used. timeout unsigned long maximum time in milliseconds before giving up on an attempt to retrieve location information. ...
nsIDOMGlobalPropertyInitializer
see custom window properties are a snap in firefox blog post for details. ...
nsIDOMHTMLSourceElement
e is encoded. media unimplemented domstring the media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. its value must be a valid media query. example <video controls> <source src="foo.webm" type="video/webm; codecs=&quot;vp9, opus&quot;"> your browser does not support the <code>video</code> element. </video> this example specifies that a video object with playback controls should be drawn, playing the file "foo.ogg". the type is specified as "video/ogg", and the source element also specifies that the video file uses the dirac and speex codecs. ...
nsIDOMHTMLTimeRanges
represented by an nsidomhtmltimeranges object has an index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the index number of the range to look up. dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article. last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object. read only. methods end() returns the time offset to the end of the specified time range. float end( in unsigned long index ); parameters index the index t...
nsIDOMMouseScrollEvent
dom/interfaces/events/nsidommousescrollevent.idlscriptable this interface represents a mouse scroll wheel event. 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsidommouseevent. method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relat...
nsIDOMMozNetworkStats
to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats. read only. data nsidommoznetworkstatsdata array stats samples. read only. ...
nsIDOMMozNetworkStatsData
dom/network/interfaces/nsidomnetworkstats.idlscriptable represents a single record in the network statistics database, as reported using the nsidommoznetworkstatsmanager interface. 1.0 66 introduced gecko 18.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) attributes attribute type description rxbytes unsigned long the number of bytes received on the connection. read only. txbytes unsigned long the number of bytes transmitted on the connection. read only. date date the date of the sample. read only. ...
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomnavigatordesktopnotification.idlscriptable property that extends the navigator object. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) property that extends the navigator object. attributes attribute type description moznotification nsidomdesktopnotificationcenter read only. see also nsidomdesktopnotificationcenter ...
nsIDOMParser
peration will automatically call init() on the domparser with a null principal and null pointers for documenturi and baseuri. cases where these values matter: if you don't specify the document uri by calling init() after creating the parser via createinstance() the created documents will use a moz-nullprincipal:{<guid>} uri, which will show in the error console in parsing errors, in particular. supposedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480). parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web platform documentation. examples within the context of a window: var parser = new domparser(); var doc = parser.parsef...
nsIDOMSerializer
content/base/public/nsidomserializer.idlscriptable this interface is really a placeholder till the w3c dom working group defines a mechanism for serializing dom nodes. an instance of this interface can be used to serialize a dom document or any dom subtree. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xmlextras/xmlserializer;1. to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified ele...
nsIDOMSimpleGestureEvent
oordinates contain the center point of the tap. (xxx not implemented on mac) mozpresstapgesture - generated when the user executes a press and tap two finger gesture (first finger down, second finger down, second finger up, first finger up) on the input device. client coordinates contain the center pivot point of the action. (xxx not implemented on mac) default behavior: some operating systems support default behaviors for gesture events when they are not handled by the application. consumers should use event.preventdefault() to prevent default behavior when consuming events. method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg,...
nsIDOMStorage
dom/interfaces/storage/nsidomstorage.idlscriptable this interface represents the storage space used for session storage in the dom. items stored in session storage may be accessed by any interested party in the same browsing context. 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) a dom window's session storage object can be retrieved from the window's sessionstorage attribute. a storage object stores an arbitrary set of key-value pairs, which may be retrieved, modified and removed as needed. a key may only exist once within a storage object, and only one value may be associated with a particular key. keys are stored in a particular order with the condition that this order...
nsIDOMStorage2
tems stored in local storage may only be accessed by the same origin that created the items in the first place. a dom window's local storage object can be retrieved from the window's localstorage attribute. dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes a...
nsIDOMStorageItem
attributes attribute type description secure boolean if true, the item was stored for an https page. ...
nsIDOMStorageList
dom/interfaces/storage/nsidomstoragelist.idlscriptable this interface is used to access the contextual storage areas used by globalstorage by domain. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes. nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object. return value the nsidomstorage object representing the data store for the specified domain.see also dom storage structured client-side storage (html 5 specification) nsidomwindow ...
nsIDOMStorageManager
dom/interfaces/storage/nsidomstoragemanager.idlscriptable this interface provides methods for managing data stored in the offline apps cache. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by @mozilla.org/dom/storagemanager;1 as a service: var domstoragemanager = components.classes["@mozilla.org/dom/storagemanager;1"] .getservice(components.interfaces.nsidomstoragemanager); method overview void clearofflineapps(); nsidomstorage getlocalstorageforprincipal(in nsiprincipal aprincipal, in domstring adocumenturi); long getusage(in astring aownerdomain); methods clearofflineapps() clears keys owned by offline applications. all data ...
nsIDOMStorageWindow
dom/interfaces/storage/nsidomstoragewindow.idlscriptable this interface provides access to a dom window's client side storage objects. all dom windows inherit from this interface. 1.0 66 introduced gecko 1.8.1 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface has been merged into nsidomwindow, and this interface has been removed. attributes attribute type description globalstorage nsidomstoragelist global storage, accessible by domain. read only. localstorage nsidomstorage local storage for the current browsing context. data stored in local storage may only be accessed from the same origin that inser...
nsIDOMUserDataHandler
node_imported 2 the node was cloned into a new document. ...
nsIDOMXPathException
constants error codes constant value description invalid_expression_err 51 an invalid xpath expression was used. type_err 52 an attempt was made to reference an unavailable type. ...
nsIDOMXPathExpression
dom/interfaces/xpath/nsidomxpathexpression.idlscriptable represents a compiled xpath query returned from nsidomxpathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method overview nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the xpath expression. nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the xpath expression against. to evaluate against a whole document, use the document.documentelement method to get the node to evaluate against. type a number that corresponds to one of the type constants of nsidomxpat...
nsIDOMXPathResult
read only. invaliditeratorstate boolean true if the iterator state has become invalid. ...
nsIDataSignatureVerifier
security/manager/ssl/public/nsidatasignatureverifier.idlscriptable an interface for verifying that a given string of data was signed by the private key matching the given public key. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean verifydata(in acstring adata, in acstring asignature, in acstring apublickey); methods verifydata() verifies that the data matches the data that was used to generate the signature. boolean verifydata( in acstring adata, in acstring asignature, in acstring apublickey ); parameters adata the data to be tested. asignature the signature of the data, base64 encoded. apublickey the public part of the key used for signing, der encoded then base64 encoded. r...
nsIDeviceMotionData
attributes attribute type description type unsigned long the type of motion data reported by this object; see motion type constants for possible values. read only. x double the amount of tilt along the x axis. ...
nsIDeviceMotionListener
xpcom/system/nsidevicemotion.idlscriptable this interface can be implemented by clients that want to be notified orientation or acceleration changes on supported devices. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void onmotionchange(in nsidevicemotiondata amotiondata); methods onmotionchange() called when new orientation or acceleration data is available. void onmotionchange( in nsidevicemotiondata amotiondata ); parameters aacceleration the nsidevicemotiondata object describing updated motion information. see also mozorientation nsidomorientationevent nsidevicemotion nsidevicemotiondata ...
nsIDialogCreator
embedding/base/nsidialogcreator.idlscriptable please add a summary to this article. ...
nsIDialogParamBlock
embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog. inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports. methods getint() get a previously set integer. print32 getint( in print32 inindex ); parameters inindex t...
nsIDirIndex
unspecified for directories. description wstring a description for the filename, which should be displayed by a viewer. ...
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscriptable this interface provides a means for enumerating the contents of a directory. it is similar to nsisimpleenumerator except 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 description nextfile nsifile the next file in the sequence. the nextfile attribute is the first element upon the first call. this attribute is null if there is no next element. read only. methods close() closes the directory being enumer...
nsIDirectoryIterator
the nsidirectoryiterator interface provides a way to iterate over the entries in a directory. xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. ...
nsIDirectoryService
xpcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance. the xpcom directory service implements this interface to provide support for a variety of well-known file and directory locations. inherits from: nsisupports last changed in gecko 1.7 method overview void init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance. this method must be called before an nsidirectoryservice instance can be used. in the case of the xpcom directory service, this method is called as part of xpcom initialization. must not be called by external code; called internally by xpcom initialization...
nsIDirectoryServiceProvider
method overview nsifile getfile(in string prop, out prbool persistent); methods getfile() the directory service calls this method when it gets the first request for a prop or on every request if the prop is not persistent. nsifile getfile( in string prop, out prbool persistent ); parameters prop the symbolic name of the file. persistent true if the returned file will be cached by directory service. ...
nsIDiskCacheStreamInternal
netwerk/cache/nsidiskcachestreaminternal.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void closeinternal(); methods closeinternal() we use this method internally to close nsdiskcacheoutputstream under the cache service lock. void closeinternal(); parameters none. ...
nsIDownload
le transfer that has been completed, or -1 if the file's size is unknown. read only. referrer nsiuri the referrer uri of the download. this is only valid for http downloads, and can be null. read only. resumable boolean indicates if the download can be resumed after being paused or not. this is only the case if the download is over http/1.1 or ftp and if the server supports it. read only. size long long the total size of the file in bytes, or ll_maxuint if the file's size is unknown. read only. source nsiuri the source uri of the download. read only. speed double the downloads transfer speed in bytes per second. read only. starttime long long the time at which the transfer was started. read only. ...
nsIDownloadHistory
docshell/base/nsidownloadhistory.idlscriptable this interface can be used to add a download to history. there is a separate interface specifically for downloads in case embedders choose to track downloads differently from other types of history. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adddownload(in nsiuri asource, [optional] in nsiuri areferrer, [optional] in prtime astarttime); methods adddownload() adds a download to history. this will also notify observers that the uri asource is visited with the topic ns_link_visited_event_topic if asource has not yet been visited. void adddownload( in nsiuri asource, in nsiuri areferrer, optional in prtime astarttime optional ); param...
nsIDownloadManager
this interface is deprecated as of firefox 26. please use downloads.jsm instead. toolkit/components/downloads/public/nsidownloadmanager.idlscriptable 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. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/download-manager;1. to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource...
nsIDownloadManagerUI
toolkit/components/downloads/public/nsidownloadmanagerui.idlscriptable this interface is used to implement the user interface for the download manager. if you wish to replace the default download manager user interface, implement this interface. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false. read only. constants constant value description reason_user_int...
nsIDownloadProgressListener
when you no longer need to listen to the download manager's state, call nsidownloadmanager.removelistener() to stop listening. ...
nsIDragDropHandler
built-in drag and drop implementation in the content area. use this to register where the listeners should attach (something that implements nspidomeventtarget which is what we end up using under the hood). content/base/public/nsidragdrophandler.idlscriptable 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 hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop. void detach(); parameters none. hookupto() attaches drag handlers to a specified receiver, setting up callbacks to let built-in behaviors be overridden. void hookupto( in nsidomeventtarget attachpoint, ...
nsIDroppedLinkHandler
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean candroplink(in nsidomdragevent aevent, in prbool aallowsamedocument); astring droplink(in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit); void droplinks(in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks); methods candroplink() determines if a link being dragged can be dropped. boolean candroplink( in nsidomdragevent aevent, in prbool aal...
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description url domstring url of the dropped link. name domstring name of the dropped link. type domstring mime-type of the dropped link. see also nsidroppedlinkhandler ...
nsIDynamicContainer
it can use the property bag on every result node to store data associated with each item, such as a full path on disk. ...
nsIEditorDocShell
method overview void makeeditable(in boolean inwaitforuriload); attributes attribute type description editable boolean this docshell is editable. read only. editor nsieditor gets or sets the editor for the content document. ...
nsIEditorLogging
editor/idl/nsieditorlogging.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void startlogging(in nsifile alogfile); void stoplogging(); methods startlogging() start logging. void startlogging( in nsifile alogfile ); parameters alogfile the file to which the log should be written. stoplogging() stop logging. void stoplogging(); parameters none. ...
nsIEditorObserver
editor/idl/nsieditorobserver.idlscriptable used by applications wishing to be notified when the editor has completed a user action. 66 introduced gecko 1.0 obsolete gecko 18 inherits from: nsisupports last changed in gecko 1.7 method overview void editaction(); methods editaction() called after the editor completes a user action. void editaction(); parameters none. ...
nsIEditorSpellCheck
editor/idl/nsieditorspellcheck.idlnot scriptable provides spell checking commands for nsieditor instances. inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/editor/editorspellchecker;1. to create an instance, use: var editorspellcheck = components.classes["@mozilla.org/editor/editorspellchecker;1"] .createinstance(components.interfaces.nsieditorspellcheck); method overview void addwordtodictionary(in wstring word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in wstring suggestedword); boolean checkcurrentwordnosuggest(in wstring suggestedword); astring getcurrentdictionary(); v...
nsIEffectiveTLDService
netwerk/dns/nsieffectivetldservice.idlscriptable this is an interface that examines a hostname and determines the longest portion that should be treated as though it were a top-level domain (tld). it can also determine the base domain of a uri. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/effective-tld-service;1. to use this service, use: var etldservice = components.classes["@mozilla.org/network/effective-tld-service;1"] .getservice(components.interfaces.nsieffectivetldservice); the name "effective tld service" is a historical one; today, the items this interface manipulates are called public suffixes, and the list of them is the public suffix list, or ...
nsIEnvironment
getservice(components.interfaces.nsienvironment); method overview void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an environment variable. ...
nsIErrorService
xpcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages. string bundle keys can also be mapped. ...
nsIEventListenerService
content/events/public/nsieventlistenerservice.idlscriptable a service that can be used to get a list of listeners observing events; this is primarily useful for debuggers. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/eventlistenerservice;1. to create an instance, use: var eventlistenerservice = components.classes["@mozilla.org/eventlistenerservice;1"] .getservice(components.interfaces.nsieventlistenerservice); universalxpconnect privileges are required to use this service. method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, ar...
nsIEventSource
...
nsIExternalHelperAppService
uriloader/exthandler/nsiexternalhelperappservice.idlscriptable the external helper app service is used for finding and launching platform specific external applications for a given mime content type. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/uriloader/external-helper-app-service;1. to access this service, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awi...
nsIExternalURLHandlerService
uriloader/exthandler/nsiexternalurlhandlerservice.idlscriptable the external url handler service is used for finding platform-specific applications for handling particular urls. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsihandlerinfo geturlhandlerinfofromos(in nsiuri aurl, out boolean afound); methods geturlhandlerinfofromos() given a url, looks up the handler info from the operating system. this should be overridden by each operating systems implementation. nsihandlerinfo geturlhandlerinfofromos( in nsiuri aurl, out boolean afound ); parameters aurl the url we are looking for. afound was an operating system default handler for this url found? re...
nsIFTPChannel
the nsiftpchannel is an extension of nsisupports used to determine if a channel is an ftp channel, and offering additional information about the ftp channel. you can determine if a channel is an ftp channel by checking to see if it implements this interface, by calling nsisupports.queryinterface() on it. netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports attributes attribute type description lastmodifiedtime prtime the time at which the ftp channel was last updated. ...
nsIFaviconDataCallback
it's up to the invoking method to state if the callback is always invoked, or called on success only. ...
nsIFaviconService
toolkit/components/places/public/nsifaviconservice.idlscriptable stores favicons for pages in bookmarks and history. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/browser/favicon-service;1. to use this service, use: var faviconservice = components.classes["@mozilla.org/browser/favicon-service;1"] .getservice(components.interfaces.nsifaviconservice); method overview void addfailedfavicon(in nsiuri afaviconuri); void expireallfavicons(); void getfavicondata(in nsiuri afaviconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata...
nsIFeed
midnight) to 23 (11:00 pm), and are always indicated using utc. note: this field is rarely implemented. subtitle nsifeedtextconstruct returns a subtitle for the feed, based on its description, subtitle, and appropriate extensions. textinput nsiwritablepropertybag2 information about a text box that can be displayed along with the feed by aggregators that support it, to allow the reader to send a response back to the source of the feed. note: this field is almost never used, and is incompatible with many aggregators. type unsigned long indicates the type of content presented by a feed. see constants. note: you should consider this a bit mask of values; at some point, the type may include more than one of these values ored toget...
nsIFeedElementBase
toolkit/components/feeds/public/nsifeedelementbase.idlscriptable this interface is a base interface from which several of the other feed access interfaces derive. 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) attributes attribute type description attributes nsisaxattributes all the attributes found on the element. most derived interfaces provide convenience accessors for their standard fields, so this is only useful when looking for nonstandard fields. baseuri nsiuri the base uri for the entry or feed. interwiki link ...
nsIFeedTextConstruct
toolkit/components/feeds/public/nsifeedtextconstruct.idlscriptable this interface represents rss or atom feed text fields that may contain plain text, html, or xhtml. some extension elements also include "type" parameters, and this interface could be used to represent those as well. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by: @mozilla.org/feed-textconstruct;1, but users usually don't need to create instances of this directly. various other feed-related interfaces, such as nsifeed, nsifeedentry, and nsifeedcontainer have attributes that return objects implementing nsifeedtextconstruct. method overview nsidomdocumentfragment createdocumentfragment(in n...
nsIFilePicker
widget/nsifilepicker.idlscriptable 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. inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) implemented by: @mozilla.org/filepicker;1. to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepic...
nsIFileProtocolHandler
le the nsifile to convert. return value a reference to a new nsiuri object. readurlfile() takes a local file and tries to interpret it as an internet shortcut (for example .url files on windows). nsiuri readurlfile( in nsifile file ); parameters file the nsifile to read. return value the nsiuri the file refers to. exceptions thrown ns_error_not_available the os does not support such files. ns_error_not_available the file is not an internet shortcut. see also code_snippets:file_i/o ...
nsIFileStreams
the nsifilestreams interface is an input stream that allows you to read from a file. netwerk/base/public/nsifilestreams.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when th...
nsIFileURL
the getter returns a reference to an immutable object. ...
nsIFileView
it's not included in windows or mac builds. note: a quirk of the nsifileview is that it requires an appropriate treecols section in the tree tag, by default fileview will return the file size in the column. if the treecol id is "filenamecolumn" fileview will return the file name, if the id is "lastmodifiedcolumn" it will return the date of last modification. currently no other file stats are implemented. ...
nsIFocusManager
dom/interfaces/base/nsifocusmanager.idlscriptable please add a summary to this article. ...
nsIFormHistory2
toolkit/components/satchel/public/nsiformhistory.idlscriptable a service which holds a set of name/value pairs. the names correspond to form field names, and the values correspond to values the user has submitted. so, several values may exist for a single name. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this interface provides no means to access stored values. stored values are used by the formfillcontroller to generate autocomplete matches. method overview void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimefram...
nsIFrameLoader
content/base/public/nsiframeloader.idlscriptable handles loading a frame. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this interface works in tandem with the nsicontentview interface to manage frames across processes if electrolysis is in use to support per-frame processes. method overview void activateframeevent(in astring atype, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcros...
nsIFrameLoaderOwner
read only. ...
nsIFrameMessageListener
content/base/public/nsimessagemanager.idlscriptable implement this interface in a remote frame handling process to receive messages from the browser process. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is used when implementing out-of-process handling of frames; the process handling a frame should implement this interface in order to receive messages. method overview void receivemessage(); methods receivemessage() note: this method is for javascript only. called to deliver a message to the frame handling process; called with one parameter, which has the following properties: name the name of the message. sync ...
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable provides methods for managing message listeners on local frames. this provides a way for local frames to receive messages from remote frames. 1.0 66 introduced gecko 2.0 obsolete gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was removed in firefox 17. you should use nsimessagelistenermanager or nsimessagesender instead. method overview void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyncmes...
nsIGSettingsCollection
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article. ...
nsIGSettingsService
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article. ...
nsIGeolocationUpdate
xpcom/system/nsigeolocationprovider.idlscriptable provides a way for a geolocation provider to notify the system that a new location is available. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) interface provides a way for a geolocation provider to notify the system that a new location is available. method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered. note: this must be called on the main thread. void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information. see also using geolocation nsigeol...
nsIGlobalHistory
void addpage( in string aurl ); parameters aurl the url to the page. ...
nsIGlobalHistory2
docshell/base/nsiglobalhistory2.idlscriptable this interface provides information about global history to gecko. it was split off from nsiglobalhistory during the transition to toolkit interfaces. inherits from: nsisupports last changed in gecko 1.7 this interface replaces and deprecates nsiglobalhistory method overview void adduri(in nsiuri auri, in boolean aredirect, in boolean atoplevel, in nsiuri areferrer); boolean isvisited(in nsiuri auri); void setpagetitle(in nsiuri auri, in astring atitle); methods adduri() add a uri to global history. note: docshell will not filter out uri schemes like chrome:, data:, about: and view-source:. embedders should consider filtering out these schemes and others, for example mailbox:,...
nsIGlobalHistory3
newchannel aflags flags to add. these are defined by the history that is implementing this interface. atoplevel whether the uri is loaded in a top-level window. if false, the load is in a subframe. geturigeckoflags() get the gecko flags for this uri. these flags are used by gecko as hints to optimize page loading. not all histories have them; this need not be supported (just return ns_error_not_implemented. these flags are opaque and should not be interpreted by the history engine. unsigned long geturigeckoflags( in nsiuri auri ); parameters auri the nsiuri to get flags for. flags are defined by the history that is implementing this interface. return value the gecko flags for the uri. seturigeckoflags() set the gecko flags for this uri.
nsIHTTPHeaderListener
this instance is passed in through {geturl,posturl}()'s streamlistener parameter. ...
nsIHttpChannelInternal
netwerk/protocol/http/nsihttpchannelinternal.idlscriptable an internal interface for http channels. using features exposed by this interface is not recommended, as it will change in unpredictable ways. ...
nsIHttpHeaderVisitor
this method can throw an exception to terminate enumeration of the channel's headers. ...
nsIHttpUpgradeListener
netwerk/protocol/http/nsihttpchannelinternal.idlscriptable the callback interface for nsihttpchannelinternal.httpupgrade; this is called when an http protocol upgrade is finished. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this is used, for example, by websockets in order to upgrade an http channel to use the websocket protocol. method overview void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer...
nsIINIParser
also, if you need to write to an ini file, use nsiiniparserwriter. ...
nsIINIParserFactory
method overview nsiiniparser createiniparser(in nsilocalfile ainifile); methods createiniparser() creates an ini parser, returning the nsiiniparser object that you can use to parse it. ...
nsIIdleService
widget/nsiidleservice.idlscriptable the idle service lets you monitor how long the user has been 'idle', that is they have not used their mouse or keyboard. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) you can get the idle time directly, but in most cases you will want to register an observer for a predefined interval. the observer will get an 'idle' notification when the user is idle for that interval (or longer), and receive a 'back' (gecko 3 to 15) or 'active' (gecko 16+) notification when the user starts using their computer again. note: the idle service is for computer-wide idle detection, not just application idle detection. in other words, even if the user is w...
nsIInputStream
a blocking input stream may suspend the calling thread in order to satisfy a call to close(), available(), read(), or readsegments(). a non-blocking input stream, on the other hand, must not block the calling thread of execution. note: blocking input streams are often read on a background thread to avoid locking up the main application thread. ...
nsIInputStreamCallback
xpcom/io/nsiasyncinputstream.idlscriptable this is a companion interface for nsiasyncinputstream.asyncwait(). inherits from: nsisupports last changed in gecko 1.7 method overview void oninputstreamready(in nsiasyncinputstream astream); methods oninputstreamready() called to indicate that the stream is either readable or closed. void oninputstreamready( in nsiasyncinputstream astream ); parameters astream the stream whose nsiasyncinputstream.asyncwait() method was called. see also nsiasyncinputstream.asyncwait() ...
nsIInstallLocation
toolkit/mozapps/extensions/public/nsiextensionmanager.idlscriptable interface representing a location where extensions, themes and so on are installed. 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: while this api still works, firefox 4 no longer extracts xpis by default, so this will now point to the xpi file instead of to the directory. any nsifile operations that assume a directory and plain files will fail in firefox 4, unless you specify <em:unpack>. you can get the install location of a particular add-on using nsiextensionmanager interface: var il = components.classes["@mozilla.org/extensions/manager;1"] .getservi...
nsIInterfaceRequestor
xpcom/base/nsiinterfacerequestor.idlscriptable this interface defines a generic interface for requesting interfaces that a given object might provide access to. inherits from: nsisupports last changed in gecko 0.9.5 this is similar to nsisupports.queryinterface(). the main difference is that interfaces returned are not required to provide a way back to the object implementing nsiinterfacerequestor. the semantics of nsisupports.queryinterface() dictate that given an interface a that you nsisupports.queryinterface() on to get to interface b, you must be able to nsisupports.queryinterface() on b to get back to a. nsiinterfacerequestor, however, allows you to obtain an interface c from a that may (or most likely) will not have the ability to get back to a. method overview void ...
nsIJSCID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface provides methods to instantiate a component and access service components. inherits from: nsijsid last changed in gecko 1.7 method overview nsisupports createinstance(); nsisupports getservice(); methods createinstance() nsisupports createinstance(); parameters none. return value getservice() nsisupports getservice(); parameters none. return value see also see components.classes for usage patterns of the createinstance() and getservice() methods. ...
nsIJSID
an unnamed jsid also results when you implement a function that is passed an nsiidref parameter, such as queryinterface(). ...
nsIJetpack
js/jetpack/nsijetpack.idlscriptable this interface enables communication between the chrome process and a remote jetpack process. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void sendmessage(in astring amessagename /* [optional] in jsval v1, [optional] in jsval v2, ... */); void registerreceiver(in astring amessagename, in jsval areceiver); void unregisterreceiver(in astring amessagename, in jsval areceiver); void unregisterreceivers(in astring amessagename); void evalscript(in astring ascript); nsivariant createhandle(); void destroy(); methods sendmessage() this method asynchronously sends a message to the jetpack process. void sendmessage( ...
nsIJetpackService
method overview nsijetpack createjetpack(); methods createjetpack() this method creates a new jetpack process and returns an nsijetpack interface that represents it. ...
nsIJumpListItem
widget/public/nsijumplistitem.idlscriptable implements windows 7 taskbar jump list item interfaces. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjumplistitem, and add support to addlistbuild and removed items processing. method overview boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type. read only. constants constant value description jumplist_item_empty 0 empty list ...
nsILivemarkService
implemented by: @mozilla.org/browser/livemark-service;2. ...
nsILocale
astring getcategory( in astring category ); parameters category a string representing the category to retrieve the locale for. valid strings are stored in nsilocale.idl. currently those are: nsilocale_collate - collation order. ...
nsILocaleService
intl/locale/idl/nsilocaleservice.idlscriptable the locale service interface. 1.0 66 introduced gecko 1.6 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/intl/nslocaleservice;1. to use this service, use: var localeservice = components.classes["@mozilla.org/intl/nslocaleservice;1"] .getservice(components.interfaces.nsilocaleservice); method overview nsilocale getapplicationlocale(); astring getlocalecomponentforuseragent(); nsilocale getlocalefromacceptlanguage(in string acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in astring alocale); nsilocale newlocaleobject(in nsilocaledefinition localedefinition); ob...
nsILoginInfo
nsilogininfo is an object containing information for a login stored by the login manager. to create and manage logins use nsiloginmanager. toolkit/components/passwordmgr/public/nsilogininfo.idlscriptable 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 implemented by: @mozilla.org/login-manager/logininfo;1. to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method overview nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring auserna...
nsILoginManagerCrypto
if the user is not logged in, performing a crypto operation will result in a master password prompt. read only. ...
nsILoginManagerIEMigrationHelper
toolkit/components/passwordmgr/public/nsiloginmanageriemigrationhelper.idlscriptable imports a login from the nsiieprofilemigrator into the login manager. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void migrateandaddlogin(in nsilogininfo alogin); methods migrateandaddlogin() takes a login provided from nsieprofilemigrator, migrates it to the current login manager format, and adds it to the list of stored logins. note: in some cases, multiple logins may be created from a single input when the format is ambiguous. void migrateandaddlogin( in nsilogininfo alogin ); parameters alogin the login to be migrated. ...
nsILoginManagerPrompter
toolkit/components/passwordmgr/public/nsiloginmanagerprompter.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/login-manager/prompter;1. to call this service, use: var loginmanagerprompter = components.classes["@mozilla.org/login-manager/prompter;1"] .getservice(components.interfaces.nsiloginmanagerprompter); method overview void init(in nsidomwindow awindow); void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); ...
nsILoginMetaInfo
toolkit/components/passwordmgr/public/nsiloginmetainfo.idlscriptable an object that contains metadata for logins stored by the login manager. this data can usually be ignored by most users of the login manager, which will create and maintain appropriate default values. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) you can specifically modify these values by passing changes into nsiloginmanager.modifylogin() using an nsipropertybag2 object as the input. metadata properties are ignored when comparing logins. attributes attribute type description guid astring the guid to uniquely identify the login. this can be any arbitrary string, but a format as created by nsiuuidgen...
nsIMemory
the implementation is free to define the heap. ns_getmemorymanager returns the global nsimemory instance. ...
nsIMemoryReporter
xpcom/base/nsimemoryreporter.idlscriptable reports memory usage information for a single area of the software. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) any piece of code that wishes to allow its memory use to be monitored may create an nsimemoryreporter object and then register it by calling nsimemoryreportermanager.registerreporter(). once that has been done, the reporter will be found by any client accessing the enumerator returned by nsimemoryreportermanager.enumeratereporters(). this includes the about:memory page. note: this interface is undergoing heavy development, and is subject to rapid changes. attributes attribute type description ...
nsIMemoryReporterManager
each code area is identified by a unique path string, which is displayed in about:memory. ...
nsIMenuBoxObject
layout/xul/base/public/nsimenuboxobject.idlscriptable represents the box object for a xul menu. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method overview boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box. openedwithkey boolean true if the menubar was opened using the keyboard; otherwise false. note: for gecko 2.0, the openedw...
nsIMessageListener
listeners are attached using the nsimessagelistenermanager interface. methods void receivemessage(); receivemessage() this is for js only. this function receives a message from one of the three message-sending functions in the message manager framework: broadcastasyncmessage sendasyncmessage sendsyncmessage. the received message is an object with the following properties: target the target of the message. ...
nsIMessageListenerManager
dom/base/nsimessagemanager.idlscriptable this interface enables clients to listen for messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces. 1.0 66 introduced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1. to access this service, use: var globalmm = components.classes["@mozilla.org/globalmessagemanager;1"] .getservice(components.interfaces.nsimessagelistenermanager); method overview void addmessagelistener(in astring messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void re...
nsIMessenger
to create an instance, use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger via the createmessenger function in mailwindow.js. ...
nsIMicrosummaryObserver
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides methods for observing changes to micrummaries. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void oncontentloaded(in nsimicrosummary microsummary); void onelementappended(in nsimicrosummary microsummary); void onerror(in nsimicrosummary microsummary); methods oncontentloaded() called when an observed microsummary updates its content. since an observer might watch multiple microsummaries at the same time, the microsummary whose content has been updated gets ...
nsIMicrosummarySet
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides access to sets of microsummaries returned from the nsimicrosummaryservice. 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosummaryobserver observer); methods addobserver() add a microsummary observer to this microsummary set. adding an observer to a set is the equiv...
nsIMimeConverter
the nsimimeconverter service allows you to convert headers into and out of mime format. inherits from: nsisupports implemented by: @mozilla.org/messenger/mimeconverter;1. method overview string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mim...
nsIMimeHeaders
nsimimeheaders mailnews/mime/public/nsimimeheaders.idlscriptable ??? add brief description of interface ??? inherits from: nsisupports last changed in gecko 1.7 implemented by: ?????????????????????????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method overview string extractheader([const] in string headername, in boolean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type description allheaders string read...
nsIMsgAccount
nsimsgaccount mailnews/base/public/nsimsgaccount.idlscriptable an account consists of an incoming server and one or more outgoing identities. inherits from: nsisupports last changed in gecko 1.7 method overview void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only. outgoing identity list (array of nsimsgidentity's) incomingserver nsimsgincomingserver incoming server stuff key acstring internal key identifying itself methods addidentity() adds a new identity to this account. void addidentity( in nsimsgidentity identity ); parameters identity th...
nsIMsgAccountManagerExtension
have to register any new account manager extensions via the the category manager at start up. simply add a new entry with the contact id of the component to the "mailnews-accountmanager-extensions" category. //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgaccountmanager.idlscriptable please add a summary to this article. last changed in gecko ??? inherits from: nsisupports method overview boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension. it has to be unique and defines the file name of the property file and the xul page as well as the name of the localized string contained in the property file. this attribute is readonly! chromepackagename acstring chrome p...
nsIMsgDBHdr
there are utility functions that also return it though. for instance, msghdrforcurrentmessage() will return the currently selected message's header. headers are backed by the database: a call to these functions directly modifies the state of the database, although it is not saved until the database is committed. ...
nsIMsgDBViewCommandUpdater
the nsimsgdbviewcommandupdater interface controls changes that occur as the selection changes. mailnews/base/public/nsimsgdbview.idl#349scriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdbviewcommandupdater (for the standalone message window) nsmsgdbviewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method overview void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes. void...
nsIMsgFilter
action, in nsimsgdbhdr aheader ) createaction() nsimsgruleaction nsimsgfilter::createaction ( ) getactionat() nsimsgruleaction nsimsgfilter::getactionat (in long aindex) appendaction() void nsimsgfilter::appendaction (in nsimsgruleaction action ) clearactionlist() void nsimsgfilter::clearactionlist() getsortedactionlist() void nsimsgfilter::getsortedactionlist (in nsisupportsarray actionlist) ...
nsIMsgFilterCustomAction
* recommended form: extensionname@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list. this should be localized. ...
nsIMsgHeaderParser
nsimsgheaderparser defined in comm-central/ mailnews/ mime/ public/ nsimsgheaderparser.idl mailnews/mime/public/nsimsgheaderparser.idlscriptable ??? add brief description of interface ??? ...
nsIMsgIdentity
the nsimsgidentity interface contains all the personal outgoing mail information for a given person. each identity is identified by a key, which is the id string in the identity preferences, such as in mail.identity.<id>.replyto. ...
nsIMsgProtocolInfo
method overview long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted. read only. canduplicate boolean unused. read only. cangetincomingmessages boolean true if junk ui actions should be enabled for the account type. read only. ...
nsIMsgRuleAction
throws an exception if the action is not priority attribute nsmsgpriorityvalue priority; // target folder.. throws an exception if the action is not move to folder attribute acstring targetfolderuri; // target label. ...
nsIMsgSearchNotify
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchnotify.idl [scriptable, uuid(ca37784d-352b-4c39-8ccb-0abc1a93f681)] interface nsimsgsearchnotify : nsisupports { void onsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); // notification that a search has finished. void onsearchdone(in nsresult status); /* * until we can encode searches with a uri, this will be an * out-of-bound way to connect a set of search terms to a datasource */ /* * called when a new search begins */ void onnewsearch(); }; ...
nsIMsgSearchScopeTerm
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchscopeterm.idl [scriptable, uuid(934672c3-9b8f-488a-935d-87b4023fa0be)] interface nsimsgsearchscopeterm : nsisupports { nsiinputstream getinputstream(in nsimsgdbhdr ahdr); void closeinputstream(); readonly attribute nsimsgfolder folder; readonly attribute nsimsgsearchsession searchsession; }; ...
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjun...
nsIMsgThread
the nsimsgfolder interface is used to interact with threads in thunderbird. ...
nsIMsgWindow
to create an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow. ...
nsIMsgWindowCommands
method overview void selectfolder(in acstring folderuri); void selectmessage(in acstring messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window. ...
nsINavHistoryResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this is the base class for all places history result nodes, containing the uri, title, and other general information. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description accesscount unsigned long total number of times the uri has been accessed. for hosts, this is the total number of the children under it, rather than the total number of times the host has been accessed (getting that information would require an additional query, so for performance reasons that information isn't given by default). read only. bookmarkindex long when this item is in a bookmark folder (its...
nsINavHistoryResultObserver
toolkit/components/places/nsinavhistoryservice.idlscriptable lets clients observe changes to a result as the result updates itself according to bookmark and history system events. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this interface replaced the older nsinavhistoryresultviewer interface, which only allowed one client at a time. method overview void batching(in boolean atogglemode); void containerclosed(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated...
nsINavHistoryResultViewObserver
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface is used by clients of the history results to define domain-specific handling of specific nsitreeview methods that the history result doesn't implement. ...
nsINavHistoryResultViewer
nts/places/public/nsinavhistoryservice.idlscriptable lets nsinavhistoryresult instances notify places views of changes in the results. removed in gecko 2.0 and replaced with the nsinavhistoryresultobserver interface, which is similar but allows multiple clients to observe the result at once. 1.0 66 introduced gecko 1.9 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: most methods in this interface were renamed in gecko 1.9.2, and others have slightl...
nsIOutputStreamCallback
xpcom/io/nsiasyncoutputstream.idlscriptable this is a companion interface for nsiasyncoutputstream.asyncwait. inherits from: nsisupports last changed in gecko 1.7 method overview void onoutputstreamready(in nsiasyncoutputstream astream); methods onoutputstreamready() called to indicate that the stream is either writable or closed. void onoutputstreamready( in nsiasyncoutputstream astream ); parameters astream the stream whose nsiasyncoutputstream.asyncwait() method was called. ...
nsIParentalControlsService
toolkit/components/parentalcontrols/public/nsiparentalcontrolsservice.idlscriptable this interface provides access to the operating system's parental controls feature, allowing code to detect whether such a service is enabled and to request overrides to bypass the feature. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: currently, this interface is only supported on microsoft windows vista and newer as well as android 4.3 and newer. implemented by: @mozilla.org/parental-controls-service;1. to create an instance, use: var parentalcontrolsservice = components.classes["@mozilla.org/parental-controls-service;1"] .createinstance(components.interfaces.nsiparentalcontrolsservice); ...
nsIPasswordManager
implemented by: @mozilla.org/passwordmanager;1. ...
nsIPermission
the nsipermission interface defines a "permission" object, which is used to allow or block objects (for example cookies, images) from certain sites based on user preferences. netwerk/base/public/nsipermission.idlscriptable please add a summary to this article. last changed in gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports attributes attribute type description capability pruint32 the permission to set: allow, deny, or unknown (which is the default). see nsipermissionmanager.permission_type_constants for allowed values. read only. expiretime print64 the expiration time of the permission measured in milliseconds since 1970 jan 1 0:00:00. read only. ...
nsIPermissionManager
the nsipermissionmanager interface is used to persistently store permissions for different object types (cookies, images, and so on) on a site-by-site basis. netwerk/base/nsipermissionmanager.idlscriptable please add a summary to this article. ...
nsIPrefLocalizedString
modules/libpref/public/nsipreflocalizedstring.idlscriptable this interface is simply a wrapper interface for nsisupportsstring so the preferences service can have a unique identifier to distinguish between requests for normal wide strings nsisupportsstring) and 'localized' wide strings, which get their default values from properites files. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring provides access to string data stored in this property. methods setdatawithlength() used to set the contents of th...
nsIPrefService
modules/libpref/public/nsiprefservice.idlscriptable this interface is the main entry point into the back end preferences management library. the preference service is directly responsible for the management of the preferences files and also facilitates access to the preference branch object which allows the direct manipulation of the preferences themselves. ...
nsIPrincipal
if there isn't one, this will return null. getting this attribute never throws. read only. certificateid string the fingerprint id of this principal's certificate. throws if there is no certificate associated with this principal. read only. obsolete since gecko 1.8 commonname string the common name for ...
nsIPrinterEnumerator
widget/nsiprintoptions.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void displaypropertiesdlg(in wstring aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out wstring aresult); obsolete since gecko 1.9 void initprintsettingsfromprinter(in wstring aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername wstring the name of the system default printer. this name should also be present in printernamelist. this is not necessarily gecko's default printer; see nsiprin...
nsIProcess
xpcom/threads/nsiprocess.idlscriptable this interface represents an executable process. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/process/util;1. to create an instance, use: var process = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess); method overview void init(in nsifile executable); void initwithpid(in unsigned long pid); obsolete since gecko 1.9.2 void kill(); void run(in boolean blocking, [array, size_is(count)] in string args, in unsigned long count); void runasync([array, size_is(count)] in string args, in unsigned long count, [optional] in nsiobserver observer, [optional]...
nsIProfile
profile/public/nsiprofile.idlunknown the profile manager is responsible for creating, maintaining, and organizing user profiles. this interface was superseded by the nsitoolkitprofileservice interface in gecko 1.8.1. 66 introduced gecko 0.9 deprecated gecko 1.8.1 obsolete gecko 20.0 inherits from: nsisupports last changed in gecko 1.6 implemented by: @mozilla.org/profile/manager;1. to get access to the profile manager service: var profile = components.classes["@mozilla.org/profile/manager;1"] .getservice(components.interfaces.nsiprofile); note: this interface was used by seamonkey up through seamonkey 1.1 versions, which were based off gecko 1.8.1. however, it hasn't been used in firefox since before firefox 1.0. method ov...
nsIProfileLock
read only. ...
nsIProfileUnlocker
profile/public/nsiprofileunlocker.idlscriptable returned by the nsitoolkitprofile.lock method; you can use this to attempt to force a profile to be unlocked. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void unlock(in unsigned long aseverity); constants constant value description attempt_quit 0 politely ask the process currently holding the profile's lock to quit. force_quit 1 forcibly terminate the process holding the profile lock. methods unlock() tries to unlock the profile by attempting or forcing the process that currently holds the lock to quit. void unlock( in unsigned long aseverity ); ...
nsIProgrammingLanguage
xpcom/base/nsiprogramminglanguage.idlscriptable this interface provides an enumeration of programming language identifiers. inherits from: nsisupports last changed in gecko 0.9.5 constants identifiers for programming languages. constant value description unknown 0 cplusplus 1 c++ javascript 2 javascript python 3 python perl 4 perl java 5 java zx81_basic 6 zx81 basic javascript2 7 javascript 2 ruby 8 ruby php 9 php tcl 10 tcl max 10 this will be kept at the largest index. ...
nsIPrompt
to avoid redundancy, all methods here link to nsipromptservice. ...
nsIPromptService
embedding/components/windowwatcher/public/nsipromptservice.idlscriptable this interface can be used to display simple dialogs. its methods should be used in privileged code instead of dom window.alert, window.confirm, and other similar functions. inherits from: nsisupports last changed in gecko 1.7.5 you can define access keys (or keyboard shortcuts) for buttons by including an ampersand ("&") in front of the character that should be the access key for that button. if you need to include an ampersand in the button's text, use two of them, like this: "&&". note: some of these interface methods use out and inout parameters. in c++, out parameters are pointers. for javascript, they are extra work, as you can't use an out parameter directly. you need to wrap them in a temporary ob...
nsIProperty
xpcom/ds/nsiproperty.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description name astring get the name of the property. read only. value nsivariant get the value of the property. read only. ...
nsIPropertyElement
xpcom/ds/nsipersistentproperties2.idlscriptable this interface provides access to individual entries within a stringbundle. inherits from: nsisupports last changed in gecko 1.0 attributes attribute type description key autf8string the key used to refer to this property. value astring the string value stored for this property. see also xul tutorial:property files ...
nsIProtocolProxyCallback
netwerk/base/public/nsiprotocolproxycallback.idlscriptable this interface serves as a closure for nsiprotocolproxyservice.asyncresolve(). 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onproxyavailable(in nsicancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus); methods onproxyavailable() this method is called when proxy info is available or when an error in the proxy resolution occurs. void onproxyavailable( in nsicancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus ); parameters arequest the value returned from asyncresolve. auri the u...
nsIProtocolProxyFilter
use nsiprotocolproxyservice.registerfilter() to hook up instances of this interface. ...
nsIPushMessage
this interface resembles pushmessagedata from the push api. method overview domstring text(); jsval json(); void binary([optional] out uint32_t datalen, [array, retval, size_is(datalen)] out uint8_t data); methods text() extracts the message data as a utf-8 text string. domstring text(); parameters none. ...
nsIPushService
dom/interfaces/push/nsipushservice.idlscriptable a service for components to subscribe and receive push messages from remote servers. inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) push lets a remote server send payloads to a web site, add-on, or component running in the browser. nsipushservice supports the push api implementation in firefox, and can be used directly from privileged code to create system subscriptions. implemented by @mozilla.org/push/service;1 as a service: const pushservice = components.classes["@mozilla.org/push/service;1"] .getservice(components.interfaces.nsipushservice); method overview void subscribe(in domstring scope, in nsiprincipal principal, in nsi...
nsIRadioInterfaceLayer
dom/system/gonk/nsiradiointerfacelayer.idlscriptable used to implement the interface between the telephony api and the radio hardware in a telephone. 1.0 66 introduced gecko 12.0 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: @mozilla.org/telephony/system-worker-manager;1. to create an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .getservice(components.interfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstrin...
nsIRandomGenerator
netwerk/base/public/nsirandomgenerator.idlscriptable interface used to generate random data. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void generaterandombytes(in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer); methods generaterandombytes() generates the specified amount of random bytes. void generaterandombytes( in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer ); parameters alength the length of the data to generate. abuffer a buffer that contains random bytes of size alength. ...
nsIRequest
netwerk/base/nsirequest.idlscriptable this interface is used by the request initiator to control the request. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsirequest argument to the nsistreamlistener on each onstartrequest, ondataavaliable, and onstoprequest invocation. method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request. bits 0-15 are reserved. when added to a load group, this request's load flags are merged with the load flags of the load grou...
nsIRunnable
*/ void run(); }; ...
nsISHistoryListener
the listener can prevent any action (except adding a new session history entry) from happening by returning false from the corresponding callback method. ...
nsISOCKSSocketInfo
netwerk/socket/nsisockssocketinfo.idlscriptable this interface provides information about a socks socket. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description destinationaddr prnetaddrptr the destination server address. native code only! externalproxyaddr prnetaddrptr the external (remote) proxy address. native code only! internalproxyaddr prnetaddrptr the internal (local) proxy address. native code only! ...
nsISSLSocketControl
void proxystartssl(); parameters none. ...
nsIScreenManager
widget/public/nsiscreenmanager.idlscriptable this interface lets you get information about the display screen (or screens) attached to the user's computer. 66 introduced gecko 0.9.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screenmanager = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreenmanager); method overview nsiscreen screenfornativewidget( in voidptr nativewidget ); native code only! nsiscreen screenforrect( in long left, in long top, in long width, in long height ); attributes attribute type description numberofscreens unsigned long the number of screens on the user's computer. read...
nsIScriptableInputStream
xpcom/io/nsiscriptableinputstream.idlscriptable this interface provides scriptable access to a nsiinputstream instance. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long available(); void close(); void init(in nsiinputstream ainputstream); string read(in unsigned long acount); acstring readbytes(in unsigned long acount); methods available() return the number of bytes currently available in the stream. note: this method should not be used to determine the total size of a stream, even if the stream corresponds to a local file. moreover, since a stream may make available more than 2^32 bytes of data, this method is incapable of expressing the entire size ...
nsIScriptableUnescapeHTML
parser/html/nsiscriptableunescapehtml.idlscriptable this interface is a utility interface that exposes the kind of markup parser behavior that the feed service needs. 1.0 66 introduced gecko 1.8 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: as of firefox 14, this interface is obsolete (but still available for compatibility with legacy extensions) and all its functionality is available with more configuration options via the nsiparserutils interface. implemented by: @mozilla.org/feed-unescapehtml;1 as a service: var scriptableunescapehtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscript...
nsIScrollable
this is a generic interface without concern for the type of content that may be inside. ...
nsISearchSubmission
netwerk/base/public/nsibrowsersearchservice.idlscriptable please add a summary to this article. 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) attributes attribute type description postdata nsiinputstream the post data associated with a search submission, wrapped in a mime input stream. may be null. read only. uri nsiuri the uri to submit a search to. read only. ...
nsISecurityCheckedComponent
two examples: code that has the "universalxpconnect" capability is allowed to access all of xpcom. this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them. ...
nsISeekableStream
ns_seek_cur 1 specifies that the offset is relative to the current position in the stream. ns_seek_end 2 specifies that the offset is relative to the end of the stream. methods seek() this method moves the stream offset of the stream implementing this interface. ...
nsISelection
implemented by: ?????????????????????????????????????. ...
nsISelection3
method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection. note that the parameters are case-insensitive. ...
nsISelectionImageService
layout/base/nsiselectionimageservice.idlnot scriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void getimage(in short selectionvalue, out imgicontainer container); void reset(); methods getimage() retrieve the image for alpha blending. void getimage( in short selectionvalue, out imgicontainer container ); parameters selectionvalue container reset() the current image is marked as invalid. void reset(); parameters none. ...
nsIServerSocket
the nsiserversocket interface implements a server socket that can accept incoming connections. netwerk/base/public/nsiserversocket.idlscriptable please add a summary to this article. last changed in gecko 1.6 inherits from: nsisupports implemented by: @mozilla.org/network/server-socket;1. to create an instance, use: var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only! void close(); void asynclisten(in nsiserversocketlistener alistener); prnetadd...
nsIServerSocketListener
connection. the transport is in the connected state, and read/write streams can be opened using the normal nsitransport api. the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. inherits from: nsisupports last changed in gecko 1.7 method overview void onsocketaccepted(in nsiserversocket aserv, in nsisockettransport atransport); void onstoplistening(in nsiserversocket aserv, in nsresult astatus); methods onsocketaccepted() this method is called when a client connection is accepted. void onsocketaccepted( in nsiserversocket aserv, in nsisockettransport atransport )...
nsISessionStartup
browser/components/sessionstore/nsisessionstartup.idlscriptable handles the session restore process. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/browser/sessionstartup;1. to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants. read only. state jsval the session state, as a javascript object. read only. note: prior to gec...
nsISessionStore
browser/components/sessionstore/nsisessionstore.idlscriptable provides a means for extensions and other code to store data in association with browser sessions, tabs, and windows. the api operates on top-level browser.xul and navigator.xul windows; see note on windows for details. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in versions of firefox prior to 3.5, the user preference browser.sessionstore.enabled must be true for these calls to be successful. starting in firefox 3.5, this preference is no longer used. method overview void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); ...
nsISimpleEnumerator
xpcom/ds/nsisimpleenumerator.idlscriptable this interface represents an enumeration of xpcom objects and provides methods to access elements sequentially. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsisupports getnext(); boolean hasmoreelements(); methods getnext() called to retrieve the next element in the enumerator. the "next" element is the first element upon the first call. must be preceded by a call to hasmoreelements() which returns pr_true. this method is generally called within a loop to iterate over the elements in the enumerator. nsisupports getnext(); parameters none. return value ns_ok if the call succeeded in returning a non-null value through the out parameter. ns_error_failure if there are no more elements to enumerate. hasm...
nsISmsDatabaseService
nsismsdatabaseservice dom/sms/interfaces/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsdatabaseservice;1. to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsdatabaseservice;1"] .createinstance(components.interfaces.nsismsdatabaseservice); method overview long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, ...
nsISmsRequestManager
nsismsrequestmanager dom/sms/interfaces/nsismsrequestmanager.idlscriptable used to manage sms related requests and notifications for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsrequestmanager;1. to create an instance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in n...
nsISocketProviderService
netwerk/socket/nsisocketproviderservice.idlscriptable provides a mapping between a socket type and its associated socket provider instance. one could also use the service manager directly. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 1.7 method overview nsisocketprovider getsocketprovider(in string sockettype); methods getsocketprovider() given a string representing a socket type, this method returns an nsisocketprovider representing that socket type. nsisocketprovider getsocketprovider( in string sockettype ); parameters sockettype the socket type for which to get a socket provider. return value nsisocketprovider that handles the specified socket type. see also nsisocketprovider nsiservicemanager ...
nsISpeculativeConnect
lic/nsispeculativeconnect.idlscriptable lets non-networking code provide hints to the networking layer that an http connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up tcp and, if appropriate, ssl handshakes to save time when the connection is actually opened later. 1.0 66 introduced gecko 15.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) to use this service, simply call nsisupports.queryinterface() on the nsiioservice you plan to use for the connection, to get access to the i/o service's implementation of nsispeculativeconnect. then call speculativeconnect() to let the networking layer know what you might be doing in the future. method overview ...
nsIStackFrame
filename string filename location. this is the location that caused the error, which may or may not be a source file location. for example, standard language errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing, and so forth. null indicates "no data" read only. language pruint32 see nsiprogramminglanguage for a list of language constants. ...
nsIStandardURL
inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. ...
nsIStringBundleOverride
to create an instance, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle/text-override;1"] .getservice(components.interfaces.nsistringbundleoverride); note: you should never need to use this service directly. ...
nsIStringBundleService
intl/strres/nsistringbundle.idlscriptable provides the string bundle service, which provides a way to fetch localized strings from a property file. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/stringbundle;1. to access this service, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice); method overview nsistringbundle createbundle(in string aurlspec); nsistringbundle createextensiblebundle(in string aregistrykey); void flushbundles(); wstring formatstatusmessage(in nsresult astatus, in wstring astatusarg); methods createbundle() nsistringbundle createbundle( in...
nsIStringEnumerator
the "next" element is the first string upon the first call. must be preceded by a call to hasmoreelements() which returns pr_true. this method is generally called within a loop to iterate over the strings in the enumerator. astring getnext(); parameters none. return value the next string in the enumerator. throws an exception if there are no more strings. ...
nsIStructuredCloneContainer
it is an error to initialize an nsistructuredclonecontainer more than once. ...
nsIStyleSheetService
allows extensions or embeddors to add to the built-in list of user or agent style sheets. layout/base/nsistylesheetservice.idlscriptable 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 implemented by: @mozilla.org/content/style-sheet-service;1. to create an instance, use: var stylesheetservice = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); method overview void loadandregistersheet(in nsiuri sheeturi, in unsigned long type); boolean sheetregistered(in nsiuri sheeturi, in unsigned long type); void unregistersheet(in nsiuri sheeturi, in unsigned long...
AddRef
...
Release
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
dataIID
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
data
...
toString
...
type
information is now located at: nsisupportsprimitive.constants ...
data
...
toString
...
data
...
toString
...
getWeakReference
...
nsISyncJPAKE
services/crypto/component/nsisyncjpake.idlscriptable please add a summary to this article. ...
nsITaggingService
toolkit/components/places/public/nsitaggingservice.idlscriptable provides methods to tag/untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/browser/tagging-service;1. to use this service, use: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); method overview void taguri(in nsiuri auri, in nsivariant atags); void untaguri(in nsiuri auri, in nsivariant atags); nsivariant geturisfortag(in astring atag); ...
nsITaskbarPreview
instead, you use nsitaskbartabpreview or nsitaskbarwindowpreview as appropriate. ...
nsITaskbarPreviewButton
widget/public/nsitaskbarpreviewbutton.idlscriptable this interface is used on microsoft windows to get access to a window preview's toolbar button properties. these buttons are displayed below the window preview. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) you can't directly instantiate this interface. instead, you use the nsitaskbarwindowpreview.getbutton() to get the objects representing the buttons. attributes attribute type description disabled boolean if true, the button is disabled. this is not the same as visible, which indicates whether or not the button should be displayed at all. dismissonclick boolean if true, the array of previews should be dismissed when ...
nsITaskbarTabPreview
widget/public/nsitaskbartabpreview.idlscriptable this interface is used on microsoft windows to control tab preview specific behavior. 1.0 66 introduced gecko 1.9.2 inherits from: nsitaskbarpreview last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) tab preview support is disabled by default in gecko 1.9.2 creating an nsitaskbartabpreview for a window will automatically hide that window's nsitaskbarwindowpreview; this is done by windows and cannot be prevented. when there are no more tab previews left for a window, the window preview is automatically made visible again. an application may have as many tab previews as memory allows. you can't directly instantiate this interface; instead, call the nsiwintaskbar.createtaskbartabpreview()...
nsITaskbarWindowPreview
if true, the nsitaskbarpreviewcontroller object's nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods will be called to draw the preview. if false, the operating system draws these for you. constants constant value description num_toolbar_buttons 7 the maximum number of toolbar buttons supported by the windows taskbar api. methods getbutton() returns the specified button from the preview's toolbar. note: by default, all buttons are hidden. you must fetch and configure each button that you want to make visible. nsitaskbarpreviewbutton getbutton( in unsigned long index ); parameters index the index into the button array for the nsitaskbarpreviewbutton to re...
nsITextInputProcessorCallback
this interface has a "function" attribute. therefore, js-ime can implement this as a function. ...
nsIThreadEventFilter
ine whether or not an event may be accepted by a nested event queue; see nsithreadinternal.pusheventqueue() for more information. you should implement this interface and its acceptevent() method, then pass the object implementing it as the filter. xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean acceptevent(in nsirunnable event);violates the xpcom interface guidelines methods violates the xpcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue. (see nsithreadinternal.pusheventqueue()) warning: this method must not make any calls on the thread ob...
nsIThreadInternal
thread corresponding to this thread object after all other events have been processed during a call to shutdown. methods popeventqueue() reverts a call to pusheventqueue(). when an event queue is popped, any events remaining in the queue are appended to the elder queue. void popeventqueue(); parameters none. pusheventqueue() causes any events currently enqueued on the thread to be suppressed until popeventqueue() is called. in addition, any new events dispatched to the thread are only processed if they are accepted by the specified filter. if the filter is null, all new events are accepted. calls to pusheventqueue() may be nested, and must each be paired with a corresponding call to popeventqueue() to restore the original state of the thread. void pusheventqueue( in nsith...
nsIThreadManager
the nsithreadmanager interface lets applications and extensions create and manage threads, each of which is represented by an nsithread. xpcom/threads/nsithreadmanager.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsithread getthreadfromprthread(in prthread prthread); native code only! nsithread newthread(in unsigned long creationflags); attributes attribute type description currentthread nsithread the currently executing thread. if the calling thread does not already have a nsithread associated with it, one is created and associate with the current prthread. read only. ismainthread boolean this attribute is true if the cal...
nsIThreadObserver
the nsithreadobserver interface may be implemented to let an observer implement a layered event queue. the implementation of this interface must be thread safe. xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void afterprocessnextevent(in nsithreadinternal thread, in unsigned long recursiondepth); void ondispatchedevent(in nsithreadinternal thread); void onprocessnextevent(in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth); methods afterprocessnextevent() called by the nsithread method nsithread.processnextevent() after an event is processed. this method is only called on the target thread. note:...
nsIThreadPool
1.0 66 introduced gecko 1.9 inherits from: nsieventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) a thread pool provides a convenient way to process events off the main thread. when you send events to the thread pool, the pool creates a new thread to process the event, up to the number of threads specified by the threadlimit attribute. ...
nsIThreadPoolListener
the nsithreadpoollistener interface represents objects that listen to notifications generated by the nsithreadpool. xpcom/threads/nsithreadpool.idlscriptable 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 onthreadcreated(); void onthreadshuttingdown(); methods onthreadcreated() called when a new thread is created by the thread pool. the notification happens on the newly created thread. void onthreadcreated(); parameters none. onthreadshuttingdown() called when a new thread is about to be destroyed by the thread pool. the notification happens on the thread that is about to be destroyed. void onthreadshuttingdown(); parameters none. see also the thread manager ...
nsITimer
e initialization methods. you may also re-initialize (using one of the initialization methods) an existing instance to avoid the overhead of destroying and creating a timer. it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a summary to this article. last changed in gecko 5 (firefox 5 / thunderbird 5 / seamonkey 2.2) inherits from: nsisupports implemented by: @mozilla.org/timer;1. to create an instance, use: var timer = components.classes["@mozilla.org/timer;1"] .createinstance(components.interfaces.nsitimer); users of instances of nsitimer should keep a reference to the timer until it is no longer needed in order to assure the timer is fired. method overview void cancel(); void init(in nsiobser...
nsITimerCallback
this version takes a function to call and a closure to pass to that function. ...
nsIToolkit
void init( in prthread athread ); parameters athread the thread passed in runs the message pump. ...
nsIToolkitProfile
method overview nsiprofilelock lock(out nsiprofileunlocker aunlocker); void remove(in boolean removefiles); attributes attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory. see nsiprofilelock.localdirectory(). read only. ...
nsIToolkitProfileService
toolkit/profile/public/nsitoolkitprofileservice.idlscriptable the profile service manages user profiles. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: starting in gecko 1.9.1, this service is implemented by @mozilla.org/toolkit/profile-service;1. to access the service, you can use the following code: var toolkitprofileservice = components.classes["@mozilla.org/toolkit/profile-service;1"] .createinstance(components.interfaces.nsitoolkitprofileservice); prior to gecko 1.9.1 only the built-in profile manager was able to access the toolkit profile service. to access the built-in profile manager in versions of firefox up to 4.0 and thunderbird up to 3.3 you can launch with the -profileman...
nsITransaction
this attribute is checked by the transaction manager after the transaction's execute() method is called. if the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undotransaction() and redotransaction() methods can be called. ...
nsITransactionList
read only. methods getchildlistforitem() returns the list of children associated with the item at aindex. implementations may return null if there are no children, or an empty list. ...
nsITransactionListener
editor/txmgr/idl/nsitransactionlistener.idlscriptable this interface is implemented by an object that tracks transactions. ...
nsITransactionManager
editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/track transactions. ...
nsITransportEventSink
void ontransportstatus( in nsitransport atransport, in nsresult astatus, in unsigned long long aprogress, in unsigned long long aprogressmax ); parameters atransport the transport sending this status notification. ...
nsITransportSecurityInfo
read only. securitystate unsigned long a flag detailing the security state of the connection. ...
nsITreeColumn
read only. ...
nsITreeColumns
the nsitreecolumns interface represents the tree columns. layout/xul/base/src/tree/public/nsitreecolumns.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns. read only. length long an alias for count (for the benefit of scripts which treat this as an arra...
nsITreeContentView
the nsitreecontentview interface is implemented by tree views that are backed by dom content. it is typically reached by calling queryinterface on a nsitreeview. layout/xul/base/src/tree/public/nsitreecontentview.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the specified content item. long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the ro...
nsIURIFixup
docshell/base/nsiurifixup.idlscriptable interface implemented by objects capable of fixing up strings into uris. ...
nsIURIFixupInfo
preferreduri nsiuri best guess of what uri consumer expects. may be null if we can't deliver (eg. the input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed). read only. fixeduri nsiuri the fixed-up original input, *never* using a keyword search. (may be null if the original input was broken as a url, e.g. ...
nsIURLFormatter
toolkit/components/urlformatter/public/nsiurlformatter.idlscriptable this interface exposes methods to substitute variables in url formats. 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) variable names can contain 'a-z' letters and '_' characters. mozilla applications linking to mozilla websites are strongly encouraged to use urls of the following format: http[s]://%service%.mozilla.[com|org]/%locale%/ method overview astring formaturl(in astring aformat); astring formaturlpref(in astring apref); methods formaturl() formats a string url. the set of known variables is predefined. if a variable is unknown, it is left unchanged and a non-fatal error is repor...
nsIUTF8ConverterService
if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8. ...
nsIUTF8StringEnumerator
the "next" element is the first string upon the first call. must be preceded by a call to hasmore(), which returns pr_true. this method is generally called within a loop to iterate over the strings in the enumerator. autf8string getnext(); parameters none. ...
nsIUUIDGenerator
xpcom/base/nsiuuidgenerator.idlscriptable this interface can be used to generate an id that can be considered globally unique, often referred to as a uuid or guid. 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/uuid-generator; as a service: var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); method overview nsidptr generateuuid(); void generateuuidinplace(in nsnonconstidptr id); native code only! methods generateuuid() obtains a new uuid using appropriate platform-specific methods to obtain a nsid that can be considered to be globally unique. nsidptr ...
nsIUpdateCheckListener
toolkit/mozapps/update/nsiupdateservice.idlscriptable an interface describing an object that listens to the progress of an update check operation. this object is notified as the check continues, finishes and if it has an error. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void oncheckcomplete(in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed. void oncheckcomp...
nsIUpdateChecker
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that knows how to check for software updates. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method ind...
nsIUpdateManager
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that maintains a list of previously installed updates, as well as the currently in use update. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the s...
nsIUpdatePatch
toolkit/mozapps/update/nsiupdateservice.idlscriptable an interface that describes an object representing a patch file that can be downloaded and applied to a version of this application so that it can be updated. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsidomelement serialize(in nsidomdocument updates); attributes attribute type description finalurl astring the final url this patch was being downloaded from. hashfunction astring the hash function to use when determining the integrity of the patch file. hashvalue astring the value of the hash function named in hashfunction that should be computed if the file is not corrupt. selected bo...
nsIUpdatePrompt
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that can be used to show various update-related notifications to the user. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates. void checkforupdates(); parameters none. showupdateavailable() show...
nsIUpdateTimerManager
toolkit/mozapps/update/nsiupdatetimermanager.idlscriptable this interface provides a global application service that provides support for long-duration timers (on the order of many days, weeks, or even months). these timers are used to schedule update checks in the future, for example. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registertimer(in astring id, in nsitimercallback callback, in unsigned long interval); methods registertimer() presents a user interface that checks for and displays the available updates. void registertimer( in astring id, in nsitimercallback callback, in unsigned long interval ); parameters ...
nsIUploadChannel2
netwerk/base/public/nsiuploadchannel2.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void explicitsetuploadstream(in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values. most implementations of this interface require that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek(). void explicitsetuploadstream( in ns...
nsIUrlListManagerCallback
toolkit/components/url-classifier/public/nsiurllistmanager.idlscriptable interface for a class that manages updates of the url classifier database. ...
nsIUserCertPicker
security/manager/ssl/public/nsiusercertpicker.idlscriptable please add a summary to this article. ...
nsIVersionComparator
a version-part consists of up to four parts, all of which are optional: <number-a><string-b><number-c><string-d (everything else)> a version-part may also consist of a single asterisk "*" which indicates * "infinity". numbers are base-10, and are zero if left out. strings are compared bytewise. ...
nsIWebBrowserChrome
embedding/browser/webbrowser/nsiwebbrowserchrome.idlscriptable corresponds to the top-level, outermost window containing an embedded gecko web browser. inherits from: nsisupports last changed in gecko 0.9.6 method overview void destroybrowserwindow(); void exitmodaleventloop(in nsresult astatus); boolean iswindowmodal(); void setstatus(in unsigned long statustype, in wstring status); void showasmodal(); void sizebrowserto(in long acx, in long acy); attributes attribute type description chromeflags unsigned long the chrome flags for this browser chrome. the implementation should reflect the value of this attribute by hiding or showing its chrome appropriately. webbrowser nsiweb...
nsIWebBrowserChromeFocus
embedding/browser/webbrowser/nsiwebbrowserchromefocus.idlscriptable implemented by the same object as nsiembeddingsitewindow. it represents the focus up-calls from mozilla to the embedding chrome. inherits from: nsisupports last changed in gecko 1.7 method overview void focusnextelement(); void focusprevelement(); methods focusnextelement() set the focus at the next focusable element in the chrome. void focusnextelement(); parameters none. focusprevelement() set the focus at the previous focusable element in the chrome. void focusprevelement(); parameters none. see also see bug 70224 for gratuitous information. ...
nsIWebBrowserFind
by default, the implementation will search the focused frame, or if there is no focused frame, the web browser content area. it does not by default search subframes or iframes. to change this behavior, and to explicitly set the frame to search, queryinterface to nsiwebbrowserfindinframes. ...
nsIWebBrowserFindInFrames
attributes attribute type description currentsearchframe nsidomwindow frame at which to start the search. once the search is done, this will be set to be the last frame searched, whether or not a result was found. has to be equal to or contained within the rootsearchframe. ...
nsIWebContentHandlerRegistrar
xpfe/appshell/public/nsiwebcontenthandlerregistrar.idlscriptable applications wishing to use web content handlers need to implement this interface. typically they will prompt the user to confirm adding an entry to the local list. ...
nsIWebNavigation
docshell/base/nsiwebnavigation.idlscriptable defines an interface for navigating the web. it provides methods and attributes to direct an object to navigate to a new location, stop or restart an in process load, or determine where the object has previously gone. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is implemented by the following components: * @mozilla.org/browser/shistory-internal;1 * @mozilla.org/browser/shistory;1 * @mozilla.org/embedding/browser/nswebbrowser;1 * @mozilla.org/docshell;1 gecko 1.9.2 note in gecko 1.9.2 (firefox 3.6), the @mozilla.org/webshell;1 component no longer exists; you need to use @mozilla.org/docshell;1 instead. method overview void goback void goforward void gotoind...
nsIWebProgressListener2
schange64() notification that the progress has changed for one of the requests associated with awebprogress. progress totals are reset to zero when all requests in awebprogress complete (corresponding to onstatechange being called with astateflags including the state_stop and state_is_window flags). this function is identical to nsiwebprogresslistener.onprogresschange(), except that this function supports 64-bit values. note: if any progress value is unknown, then its value is replaced with -1. void onprogresschange64( in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress ); parameters awebprogress the nsiwebprogress instance that fired the notification.
nsIWifiAccessPoint
this string is in the format "xx-xx-xx-xx-xx-xx". read only. rawssid acstring the public name of the wireless network, as an ascii string. this string is null if not available. read only. ...
nsIWifiListener
netwerk/wifi/nsiwifilistener.idlscriptable this interface is implemented by clients interested in receiving notifications when the list of available wifi access points changes. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void onchange([array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen); void onerror(in long error); methods onchange() called when the list of available access points changes. void onchange( [array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen ); parameters accesspoints an array of nsiwifiaccesspoint objects representing all currently-available wifi access points. alen the...
nsIWifiMonitor
netwerk/wifi/nsiwifimonitor.idlscriptable this interface can be used to be alerted when the list of available wifi access points changes. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) this is used, for example, by geolocation to use wifi access points for location detection. implemented by @mozilla.org/wifi/monitor;1 as a service: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getservice(components.interfaces.nsiwifimonitor); method overview void startwatching(in nsiwifilistener alistener); void stopwatching(in nsiwifilistener alistener); methods startwatching() starts listening for changes to the wifi access point list. void...
nsIWinAccessNode
accessible/public/msaa/nsiwinaccessnode.idlnot scriptable please add a summary to this article. ...
nsIWindowCreator
embedding/base/nsiwindowcreator.idlscriptable a callback interface used by gecko to create new browser windows. the application, either mozilla or an embedding app, must provide an implementation of the window watcher component and notify the windowwatcher during application initialization. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsiwebbrowserchrome createchromewindow(in nsiwebbrowserchrome parent, in pruint32 chromeflags); methods createchromewindow() create a new window. gecko will/may call this method, if made available to it, to create new windows. nsiwebbrowserchrome createchromewindow( in nsiwebbrowserchrome parent, in pruint32 chromeflags ); parameters parent the nsiwebbrowserchrome of the parent window, if any. null if no pare...
nsIWindowMediator
xpfe/appshell/public/nsiwindowmediator.idlscriptable the window mediator is a mozilla component that keeps track of open windows. inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the two most common uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type. implemented by: @mozilla.org/appshell/window-mediator;1 as a service: var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); method overview void addlistener(in nsiwindowmediatorlistener alistener); boolean calculatezposition(in nsixulwindow inwindow, in unsigned long inposition, ...
nsIWorkerFactory
you don't need to use it anymore to create workers from chrome. instead, you can just do new worker or new chromeworker. implemented by: threads/workerfactory;1. ...
nsIWorkerGlobalScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface is an abstract interface representing the 'inside' of a worker. this interface allows a worker to look up information about itself, as well as to control itself. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description location nsiworkerlocation read only. navigator nsiworkernavigator read only. onerror nsidomeventlistener self nsiworkerglobalscope returns the global scope object itself. read only. see also using web workers nsiworkermessageport nsiworkermessageevent nsiworkerscope nsiabstractworker nsiworker ...
nsIWorkerMessagePort
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void postmessage(in domstring amessage); methods postmessage() posts a message into the event queue. void postmessage( in domstring amessage ); parameters amessage the message to post. see also using web workers nsiworkermessageevent nsiworkerglobalscope nsiworkerscope nsiabstractworker nsiworker ...
nsIXFormsModelElement
extensions/xforms/nsixformsmodelelement.idlscriptable defines scriptable methods for manipulating instance data and updating computed and displayed values. 1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. rebuild() signals ...
nsIXFormsNSInstanceElement
sixformsnsinstanceelement is implemented by all xforms <instance/> elements, defining mozilla extensions. extensions/xforms/nsixformsnsinstanceelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)] interface nsixformsnsinstanceelement : nsisupports { nsidomdocument getinstancedocument(); }; methods getinstancedocument nsidomdocument getinstancedocument(); getinstancedocument returns a dom document that corresponds to the instance data associated with the instance element. essentially it is just a shortcut to nsixformsmodelelement::getinstancedocument() for the given instance element. related interfaces nsixformsmodelelement exam...
nsIXFormsNSModelElement
lemented by all xforms <model/> elements. it defines mozilla extensions to the nsixformsmodelelement interface. extensions/xforms/nsixformsnsmodelelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(85fd60c7-1db7-40c0-ae8d-f723fdd1eea8)] interface nsixformsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names. related interfaces nsixformsmodelelement example code none. ...
nsIXMLHttpRequest
d_anonymous is added, this strips all user data (cookies, tokens, etc). using event handlers from native code (not sure if it's up-to-date) from native code, the way to set up onload and onerror handlers is a bit different. here is a comment from johnny stenback <jst@netscape.com>: the mozilla implementation of nsixmlhttprequest implements the interface nsidomeventtarget and that's how you're supported to add event listeners. try something like this: nscomptr<nsidomeventtarget> target(do_queryinterface(myxmlhttpreq)); target->addeventlistener(ns_literal_string("load"), mylistener, pr_false) where mylistener is your event listener object that implements the interface nsidomeventlistener. the 'onload', 'onerror', and 'onreadystatechange' attributes moved to nsijsxmlhttprequest, but if you'r...
nsIXSLTProcessor
content/xslt/public/nsixsltprocessor.idlscriptable xslt processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-transformer;1?type=xslt. to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); ...
nsIXULAppInfo
xpcom/system/nsixulappinfo.idlscriptable this interface provides information about the host application. it can be used to distinguish between different mozilla-based applications. it provides application name, application version, gecko version and more. 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) in xulrunner applications nsixulappinfo obtains app-specific information from application.ini. implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info". it contains ad...
nsIXULBrowserWindow
xpfe/appshell/public/nsixulbrowserwindow.idlscriptable provides methods that may be called from the internals of the browser area to tell the containing xul window to update its user interface. 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 javascript code. note: the xulbrowserwindow object offered to javascript code provides a great many more methods and attributes than those listed here, which are only the ones available to c++ code. see the documentation for xulbrowserwindow for details. method overview astring onbefore...
nsIXULRuntime
xpcom/system/nsixulruntime.idlscriptable provides information about the xul runtime to allow extensions and xul applications to determine information about the xul runtime. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/xre/app-info;1. to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running. read only. browsertabsremoteautos...
nsIXULSortService
content/xul/templates/public/nsixulsortservice.idlscriptable 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 sortstateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only! obsolete since gecko 1.9 void sort(in nsidomnode anode, in astring asortkey, in astring asorthints); constants constant value description sort_comparecase 0x0001 sort_integer 0x0100 methods native code only!insertcontainernode obsolete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work i...
nsIXmlRpcFault
lete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable an xml-rpc exception. xml-rpc server fault codes are returned wrapped in this; access it using nsixpconnect.getpendingexception->data. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only. faultstring string read only. methods init() void getdata( in print32 faultcode, in...
nsIZipReaderCache
modules/libjar/nsizipreader.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) implemented by: @mozilla.org/libjar/zip-reader-cache;1. to create an instance, use: var zipreadercache = components.classes["@mozilla.org/libjar/zip-reader-cache;1"] .createinstance(components.interfaces.nsizipreadercache); method overview nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizi...
nsPIPromptService
this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++. the indexes for getstring() and setstring() are: emsg the value is 0. this is the message text of the dialog. echeckboxmsg the value is 1. ...
NS_IF_RELEASE
his page still needs some work, help to improve it! summary macro decrements the reference count of a pointer by one. ...
nsIMsgSearchValue
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl #include "nsmsgsearchcore.idl" interface nsimsgfolder; [scriptable, uuid(783758a0-cdb5-11dc-95ff-0800200c9a66)] interface nsimsgsearchvalue : nsisupports { // type of object attribute nsmsgsearchattribvalue attrib; // accessing these will throw an exception if the above // attribute does not match the type! attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunk...
Warnings
atement. this happens when you have an order by clause that does not use an index. when you do not use an index, all the results from the query have to first be fetched, and then those results are sorted. however, when the index is used, the data can be obtained row by row from the database, which will be much faster. if, for some reason you cannot use an index in your order by clause, you can suppress this warning by including a sql comment in your query that contains this text: /* do not warn (bug [everything in these brackets does not matter] */ the bug mentioned should explain why the query cannot use an index. ...
Frequently Asked Questions
ce. comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports macro. for example, the assertion occurs when you convert the pointer to the object to a raw pointer to that interface, then assign the raw pointer to another nscomptr for that interface. ns_precondition "you can't dereference a null nscomptr with operator->()" ns_precondition "you can't dereference a null nscomptr with operator*()" other issues printf...
Status, Recent Changes, and Plans
will be easy. recent changes to nscomptr most recent first made == and != between an nscomptr and a raw pointer (or a literal 0 or nsnull) work correctly on all compilers. see bug 65664. made getter_addrefs( nscomptr& ) apply the same type-safety check that the simple assignment forms do. added do_createinstance. added do_getservice. eliminated the need to cast getter_addrefs when an nsisupports** is needed. relaxed the invariant for nscomptr<nsisupports>, so that it is now a pointer to any xpcom interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addrefed as a function result. bug 59414: making operator& private may help prevent some leaks caused by casting ...
Using nsIDirectoryService
nstead of the profile service, thus saving some footprint. customizing locations although you can change locations one at a time by using the nsiproperties interface of nsdirectoryservice, you can also install your own nsidirectoryserviceprovider to control them en masse. to do this for application-level locations, create a provider based on appfilelocprovider. this object has to implement the nsisupports and nsidirectoryserviceprovider interfaces. it does not need to be a component - it can be a static lib, a source file in your project - whatever. just construct it, pass it to ns_initembedding, and it will be installed. if you are not using ns_initembedding, you will have to construct it and register it yourself using nsidirectoryservice.registerprovider(). if you are registering it yoursel...
Using the Gecko SDK
nventions of the virtual methods may vary from compiler to compiler). the gecko abi is therefore compiler sensitive. (<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, we'll assume you are developing components under linux. (ports of this guide are welcome.) a "frozen" interface or function is guaranteed to be supported by future versions of same major version of the platform. the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries. when those classes or functions are used, the component must link with the corresponding static library. every frozen interface or function will be labeled as such in the idl o...
Working with Multiple Versions of Interfaces
ach worked, as is, for versions as early as firefox 1.5. the problem arises when one tries to run an extension built with the latest sdk in an older version of firefox, say firefox 2. what happens is that the call to do_createinstance fails with nsresult ns_error_no_interface. this is because the call to do_createinstance(acid, aouter, error); will eventually evolve into a request for an object supporting the interface with iid ns_get_iid(nsiaccessibleretrieval). unfortunately we compiled this in the latest sdk, and so this magic number happens to be: "244e4c67-a1d3-44f2-9cab-cdaa31b68046" whereas, inside firefox 2, the iid it happens to know about is: "663ca4a8-d219-4000-925d-d8f66406b626". and this explains our ns_error_no_interface. fortunately there is a plan of action that we can ...
Working with out parameters
} the gettransferdata method takes three parameters, aflavor, adata, and adatalen, and returns nothing. adata and adatalen are marked as out, meaning that they act as "return values" for this method, and are changed during the method call. these are so-called out parameters. ...
XPCOM category image-sniffing-services
...
XPCOM
gecko is created. if the component uses only "frozen" xpcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example). the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. 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 javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom.fun with xbl and xpconnectgenerating guidsguids are used in mozilla programming for identifyi...
XTF
Mozilla › Tech › XTF
documentation xtf readme the xtf readme. xtf home the xtf home (outdated). xtf: when xbl just won't cut it more recent primer to xtf by alex vincent. extending gecko with xbl and xtf a presentation given at xtech 2005 comparing xbl and xtf, as well as discussing xtf basics. view all... ...
Address book sync client design
uuid(91fdfee1-efbc-11d3-8f97-000073757374)] interface nsiabsyncdriver : nsiabsynclistener { void kickit(); }; as you can see, this is a very simple interface which allows for the starting of the address book sync operation. the interface of greater interest is the address book sync listener. this provides feedback of the current sync operation. this interface is as follows: #include "nsisupports.idl" #include "nsrootidl.idl" #include "nsifilespec.idl" [scriptable, uuid(e0ed29e0-098a-11d4-8fd6-00a024a7d144)] interface nsiabsynclistener : nsisupports { /** * notify the observer that the ab sync authorization operation has begun. * */ void onstartauthoperation(); /** * notify the observer that the ab sync operation has been completed. * ...
nsIMsgCloudFileProvider
nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. ...
Filelink Providers
nsimsgcloudfileprovider note: cloudfiles and bigfiles were the two temporary feature names that were used while filelink was under construction. both refer to the filelink feature. filelink storage providers must implement the nsimsgcloudfileprovider interface. the hightail implementation is a great place to look for examples and inspiration. ...
Mailnews and Mail code review requirements
be reviewed by one of the listed sub-module owner/reviewers. peers may grant review in any area covered by mailnews/, provided they feel confident in their knowledge of the code being changed. sub-module peers may only grant review in the listed sub-module. if a reviewer feels that the patch would benefit from additional reviews, they should request a second review from an appropriate person. super-review is required in certain situations: significant architectural refactoring, any change to any api, all changes that affect how code modules interact. see the full super-review policy for more details. unit test rules patches are required to include automated tests which are run during make check or via mozmill in thunderbird, but submitters are encouraged to request exceptions from re...
Spam filtering
appens after filters are run. white listing happens after filters, but before spam detection. the purge code is implemented as a search of the "junk" folder, looking for "old" message that have the proper junk status. when does purging happens? elaborate on the mime changes that were made for spam. currently, spam filtering is does not work for news, but it would be possible to add support for this. (there is a bug on it.). initial state user action table changes unknown (user can't see this, looks like "not junk") mark as junk add tokens to bad unknown (user can't see this, looks like "not junk") mark as not junk add tokens to good not junk mark as junk remove tokens from good, add tokens to bad not junk ...
Building a Thunderbird extension 5: XUL
des the elements of the user interface, actions are written in javascript. for our first extension, we will add some text to the thunderbird status bar. the status bar is implemented in a xul file called messenger.xul, which can be found in the chrome/messenger/content/messenger folder which is packaged inside the omni.ja archive. to view this xul file use the dom inspector extension (no longer supported) or look inside the omni.ja archive, which is located in the thunderbird program folder. omni.ja can be easily browsed by copying the file to a different location and renaming it to omni.zip. if you have trouble with one zip manager (like 7zip) try another (like winrar). in messenger.xul we find the status bar, which looks something like this.: <statusbar id="status-bar" ...> ... <statusb...
Theme Packaging
--> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>0.8</em:minversion> <em:maxversion>0.9</em:maxversion> </description> </em:targetapplication> <!-- front end metadata --> <em:name>new theme 1</em:name> <em:description>a test theme for thunderbird</em:description> ...
Using the Multiple Accounts API
didentity(identity); that's it! now you have a working account, identity, and server. it is possible, through some tricks with server and identity keys, to share servers and identities between accounts. you can do this by referring to the same identity or server key in the preferences, or with clever calls to the account manager. (left as an exercise for the reader.)this will work but it is not supported. the ui will act slighty strange when you share information between accounts. the current plans prevent sharing of information between accounts using the ui. relevant api calls: nsimsgaccount nsimsgaccountmanager.createaccount() nsimsgaccount nsimsgaccountmanager.getaccount(in string key) nsimsgincomingserver nsimsgaccountmanager.createincomingserver(in string type) nsimsginco...
libmime content type handlers
type prefixed by the * following: mimecth:text/vcard * * libmime will then use nscomponentmanager::contractidtoclsid() to * locate the appropriate content type handler */ #ifndef nsimimecontenttypehandler_h_ #define nsimimecontenttypehandler_h_ typedef struct { prbool force_inline_display; } contenttypehandlerinitstruct; #include "prtypes.h" #include "nsisupports.h" #include "mimecth.h" // {20dabd99-f8b5-11d2-8ee0-00a024a7d144} #define ns_imime_content_type_handler_iid \ { 0x20dabd99, 0xf8b5, 0x11d2, \ { 0x8e, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } } class nsimimecontenttypehandler : public nsisupports { public: static const nsiid& getiid() { static nsiid iid = ns_imime_content_type_handler_iid; return iid; } ns_imethod ...
XPI
themes, and thunderbird dictionaries. an xpi contains installation instructions (install.js or install.rdf) as well as the actual software to install, which is often itself packaged as a jar file. when downloaded or dropped into an extension manager, xpinstall automatically interacts with the installation instructions contained in the xpi, and installs the contained software. xpi archives only support files stored uncompressed or compressed using the "deflate" method. note: starting in gecko 2.0, xpi files are no longer unpacked when extensions are installed. instead, the xpi itself is placed in the extensions directory, and files are loaded directly out of the package. see updating extensions for firefox 4 for details. when xpi files are served via http, the application/x-xpinstall mi...
Examples
nstrates javascript-cocoa bridge for mac os x. lightweight bridge for calling cocoa frameworks from javascript, 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 javascript code, js-macosx will replace it with the corresponding js-ctypes declaration based on the bridgesupport file from the framework that object belongs to. ...
Declaring types
isn't a way to specify that an array's c equivalent was declared as a packed structure; that is, using #pragma pack. field descriptors each field descriptor is comprised of a field name and its data type, represented as a string and a ctype object, respectively. the format, then, looks like this: [ { field1: type1 }, { field2: type2 }, ... ...
Working with data
r that reason, 64-bit and pointer-sized c values of numeric types don't get automatically converted to javascript numbers. instead, they're converted to javascript objects that you can manipulate using the methods provided by the int64 and uint64 objects. note: these 64-bit integer types are intentionally low on features, so that when javascript adds a "big number" type, we can easily upgrade to support that properly. creating 64-bit integer objects to create a new 64-bit number object, use the ctypes.int64.int64() method to create a new 64-bit signed integer, or the ctypes.uint64.uint64() method to create a new unsigned 64-bit integer. for example: var num1 = ctypes.uint64(5000); var num2 = ctypes.int64(-42); if you need to create a 64-bit integer whose value can't be represented by a ...
Using js-ctypes
.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library. note: js-ctypes only works with c libraries; you can't use c++ methods directly. instead, you'll need to create a shim library that uses c functions that then call into the c++ library for you. examples can be found here: bugzilla :: bug 505907 - support c++ calling from jsctypes library search paths if you specify a full path, that path is used to load the library. otherwise, the system looks for the library in its standard locations. windows on windows, the following locations are searched for the library, in this order: the application's directory. the system directory. the 16-bit system directory. the windows directory. the cur...
CType
about them, and so forth. the specific properties and methods on each object vary depending on the data type represented. there are several kinds of types: primitive types these are typical unstructured data, such as the predefined types listed in predefined data types. big integer types the int64 and uint64 types provide access to 64-bit integer values, which javascript doesn't currently support. pointertype these represent pointers to data in memory. functiontype these represent callable c functions. structtype these represent c structures. arraytype these represent c arrays. method overview methods available on all ctype objects ctype array([n]) string tosource() string tostring() properties properties of all ctype objects these prope...
Int64
you use the int64 object to create and manipulate 64-bit signed integers. note: it's important to note that the 64-bit integer objects created by int64 are not int64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the int64 object. see 64-bit integers for details. syntax creates and returns a new 64-bit signed integer. int64 int64( value ); parameters value the value to assign the new 64-bit integer object. ...
Library
he declared api. exceptions thrown ctypes ctype functiontype abi typeerror the return type was specified as an array. alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries. the syntax for this is seen in firefox codebase here: //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 this shows that we can also supply only two arguments to the declare function. the first being the same as in the above example, name, which is the name of the symbol to export. and in place of the abi argument, we will pass in the type of this export. for example, from the objective-c library we can export the symbol which holds the address to an external block. this would be done like this: var objc = ctypes.open(ctypes.libr...
UInt64
you use the uint64 object to create and manipulate 64-bit unsigned integers. note: it's important to note that the 64-bit integer objects created by uint64 are not uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the uint64 object. see 64-bit integers for details. syntax creates and returns a new 64-bit unsigned integer. uint64 uint64( value ); parameters value the value to assign the new 64-bit unsigned integer object. ...
js-ctypes
other work made possible by js-ctypes is jni, this is elaborated on in the jni.jsm section and not the js-ctypes section due to the jsm abstracting away all of the js-ctypes. unlike binary xpcom components, it allows developers to ship a single binary for use with multiple versions of firefox. note: js-ctypes is only available from chrome code; that is, ctypes is not available to websites, only application and extension code. ...
Browser Side Plug-in API - Plugins
om the browser. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for ...
Constants - Plugins
9 liveconnect (win16). npvers_68k_has_liveconnect 11 liveconnect (68k). npvers_has_windowless 11 windowless plug-in. npvers_has_xpconnect_scripting 13 plug-in is scriptable using xpconnect. npvers_has_npruntime_scripting 14 plug-in is scriptable using npruntime. npvers_has_form_values 15 nppvformvalue nppvariables are supported. npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported. npvers_has_response_headers 17 npstreams have response headers for http streams. npvers_has_npobject_enum 18 the npclass in question has an enumerate field, which lets you enumerate the properties of an npobject of that cl...
Memory - Plugins
ll the request. for communicator 4.0 and later versions, this function is not necessary for the mac os platform; npn_memalloc now performs memory flushing internally. you need to use npn_memflush only when it is not possible to call npn_memalloc, for example, when calling system methods that allocate memory indirectly. if npn_memalloc is called, calls to npn_memflush have no effect. for example, suppose that the plug-in calls newgworld, and that the call fails because of insufficient memory. the plug-in should try calling npn_memflush to free enough memory. if npn_memflush returns a value indicating that enough memory was freed, the plug-in can call newgworld again. calling npn_memflush is particularly important to systems with small amounts of ram and with virtual memory turned off. to req...
Plug-in Side Plug-in API - Plugins
rview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. plugin method summary npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for information. np_getvalue allows the browser to query the plug-in for information. npp_handleevent delivers a platform-specific window event to the instance. np_initialize provides global initialization for a plug-in. npp_new creates a new instance of a plug-in. npp_newstream notifies a plug-i...
Scripting plugins - Plugins
ension to the api has been developed that lets plugins be scriptable again, independent of java. this extension will also let plugins access the script objects in the browser, and is thus a much stronger and more flexible api.) the information in this section applies to firefox 1.0 and mozilla 1.7.5 and newer versions. how the dom handles scripting the mozilla dom code now checks if a plugin supports this new scriptability api and if it exposes a scriptable object through this new mechanism. mozilla does this by calling the old plugin api call npp_getvalue with the new enumeration value that has been added to the nppvariable enumeration. the new nppvariable enumeration is defined in npapi.h as: nppvpluginscriptablenpobject = 15 threading model this api is not designed to be thread s...
Gecko Plugin API Reference - Plugins
om the browser. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for the specified url. npn_geturlnotify requests creation of a new ...
Preferences System
" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for plat...
Introduction to DOM Inspector - Firefox Developer Tools
the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, or by using ctrl/cmd+shift+i in either application. dom inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own xulrunner app. dom inspector can serve as a sanity check to verify the state of the dom, or it can be used to manipulate the dom by hand, if desired. note: starting with firefox 3, the dom inspector is not included in firefox by default; instead, you must download and install it from the mozilla add-ons web site. (note: this is now a dead link.) when you first start the dom inspector, you are presented with a two-pane application ...
Inspecting web app manifests - Firefox Developer Tools
you also need to make sure the json inside the file is of the correct format. you can test this using the web manifest validator. inspecting your manifest if your manifest is deployed successfully, you should end up with a display like the following on the manifest view: from here, you can inspect all ...
Browser Console - Firefox Developer Tools
the browser console command line is disabled by default. to enable it set the devtools.chrome.enabled preference to true in about:config, or set the "enable chrome debugging" option in the developer tool settings. like the web console, the command line interpreter enables you to evaluate javascript expressions in real time:also like the web console's command line interpreter, this command line supports autocomplete, history, and various keyboard shortcuts and helper commands. if the result of a command is an object, you can click on the object to see its details. but while the web console executes code in the scope of the content window it's attached to, the browser console executes code in the scope of the chrome window of the browser. you can confirm this by evaluating window: this m...
Examine, modify, and watch variables - Firefox Developer Tools
if you need to use it, you can, for now, switch back to the old debugger by visiting about:config and setting the "devtools.debugger.new-debugger-frontend" preference to false. to see the docs for the old debugger, please visit debugger (before firefox 52). examine variables when the code has stopped at a breakpoint, you can examine its state in the variables pane of the debugger: variables are grouped by scope: in function scope you'll see the built-in arguments and this variables as well as local variables defined by the function like user and greeting. ...
Set event listener breakpoints - Firefox Developer Tools
matically break when the code hits an event handler. this article explains how to use it. using a standard event breakpoint to use an event breakpoint, you open up the javascript debugger, and find and expand the event listener breakpoints section in the right hand column. to break when event listeners are hit, check the boxes next the events you are interested in. all of the standard events supported in your version of firefox are listed, arranged by which api or api area they're part of. now when a keydown, keyup, keypress, or input event occurs, execution will pause as soon as it enters the listener code. when execution pauses, the source pane displays the highlighted line of the javascript code that is next to be executed, along with the surrounding code for context. in addition,...
Debugger - Firefox Developer Tools
ct, and hence not a proper debuggee value, throw a typeerror instead. static methods of the debugger object the functions described below are not called with a this value. iscompilableunit(source) given a string of source code, designated bysource, return false if the string might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until iscompilableunit is true, then pass it to the compiler. source metadata generated from file: js/src/doc/debugger/debugger.md watermark: sha256:03b36132885e046a5f213130ba22b1139b473770f7324b842483c09ab7665f7c changeset: e91b2c85aacd ...
Debugger-API - Firefox Developer Tools
res: setting a breakpoint in a page, running a handler function when it is hit that evaluates an expression in the page’s context. showing how many objects different call paths allocate. gecko-specific features while the debugger core api deals only with concepts common to any javascript implementation, it also includes some gecko-specific features: [global tracking][global] supports debugging all the code running in a gecko instance at once—the ‘chrome debugging’ model. [object wrapper][wrapper] functions help manipulate object references that cross privilege boundaries. source metadata generated from file: js/src/doc/debugger/debugger-api.md watermark: sha256:6ee2381145a0d2e53d2f798f3f682e82dd7ab0caa0ac4dd5e56601c2e49913a7 changeset: ffa775dd5bd4 ...
Debugger.Object - Firefox Developer Tools
handler calls receive the handler object itself as the this value. theframe argument is the current stack frame, whose code is about to perform the operation on the object being reported. if the method returns undefined, then spidermonkey makes the announced change to the object, and continues execution normally. if the method returns an object: if the object has a superseded property whose value is a true value, then spidermonkey does not make the announced change. if the object has a resume property, its value is taken as a resumption value, indicating how execution should proceed. (however, return resumption values are not supported.) if a given method is absent fromhandler, then events of that sort are ignored. the watchpoint consultshandl...
Inspecting web sockets - Firefox Developer Tools
time opcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the response pane. supported ws protocols the inspector currently supports the following web socket protocols: plain json socket.io sockjs signalr wamp the payload based on those protocols is parsed and displayed as an expandable tree for easy inspection, although you can of course still see the raw data (as sent over the wire) as well. ...
Network request details - Firefox Developer Tools
see https://en.wikipedia.org/wiki/special:centralautologin/p3p for more info.\"" }, { "name": "server", "value": "mw1316.eqiad.wmnet" }, { "name": "server-timing", "value": "cache;desc=\"pass\"" }, { "...
Network request list - Firefox Developer Tools
multipart request parameters --http/version if the http version is not 1.1 -i if the method is head -h one for each request header. if the "accept-encoding" header is present, the curl command includes --compressed instead of -h "accept-encoding: gzip, deflate". this means that the response will be automatically decompressed. --globoff suppresses curl's globbing (wildcard matching) feature if the copied url includes square bracket characters ([ or ]). (starting in firefox 76) managing har data the har format enables you to export detailed information about network requests. in addition to the copy and save menu items for har in the context menu, similar menu items are available in the har dropdown menu in the toolbar, as w...
Edit Shape Paths in CSS - Firefox Developer Tools
...
UI Tour - Firefox Developer Tools
ew shows you the complete computed css for the selected element (the computed values are the same as what getcomputedstyle would return.): compatibility view starting with firefox developer edition version 77, the compatibility view shows css compability issues, if any, for properties applied to the selected element, and for the current page as a whole. it shows icons for the browsers that do support the properties, and notes properties that are experimental or deprecated. click the name of the property to open the reference article for that property on mdn web docs. the "browser compatibility" section of the article gives details of browser support for the property. in the all issues section, click the name of the element that uses the property to select that element in the inspect...
Settings - Firefox Developer Tools
ayout panel enable the experimental layout panel. this setting only exists in firefox nightly. web console enable timestamps controls whether the web console displays timestamps. the web console defaults to hiding timestamps. enable new console frontend switch to the experimental new console. this setting only exists in firefox nightly. debugger enable source maps enable source map support in the debugger. enable new debugger frontend enable the new debugger. this setting only exists in firefox nightly. style editor show original sources when a css preprocessor supporting source maps is used, this enables the style editor to display the original, preprocessor, sources rather than the generated css. learn more about style editor support for css source maps. with this set...
Taking screenshots - Firefox Developer Tools
uld have a ".png" extension. --fullpage boolean if included, the full webpage will be saved. with this parameter, even the parts of the webpage which are outside the current bounds of the window will be included in the screenshot. when used, "-fullpage" will be appended to the file name. --selector string a css selector that selects a single element on the page. when supplied, only this element and its descendants will be included in the screenshot. note: if you capture an image to a filename like test.png, and then you capture to that same filename, the new image will overwrite the old image. so if you’re using the up-arrow history scroll to capture images in quick succession, be careful — you need to remember to change the filename for each new cap...
Toolbox - Firefox Developer Tools
here is an array of labeled buttons which enables you to switch between the different tools hosted by the toolbox. the array may include the following tools: web console javascript debugger page inspector style editor profiler network monitor note that not all the hosted tools are always listed here: only the tools actually available in this context are shown (for example, not all tools support remote debugging yet, so if the debugging target is not the firefox instance that launched the window, not all the hosted tools will be shown). extra tools next there's an array of buttons that can be added or removed in the developer tool settings. by default this array includes: toggle split console responsive design mode select a frame as the currently targeted document (this is onl...
Validators - Firefox Developer Tools
b development references. checky checky adds a submenu to your netscape or mozilla context menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis services. applications and services devedge web tune-up wizard this interface to w3c services guides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards. w3c html validator the w3c html validator will validate any web page according to the w3c html standards. it is very useful for detecting the use of proprietary html as well as invalid html. w3c css validator the w3c css validator will validate the css within any web page or external css files according to the w3c css st...
View Source - Firefox Developer Tools
ren't marked as errors. forbidden characters aren't reported as errors. errors related to the end-of-file aren't reported. tree builder errors relating to text (as opposed to tags, comments, or doctypes) aren't reported. parse errors related to xmlns attributes aren't reported. xml syntax highlighting view source uses the html tokenizer when highlighting xml source. while the tokenizer has support for processing instructions when highlighting xml source, that's the only xml-specific capability provided. because of this, doctypes that have an internal subset are not highlighted correctly, and entity references to custom entities are also not highlighted correctly. this mishighlighting can be seen by viewing the source of firefox chrome files (such as xul documents). however, this shoul...
ANGLE_instanced_arrays - Web APIs
ension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default and the constants and methods are available without the "angle" suffix. despite the name "angle", this extension works on any device if the hardware supports it and not just on windows when using the angle library. "angle" just indicates that this extension has been written by the angle library authors. constants this extension exposes one new constant, which can be used in the gl.getvertexattrib() method: ext.vertex_attrib_array_divisor_angle returns a glint describing the frequency divisor used for instanced rendering when used in the gl...
AbstractRange - Web APIs
't simply specify the offset to the first and last characters in the html. there are a few good reasons for that. first, after your page is loaded, the browser simply isn't thinking in terms of html. once it's been loaded, the page is a tree of dom node objects, so you need to specify the beginning and ending locations of a range in terms of nodes and positions within nodes. second, in order to support the mutability of the dom tree as much as possible, you need a way to represent positions relative to nodes in the tree, rather than simply global positions within the entire document. by defining points within the document as offsets within a given node, those positions remain consistent with the content even as nodes are added to, removed from, or moved around within the dom tree—within r...
AesGcmParams - Web APIs
properties name a domstring. this should be set to aes-gcm. ...
AmbientLightSensor.AmbientLightSensor() - Web APIs
bient light around the hosting device. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var ambientlightsensor = new ambientlightsensor(options) parameters options optional currently only one option is supported: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.onreading will be called. a whole number or decimal may be used, the latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. specifications specification sta...
Ambient Light Events - Web APIs
candidate recommendation initial definition ...
Animation.onfinish - Web APIs
the animation interface's onfinish property (from the web animations api) is the event handler for the finish event. this event is sent when the animation finishes playing. the finish event occurs when the animation completes naturally, as well as when the animation.finish() method is called to immediately cause the animation to finish up. the "paused" play state supersedes the "finished" play state; if the animation is both paused and finished, the "paused" state is the one that will be reported. you can force the animation into the "finished" state by setting its starttime to document.timeline.currenttime - (animation.currenttime * animation.playbackrate). syntax var finishhandler = animation.onfinish; animation.onfinish = finishhandler; value a function to be called to handle t...
Attr - Web APIs
Web › API › Attr
setattribute() instead. createattributens() use element.setattributens() instead. getattributenode() use element.getattribute() instead. getattributenodens() use element.getattributens() instead. hasattributes() obsolete since gecko 21.0 this method now always returns false. haschildnodes() this method now always returns false. insertbefore() modify the value of attr.value instead. issupported() you shouldn't have been using this in the first place, so you probably don't care that this is going away. isequalnode() you shouldn't have been using this in the first place, so you probably don't care that this is going away. normalize() you shouldn't have been using this in the first place, so you probably don't care that this is going away. removeattributenode() use element.rem...
AudioContextOptions.sampleRate - Web APIs
the audiocontextoptions dictionary (used when instantiating an audiocontext) may contain a property named samplerate, which indicates the sample rate to use for the new context. the value must be a floating-point value indicating the sample rate, in samples per second, for which to configure the new context; additionally, the value must be one which is supported by audiobuffer.samplerate. syntax audiocontextoptions.samplerate = 44100; var samplerate = audiocontextoptions.samplerate; value the desired sample rate for the audiocontext, specified in samples per second. the value must be compatible with audiobuffer.samplerate. this value should typically be between 8,000 hz and 96,000 hz; the default will vary depending on the output device, but the sample rate 44,100 hz is the most common.
AudioContextOptions - Web APIs
r a double-precision floating-point value indicating the preferred maximum latency of the context in seconds. the user agent may or may not choose to meet this request; check the value of audiocontext.baselatency to determine the true latency after creating the context. samplerate optional the samplerate to be used by the audiocontext, specified in samples per second. the value may be any value supported by audiobuffer. if not specified, the preferred sample rate for the context's output device is used by default. constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard value for a given type of audio usage: valu...
AudioListener.dopplerFactor - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.forwardX - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.forwardY - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.forwardZ - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.positionX - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.positionY - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.positionZ - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.setOrientation() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.setPosition() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.speedOfSound - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.upX - Web APIs
Web › API › AudioListener › upX
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.upY - Web APIs
Web › API › AudioListener › upY
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener.upZ - Web APIs
Web › API › AudioListener › upZ
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioListener - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
AudioNode - Web APIs
Web › API › AudioNode
be set individually. you can sub-class an audio node. while the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom properties and methods. slightly better performance: in both chrome and firefox, the factory methods call the constructors internally. keep in mind that microsoft edge does not yet appear to support the constructors; it will throw a "function expected" error when you use the constructors. brief history: the first version of the web audio spec only defined the factory methods. after a design review in october 2013, it was decided to add constructors because they have numerous benefits over factory methods. the constructors were added to the spec from august to october 2016. factory metho...
AudioTrack.id - Web APIs
Web › API › AudioTrack › id
the id property contains a string which uniquely identifies the track represented by the audiotrack. this id can be used with the audiotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one specified by a media element's audiotracks property. specifications specification status comment html living standardthe definition of 'audiotrack.id' in that specification. living standard html5the definition of '...
AudioTrack - Web APIs
boolean value which controls whether or not the audio track's sound is enabled. setting this value to false mutes the track's audio. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within an audio track list by calling audiotracklist.gettrackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, an audio commentary track for a movie might have a label of "commentary with director jo...
AudioTrackList.length - Web APIs
ck. example this snippet gets the number of audio tracks in the first <video> element found in the dom by queryselector(). var videoelem = document.queryselector("video"); var numaudiotracks = 0; if (videoelem.audiotracks) { numaudiotracks = videoelem.audiotracks.length; } note that this sample checks to be sure htmlmediaelement.audiotracks is defined, to avoid failing on browsers without support for audiotrack. specifications specification status comment html living standardthe definition of 'audiotracklist.length' in that specification. living standard html5the definition of 'audiotracklist.length' in that specification. recommendation ...
AudioWorklet - Web APIs
the worklet's code is run in the audioworkletglobalscope global execution context, using a separate web audio thread which is shared by the worklet and other audio nodes. access the audio context's instance of audioworklet through the baseaudiocontext.audioworklet property. properties the audioworklet interface does not define any properties of its own, but does inherit properties of worklet. methods this interface inherits methods from worklet. the audioworklet interface does not define any methods of its own. ...
AudioWorkletGlobalScope.registerProcessor - Web APIs
ived from audioworkletprocessor. note: a key-value pair { name: constructor } is saved internally in the audioworkletglobalscope once the processor is registered. the name is to be referred to when creating an audioworkletnode based on the registered processor. a new processor by the given name is internally created and associated with the new node. return value undefined exceptions notsupportederror the name is an empty string, or a constructor under the given name is already registered. registering the same name twice is not allowed. typeerror the processorctor is not a callable constructor, or the parameterdescriptors property of the constructor exists and doesn't return an array of audioparamdescriptor-based objects. examples in this example we creat...
AudioWorkletNode() - Web APIs
containing the initial values of custom audioparam objects on this node (in its parameters property), with key being the name of a custom parameter and value being its initial value. processoroptions optional any additional data that can be used for custom initialization of the underlying audioworkletprocessor. return value the newly constructed audioworkletnode instance. exceptions notsupportederror the specified options.outputchannelcount is 0 or larger than the current implementation supports. indexsizeerror the length of options.outputchannelcount array does not match options.numberofoutputs. example for a complete example demonstrating user-defined audio processing, see the audioworkletnode page. specifications specification status comment web a...
AudioWorkletNode.port - Web APIs
ctional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode. first, we need to define a custom audioworkletprocessor, and register it. note that that this should be done in a separate file. ...
AudioWorkletNodeOptions - Web APIs
its parameters property), with key being the name of a custom parameter and value being its initial value. processoroptions optional any additional data that can be used for custom initialization of the underlying audioworkletprocessor. usage notes when creating an audioworkletnode, these options can have various effects. if the number of inputs and number of outputs are both set to 0, a notsupportederror will be thrown and the node construction process aborted. if the length of the outputchannelcount array doesn't match numberofoutputs, an indexsizeerror will be thrown. if outputchannelcount isn't specified, and numberofinputs and numberofoutputs are both 1, the audioworkletnode's initial channel count is set to 1. this has the effect of changing the output channel count to dynamicall...
AudioWorkletProcessor.port - Web APIs
ctional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode. first, we need to define a custom audioworkletprocessor, and register it. note that that this should be done in a separate file. ...
AuthenticatorAttestationResponse.getTransports() - Web APIs
thenticatorattestationresponse instance is available on publickeycredential.response after calling navigator.credentials.create(). note: this method may only be used in top-level contexts and will not be available in an <iframe> for example. syntaxe arrtransports = authenticatorattestationresponse.gettransports() parameters none. return value an array containing the different transports supported by the authenticator or nothing if this information is not available.of the processing of the different extensions by the client. the elements of this array are supposed to be in lexicographical order. their values may be : "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator...
AuthenticatorAttestationResponse - Web APIs
inherited from the authenticatorresponse. authenticatorattestationresponse.attestationobject secure contextread only an arraybuffer containing authenticator data and an attestation statement for a newly-created key pair. methods authenticatorattestationresponse.gettransports()secure context returns an array of strings describing which transport methods (e.g. usb, nfc) are believed to be supported with the authenticator. the array may be empty if the information is not available. examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 }...
AuthenticatorResponse.clientDataJSON - Web APIs
ons.challenge. origin the fully qualified origin of the requester which has been given by the client/browser to the authenticator. we should expect the relying party's id to be a suffix of this value. tokenbindingid optional an object describing the state of the token binding protocol for the communication with the relying party. it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64url encoding of the token binding id which was used for the communication. should this property be absent, it would indicate that the client does not support token binding. examples function arraybuffert...
BaseAudioContext.createGain() - Web APIs
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id =...
BaseAudioContext.createIIRFilter() - Web APIs
edback (denominator) coefficients for the transfer function of the iir filter. this array may have up to 20 members, the first of which must not be zero. return value an iirfilternode implementing the filter with the specified feedback and feedforward coefficient arrays. exceptions invalidstateerror all of the feedforward coefficients are 0, and/or the first feedback coefficient is 0. notsupportederror one or both of the input arrays exceeds 20 members. specifications specification status comment web audio apithe definition of 'createiirfilter()' in that specification. working draft ...
BaseAudioContext.createPanner() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
BaseAudioContext.createScriptProcessor() - Web APIs
ill result in a lower (better) latency. higher values will be necessary to avoid audio breakup and glitches. it is recommended for authors to not specify this buffer size and allow the implementation to pick a good buffer size to balance between latency and audio quality. numberofinputchannels integer specifying the number of channels for this node's input, defaults to 2. values of up to 32 are supported. numberofoutputchannels integer specifying the number of channels for this node's output, defaults to 2. values of up to 32 are supported. important: webkit currently (version 31) requires that a valid buffersize be passed when calling this method. note: it is invalid for both numberofinputchannels and numberofoutputchannels to be zero. returns a scriptprocessornode. example th...
BaseAudioContext.sampleRate - Web APIs
syntax baseaudiocontext.samplerate; value a floating point number indicating the audio context's sample rate, in samples per second. example note: for a full web audio example implementation, see one of our web audio demos on the mdn github repo, like panner-node. ...
Using the Beacon API - Web APIs
the worker myworker.onmessage = function(event) { var msg = event.data; // log worker's send status console.log("worker reply: sendbeacon() status = " + msg); }; } this code snippet is for the worker (worker-using.js): onmessage = function(event) { var msg = event.data; // split the url and data from the message var url = msg[0]; var data = msg[1]; // if the browser supports worker sendbeacon(), then send the beacon; otherwise // return failure message to the global context if (self.navigator.sendbeacon) { var status = self.navigator.sendbeacon(url, data); postmessage(status ? "success" : "fail"); } else { postmessage("worker: self.navigator.sendbeacon is unsupported"); } } see also beacon api (overview) beacon standard beacon caniuse ...
Blob - Web APIs
Web › API › Blob
the blob object represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a readablestream so its methods can be used for processing the data. blobs can represent data that isn't necessarily in a javascript-native format. the file interface is based on blob, inheriting blob functionality and expanding it to support files on the user's system. using blobs to construct a blob from other non-blob objects and data, use the blob() constructor. to create a blob that contains a subset of another blob's data, use the slice() method. to obtain a blob object for a file on the user's file system, see the file documentation. the apis accepting blob objects are also listed in the file documentation. constructor blob() return...
Bluetooth.getAvailability() - Web APIs
th a bluetoothdevice). also, user can configure user agent to return a fixed value instead of a real one. syntax var readerpromise = bluetooth.getavailability(); parameters none. return value a promise that resolves with boolean. exceptions this method doesn't throw any exceptions. examples the following snippet prints out a message in the console specifying wheter or not bluetooth is supported: navigator.bluetooth.getavailability().then(available => { if (available) console.log("this device supports bluetooth!"); else console.log("doh! bluetooth is not supported"); }); specifications specification status comment web bluetooththe definition of 'getavailability()' in that specification. draft initial definition. ...
Bluetooth - Web APIs
Web › API › Bluetooth
ent allows the user to open. a bluetoothdevice representing the beacon would be available through navigator.bluetooth.referringdevice. events bluetooth.onavailabilitychanged an event handler that runs when an event of type availabilitychanged has fired. methods bluetooth.getavailability() returns a promise that resolved to a boolean indicating whether the user-agent has the ability to support bluetooth. some user-agents let the user configure an option that affects what is returned by this value. if this option is set, that is the value returned by this method. bluetooth.getdevices() returns a promise that resolved to an array of bluetoothdevices which the origin already obtained permission for via a call to bluetooth.requestdevice(). bluetooth.requestdevice() returns a promis...
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
otherwise it throws an error. syntax bluetoothremotegattcharacteristic.readvalue().then(function(dataview) { ... }) returns a promise that resolves to an dataview. ...
BluetoothRemoteGATTCharacteristic - Web APIs
olves to the first bluetoothgattdescriptor for a given descriptor uuid. bluetoothremotegattcharacteristic.getdescriptors() returns a promise that resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid. bluetoothremotegattcharacteristic.readvalue() returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattcharacteristic.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. bluetoothremotegattcharacteristic.startnotifications() returns a promise when navigator.bluetooth is added to the active notification context. bluetoothremotegattcharacteristic.stopnotifications() returns a promise when n...
CSS - Web APIs
Web › API › CSS
esponsible for all the classes related to painting. methods the css interface is a utility interface and no object of this type can be created: only static methods are defined on it. static methods no inherited static methods. css.registerproperty() registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value. css.supports() returns a boolean indicating if the pair property-value, or the condition, given in parameter is supported. css.escape() can be used to escape a string mostly for use as part of a css selector. css factory functions can be used to return a new cssunitvalue with a value of the parameter number of the units of the name of the factory function method used. css.em(3) // cssunitvalue {v...
CSSConditionRule - Web APIs
syntax the syntax is described using the webidl format. interface cssconditionrule : cssgroupingrule { attribute domstring conditiontext; } properties the cssconditionrule derives from cssrule, cssgroupingrule and inherits all properties of these classes. ...
CSSGroupingRule - Web APIs
csspagerule syntax the syntax is described using the webidl format. ...
CSSNumericValue.add() - Web APIs
syntax var cssmathsum = cssnumericvalue.add(double | cssnumericvalue); parameters number either a number or a cssnumericvalue. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue.div() - Web APIs
syntax var cssnumericvalue = cssnumericvalue.div(number); parameters number either a number or a cssnumericvalue. return value a cssmathproduct. exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue.mul() - Web APIs
syntax var cssmathproduct = cssnumericvalue.mul(number); parameters number either a number or a cssnumericvalue. return value a cssmathproduct exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue.sub() - Web APIs
syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue.sum() - Web APIs
syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue - Web APIs
aces based on cssnumericvalue below is a list of interfaces based on the cssnumericvalue interface. cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum cssmathvalue cssnumericarray cssperspective csspositionvalue cssrotate cssskew cssskeyx cssskeyw csstranslate cssunitvalue properties none. event handlers no methods cssnumericvalue.add adds a supplied number to the cssnumericvalue. cssnumericvalue.sub subtracts a supplied number from the cssnumericvalue. cssnumericvalue.mul multiplies the cssnumericvalue by the supplied value. cssnumericvalue.div divides the cssnumericvalue by the supplied value. cssnumericvalue.min returns the minimum value passed cssnumericvalue.max returns the maximum value passed cssnumericvalue.equals tru...
CSSStyleSheet.insertRule() - Web APIs
= rule.length; j < pl; j++) { var prop = rule[j]; propstr += prop[0] + ': ' + prop[1] + (prop[2] ? ' !important' : '') + ';\n'; } // insert css rule stylesheet.insertrule(selector + '{' + propstr + '}', stylesheet.cssrules.length); } } polyfill the below polyfill will correct the input of the arguments of insertrule() to standardize them in internet explorer 5–8. it supplements insertrule() with a function that separates the selector from the rules before sending the arguments to the default native insertrule(). (function(sheet_proto){ var originalinsertrule = sheet_proto.insertrule; if (originalinsertrule.length === 2){ // 2 mandatory arguments: (selector, rules) sheet_proto.insertrule = function(selectorandrule){ // first, separate the selector...
CSSStyleSheet - Web APIs
portrule), if any. a cssstylesheet object is created and inserted into the document's document.stylesheets list automatically by the browser, when a stylesheet is loaded for a document. as the stylesheet list cannot be modified directly, there's no useful way to create a new cssstylesheet object manually (although constructable stylesheet objects is coming to the web platform soon and is already supported in blink). to create a new stylesheet, insert a <style> or <link> element into the document. a (possibly incomplete) list of ways a stylesheet can be associated with a document follows: reason for the style sheet to be associated with the document appears in document. stylesheets list getting the owner element/rule given the style sheet object the interface for the o...
CSSStyleValue.parse() - Web APIs
thod of the cssstylevalue interface sets a specific css property to the specified values and returns the first value as a cssstylevalue object. syntax cssstylevalue.parse(property, csstext) parameters property a css property to set. csstext a comma-separated string containing one or more values to apply to the provided property. return value a cssstylevalue object containing the first supplied value. example the code below parses a set of declarations for the transform property. the second code block shows the structure of the returned object as it would be rendered in a developer tools console. const css = cssstylevalue.parse( 'transform', 'translate3d(10px,10px,0) scale(0.5)'); csstransformvalue {0: csstranslate, 1: cssscale, length: 2, is2d: false} specifications ...
CSSStyleValue.parseAll() - Web APIs
the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified value and returns an array of cssstylevalue objects, each containing one of the supplied values. syntax cssstylevalue.parseall(property, value) parameters property a css property to set. csstext a comma-separated string containing one or more values that apply to the provided property. return value an array of cssstylevalue objects, each containing one of the supplied values. specifications specification status comment css typed om level 1the definition of 'parseall()' in that specification. working draft initial definition. ...
CSSStyleValue - Web APIs
specifications specification status comment css typed om level 1the definition of 'cssstylevalue' in that specification. working draft initial definition. ...
Using dynamic styling information - Web APIs
the css object model (cssom), part of the dom, exposes specific interfaces allowing manipulation of a wide amount of information regarding css. initially defined in the dom level 2 style recommendation, these interfaces forms now a specification, css object model (cssom) which aims at superseding it. in many cases, and where possible, it really is best practice to dynamically manipulate classes via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet. one's javascript code also becomes cleaner since instead of being dedicated to styling details, it can focus on the overall semantics of each section it is creating or manipulating, leaving the precise style details to the stylesheet. however, there are cases where actually o...
CSS Object Model (CSSOM) - Web APIs
css style dynamically. ...
Cache.match() - Web APIs
Web › API › Cache › match
the first response that matches the request or to undefined if no match is found. note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]). examples this example is taken from the custom offline page example (live demo). it uses a cache to supply selected data when a request fails. a catch() clause is triggered when the call to fetch() throws an exception. inside the catch() clause, match() is used to return the correct response. in this example, only html documents retrieved with the get http verb will be cached. if our if() condition is false, then this fetch handler won't intercept the request. if there are any other fetch handlers...
Cache - Web APIs
Web › API › Cache
nts, // i.e. have a content-type response header that starts with "font/". // note that for opaque filtered responses (https://fetch.spec.whatwg.org/#concept-filtered-response-opaque) // we can't access to the response headers, so this check will always fail and the font won't be cached. // all of the google web fonts are served off of a domain that supports cors, so that isn't an issue here. // it is something to keep in mind if you're attempting to cache other resources from a cross-origin // domain that doesn't support cors, though! // we call .clone() on the response to save a copy of it to the cache. by doing so, we get to keep // the original response object which we will return back to the c...
CanvasPattern.setTransform() - Web APIs
telementbyid('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div ...
CanvasRenderingContext2D.addHitRegion() - Web APIs
ke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi); ctx.arc(130, 80, 10, 0, 2 * math.pi); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.beginpath(); ctx.arc(100, 110, 50, 0, math.pi); ctx.stroke(); edit the code below to see your changes update live in the canvas. ...
CanvasRenderingContext2D.drawImage() - Web APIs
width when drawn. dheight optional the height to draw the image in the destination canvas. this allows scaling of the drawn image. if not specified, the image is not scaled in height when drawn. exceptions thrown index_size_err if the canvas or source rectangle width or height is zero. invalid_state_err the image has no image data. type_mismatch_err the specified source element isn't supported. ns_error_not_available the image is not loaded yet. use .complete === true and .onload to determine when it is ready. examples drawing an image to the canvas this example draws an image to the canvas using the drawimage() method. html <canvas id="canvas"></canvas> <div style="display:none;"> <img id="source" src="https://udn.realityripple.com/samples/db/f374e9c6fc.jpg" ...
CanvasRenderingContext2D.drawWidgetAsOnScreen() - Web APIs
the non-standard and internal only canvasrenderingcontext2d.drawwidgetasonscreen() method of the canvas 2d api renders the root widget of a window into the canvas. unlike drawwindow(), this api uses the operating system to snapshot the widget on-screen, rather than reading from gecko's own compositor. this api cannot be used by web content. it is only supported on windows, only on widgets that use omtc, and only from within the chrome process. syntax void ctx.drawwidgetasonscreen(window); parameters window the window to render. specifications not part of any current specification or draft. this is a non-standard and internal only api. ...
CanvasRenderingContext2D.filter - Web APIs
urate() a css <percentage>. saturates the drawing. a value of 0% means completely un-saturated. a value of 100% leaves the drawing unchanged. sepia() a css <percentage>. converts the drawing to sepia. a value of 100% means completely sepia. a value of 0% leaves the drawing unchanged. none no filter is applied. initial value. examples to view these examples, make sure to use a browser that supports this feature; see the compatibility table below. applying a blur this example blurs a piece of text using the filter property. html <canvas id="canvas"></canvas> javascript 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...
CanvasRenderingContext2D.putImageData() - Web APIs
data will be extracted. defaults to 0. dirtyy optional vertical position (y coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtywidth optional width of the rectangle to be painted. defaults to the width of the image data. dirtyheight optional height of the rectangle to be painted. defaults to the height of the image data. errors thrown notsupportederror thrown if any of the arguments is infinite. invalidstateerror thrown if the imagedata object's data has been detached. examples understanding putimagedata to understand what this algorithm does under the hood, here is an implementation on top of canvasrenderingcontext2d.fillrect(). html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas');...
CanvasRenderingContext2D - Web APIs
interface's properties and methods in the sidebar and below. the canvas tutorial has more explanation, examples, and resources, as well. basic example to get a canvasrenderingcontext2d instance, you must first have an html <canvas> element to work with: <canvas id="my-house" width="300" height="300"></canvas> to get the canvas' 2d rendering context, call getcontext() on the <canvas> element, supplying '2d' as the argument: const canvas = document.getelementbyid('my-house'); const ctx = canvas.getcontext('2d'); with the context in hand, you can draw anything you like. this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.
Basic animations - Web APIs
settimeout(function, delay) executes the function specified by function in delay milliseconds. requestanimationframe(callback) tells the browser that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. if you don't want any user interaction you can use the setinterval() function which repeatedly executes the supplied code. if we wanted to make a game, we could use keyboard or mouse events to control the animation and use settimeout(). by setting eventlisteners, we catch any user interaction and execute our animation functions. in the examples below, we'll use the window.requestanimationframe() method to control the animation. the requestanimationframe method provides a smoother and more efficient way f...
Drawing shapes with canvas - Web APIs
. all elements are placed relative to this origin. so the position of the top left corner of the blue square becomes x pixels from the left and y pixels from the top, at coordinate (x,y). later in this tutorial we'll see how we can translate the origin to a different position, rotate the grid and even scale it, but for now we'll stick to the default. drawing rectangles unlike svg, <canvas> only supports two primitive shapes: rectangles and paths (lists of points connected by lines). all other shapes must be created by combining one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draw...
Drawing text - Web APIs
= value baseline alignment setting. possible values: top, hanging, middle, alphabetic, ideographic, bottom. the default value is alphabetic. direction = value directionality. possible values: ltr, rtl, inherit. the default value is inherit. these properties might be familiar to you, if you have worked with css before. the following diagram from the whatwg demonstrates the various baselines supported by the textbaseline property. a textbaseline example edit the code below and see your changes update live in the canvas: ctx.font = '48px serif'; ctx.textbaseline = 'hanging'; ctx.stroketext('hello world', 0, 100); playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /...
Hit regions and accessibility - Web APIs
bitmap and does not provide information about any drawn objects. canvas content is not exposed to accessibility tools like semantic html is. in general, you should avoid using canvas in an accessible website or app. the following guidelines can help to make it more accessible. fallback content the content inside the <canvas> ... </canvas> tags can be used as a fallback for browsers which don't support canvas rendering. it's also very useful for assistive technology users (like screen readers) which can read and interpret the sub dom in it. a good example at html5accessibility.com demonstrates how this can be done: <canvas> <h2>shapes</h2> <p>a rectangle with a black border. in the background is a pink circle. partially overlaying the <a href="http://en.wikipedia.org/wiki/circle"...
Using images - Web APIs
« previousnext » until now we have created our own shapes and applied styles to them. one of the more exciting features of <canvas> is the ability to use images. these can be used to do dynamic photo compositing or as backdrops of graphs, for sprites in games, and so forth. external images can be used in any format supported by the browser, such as png, gif, or jpeg. you can even use the image produced by other canvas elements on the same page as the source! importing images into a canvas is basically a two step process: get a reference to an htmlimageelement object or to another canvas element as a source. it is also possible to use images by providing a url. draw the image on the canvas using the drawimage() function. let's take a look at how to do this. gettin...
Canvas tutorial - Web APIs
escribes how to use the <canvas> element to draw 2d graphics, starting with the basics. the examples provided should give you some clear ideas about what you can do with canvas, and will provide code snippets that may get you started in building your own content. first introduced in webkit by apple for the os x dashboard, <canvas> has since been implemented in browsers. today, all major browsers support it. before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascript. the <canvas> element is not supported in some older browsers, but is supported in recent versions of all major browsers. the default size of the canvas is 300 pixels × 150 pixels (width × height). but custom sizes can be defined using the html height and wid...
ChannelMergerNode - Web APIs
are channels to merge; the number of inputs is defined as a parameter of its constructor and the call to audiocontext.createchannelmerger. in the case that no value is given, it will default to 6. using a channelmergernode, it is possible to create outputs with more channels than the rendering hardware is able to process. in that case, when the signal is sent to the audiocontext.listener object, supernumerary channels will be ignored. number of inputs variable; default to 6. number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor channelmergernode() creates a new channelmergernode object instance. properties no specific property; i...
ChannelSplitterNode - Web APIs
y, e.g. for performing channel mixing where gain must be separately controlled on each channel. if your channelsplitternode always has one single input, the amount of outputs is defined by a parameter on its constructor and the call to audiocontext.createchannelsplitter(). in the case that no value is given, it will default to 6. if there are fewer channels in the input than there are outputs, supernumerary outputs are silent. number of inputs 1 number of outputs variable; default to 6. channel count mode "explicit" older implementations, as per earlier versions of the spec use "max". channel count fixed to the number of outputs. older implementations, as per earlier versions of the spec use 2 (not used in the default count mode). c...
Clipboard.write() - Web APIs
Web › API › Clipboard › write
be sure to check the compatibility table as well as clipboard availability in clipboard for more information. ...
Clipboard.writeText() - Web APIs
the clipboard interface's writetext() property writes the specified text string to the system clipboard. text may be read back using either read() or readtext(). the "clipboard-write" permission of the permissions api, is granted automatically to pages when they are in the active tab. note: browser support for the asynchronous clipboard apis is still in the process of being implemented. be sure to check the compatibility table as well as clipboard availability in clipboard for more information. syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard. return value a promise which is resolved once the clipboard's contents have been updated. the promise is rejected if the caller does not have permissio...
Clipboard - Web APIs
Web › API › Clipboard
is resolved once the text is fully copied into the clipboard. clipboard availability the asynchronous clipboard api is a relatively recent addition, and the process of implementing it in browsers is not yet complete. due to both potential security concerns and technical complexities, the process of integrating this api is happening gradually in most browsers. for example, firefox does not yet support the "clipboard-read" and "clipboard-write" permissions, so access to the methods that access and change the contents of the clipboard are restricted in other ways. for webextensions, you can request the clipboardread and clipboardwrite permissions to be able to use clipboard.readtext() and clipboard.writetext(). content scripts applied on http sites do not have access to the clipboard object...
ClipboardItem() - Web APIs
see the browser compatibility table for the clipboard interface. syntax var clipboarditem = new clipboarditem(clipboarditemdata); parameters clipboarditemdata an object with the mime type as the key and blob as the value. ...
Clipboard API - Web APIs
copy, and paste) as well as to asynchronously read from and write to the system clipboard. access to the contents of the clipboard is gated behind the permissions api: the clipboard-write permission is granted automatically to pages when they are in the active tab. the clipboard-read permission must be requested, which you can do by trying to read data from the clipboard. this api is designed to supersede accessing the clipboard using document.execcommand(). accessing the clipboard instead of creating a clipboard object through instantiation, you access the system clipboard through the navigator.clipboard global: navigator.clipboard.readtext().then( cliptext => document.queryselector(".editor").innertext += cliptext); this snippet fetches the text from the clipboard and appends it to t...
CloseEvent - Web APIs
ure; the connection successfully completed whatever purpose for which it was created. 1001 going away the endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. 1002 protocol error the endpoint is terminating the connection due to a protocol error. 1003 unsupported data the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data). 1004 reserved. a meaning might be defined in the future. 1005 no status received reserved. indicates that no status code was provided even though one was expected. 1006 ab...
CompositionEvent.locale - Web APIs
...
console.count() - Web APIs
Web › API › Console › count
the console.count() method logs the number of times that this particular call to count() has been called. note: this feature is available in web workers. syntax console.count([label]); parameters label optional a string. if supplied, count() outputs the number of times it has been called with that label. if omitted, count() behaves as though it was called with the "default" label. examples for example, given code like this: let user = ""; function greet() { console.count(); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count(); console output will look something like this: "default: 1" "default: 2" "default: 3" "default: 4" the label is displayed as default because no explicit label was supplied. if we pass the user variable as ...
Console.countReset() - Web APIs
if omitted, countreset() resets the default counter to 0. ...
Console.group() - Web APIs
Web › API › Console › group
you can use nested groups to help organize your output by visually associating related messages. to create a new nested block, call console.group(). the console.groupcollapsed() method is similar, but the new block is collapsed and requires clicking a disclosure button to read it. note: from gecko 9 until gecko 51, the groupcollapsed() method was the same as group(). collapsed groups are fully supported starting in gecko 52. see bug 1088360. to exit the current group, call console.groupend(). for example, given this code: console.log("this is the outer level"); console.group(); console.log("level 2"); console.group(); console.log("level 3"); console.warn("more of level 3"); console.groupend(); console.log("back to level 2"); console.groupend(); console.log("back to the outer level"); t...
Console.profile() - Web APIs
Web › API › Console › profile
see console.profileend() to see how this argument is interpreted. to stop recording call console.profileend(). note: this feature is available in web workers. ...
Console.profileEnd() - Web APIs
doing so enables you to stop only that profile if you have multiple profiles being recorded. ...
Console.timeStamp() - Web APIs
Web › API › Console › timeStamp
adds a single marker to the browser's performance or waterfall tool. this lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. you can optionally supply an argument to label the timestamp, and this label will then be shown alongside the marker. note: this feature is available in web workers. syntax console.timestamp(label); parameters label label for the timestamp. optional. ...
ConstrainDouble - Web APIs
additionally, you can specify the property's value as a simple floating-point value, in which case the user agent does its best to match the value once all other more stringent constraints are met. ...
ConstrainULong - Web APIs
in addition, you can specify the value as a simple long integer value, in which case the user agent does its best to match the value once all other more stringent constraints are met. ...
Constraint validation API - Web APIs
it is valid, it will submit as you'd expect. for this to happen, the custom validity has to be cancelled, by invoking setcustomvalidity() with an empty string value. we therefore do this every time the input event is raised. if you don't do this, and a custom validity was previously set, the input will register as invalid, even if it current contains a valid value on submission. note: firefox supported a proprietary error attribute — x-moz-errormessage — for many versions, which allowed you set custom error messages in a similar way. this has been removed as of version 66 (see bug 1513890). specifications specification status comment html living standardthe definition of 'constraint validation api' in that specification. living standard html ...
Content Index API - Web APIs
d metadata of already cached pages, under the scope of the current service worker. the browser can then use these entries to display offline reading to a user. as a developer you can also display these entries within your application. indexed entries do not automatically expire. it's good practice to present an interface for clearing out entries, or periodically remove older entries. the api supports indexing urls corresponding to html documents. a url for a cached media file, for example, can't be indexed directly. instead, you need to provide a url for a page that displays media, and which works offline. interfaces contentindex the contentindex interface provides functionality to register content available offline. contentindexevent the contentindexevent interface of the ...
CredentialsContainer.preventSilentAccess() - Web APIs
sit. mediation varies by origin, and is an added check point of browser stored credentials, informing a user of an account login status. this method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site visit. earlier versions of the spec called this method requireusermediation(). see browser compatibility for support details. syntax var promise = credentialscontainer.preventsilentaccess() parameters none. returns an empty promise. specifications specification status comment credential management level 1the definition of 'preventsilentaccess()' in that specification. working draft initial definition. ...
CredentialsContainer - Web APIs
)secure context sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise. for example, you might call this, after a user signs out of a website to ensure that he/she isn't automatically signed in on the next site visit. earlier versions of the spec called this method requireusermediation(). see browser compatibility for support details. credentialscontainer.store()secure context stores a set of credentials for a user, inside a provided credential instance and returns that instance in a promise. examples // tbd specifications specification status comment credential management level 1 working draft initial definition. web authentication: an api for accessing public key cre...
CustomElementRegistry.get() - Web APIs
lement. syntax constructor = customelements.get(name); parameters name the name of the custom element whose constructor you want to return a reference to. return value the constructor for the named custom element, or undefined if there is no custom element definition with that name. ...
CustomEvent - Web APIs
explorer and eventually adopted into the dom specification in order to ensure existing sites continue to work. ideally, you should try to use event.preventdefault() and event.defaultprevented instead, but you can use returnvalue if you choose to do so. event.srcelement a non-standard alias (from old versions of microsoft internet explorer) for event.target. some other browsers are starting to support it for web compatibility purposes. event.target read only a reference to the target to which the event was originally dispatched. event.timestamp read only the time at which the event was created (in milliseconds). by specification, this value is time since epoch—but in reality, browsers' definitions vary. in addition, work is underway to change this to be a domhighrestimestamp instea...
DOMConfiguration - Web APIs
note: this interface has never been supported in gecko, and has been removed from the dom specification. pre-defined parameters: "canonical-form", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration...
DOMImplementation.hasFeature() - Web APIs
it is deprecated and modern browsers return true in all cases. the different implementations fairly diverged in what kind of features were reported. the latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use. syntax const flag = document.implementation.hasfeature(feature, version); parameters feature a domstring representing the feature name. version a domstring representing the version of the specification defining the feature. ...
DOMImplementation - Web APIs
ace has no specific property and doesn't inherit any. methods no inherited method. domimplementation.createdocument() creates and returns an xmldocument. domimplementation.createdocumenttype() creates and returns a documenttype. domimplementation.createhtmldocument() creates and returns an html document. domimplementation.hasfeature() returns a boolean indicating if a given feature is supported or not. this function is unreliable and kept for compatibility purpose alone: except for svg-related queries, it always returns true. old browsers are very inconsistent in their behavior. specifications specification status comment domthe definition of 'domimplementation' in that specification. living standard removed the getfeature() method. added the c...
DOMMatrix - Web APIs
Web › API › DOMMatrix
specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification. candidate recommendation initial definition ...
DOMMatrixReadOnly.translate() - Web APIs
the translate() method accepts two or three values. dommatrix.translate(translatex, translatey[, translatez]) parameters translatex a number representing the abscissa (x-coordinate) of the translating vector. translatey a number representing the ordinate (y-coordinate) of the translating vector. translatez optional a number representing the z component of the translating vector. if not supplied, this defaults to 0. if this is anything other than 0, the resulting matrix will be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix being translated by the given vector. the original matrix is not modified. if a translation is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. examples this svg contains two squares, one ...
DOMTokenList.remove() - Web APIs
domtokenlist using element.classlist. we then remove a token from the list, and write the list into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.remove("c"); span.textcontent = classes; the output looks like this: to remove multiple classes at once, you can supply multiple tokens. the order you supply the tokens doesn't have to match the order they appear in the list: let span2 = document.getelementsbytagname("span")[0] let classes2 = span.classlist; classes2.remove("c", "b"); span2.textcontent = classes; specifications specification status comment domthe definition of 'remove()' in that specification. living standard...
DOMTokenList - Web APIs
l to the list's length. domtokenlist.contains(token) returns true if the list contains the given token, otherwise false. domtokenlist.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the list. domtokenlist.remove(token1[, token2[, ...tokenn]]) removes the specified token(s) from the list. domtokenlist.replace(oldtoken, newtoken) replaces token with newtoken. domtokenlist.supports(token) returns true if a given token is in the associated attribute's supported tokens. domtokenlist.toggle(token [, force]) removes token from the list if it exists, or adds token to the list if it doesn't. returns a boolean indicating whether token is in the list after the operation. domtokenlist.entries() returns an iterator, allowing you to go through all key/value pairs contained i...
DataTransfer.mozSetDataAt() - Web APIs
ew item is added, and the mozitemcount is incremented by one. data should be added in order of preference, with the most specific format added first and the least specific format added last. if data of the given format already exists, it is replaced in the same position as the old data. the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports. note: this method is gecko-specific. syntax void datatransfer.mozsetdataat([type], data, index); arguments type a string representing the type of the drag data to add to the drag data object. data a nsivariant representing the data to add to the drag data object. index a unsigned long representing the index of the data to add. return value void example this example sh...
DataTransferItemList.DataTransferItem() - Web APIs
syntax dataitem = datatransferitem[index]; parameters index the zero-based index of the item in the drag data list to return. return value the datatransferitem object at the specified index in the item list. if the index is less than zero or greater than or equal to the number of items in the list (as indicated by the list's length property, undefined is returned. the returned value is never null. example this example shows how to use drag and drop. ...
DataTransferItemList.add() - Web APIs
epresenting the drag item's data. type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. if the drag item couldn't be created (for example, if the associated datatransfer object has no data store), null is returned. exceptions notsupportederror a string data parameter was provided, and the list already contains an item whose kind is "plain unicode string" and whose type is equal to the specified type parameter. example this example shows the use of the add() method. html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to th...
DeprecationReportBody - Web APIs
ia. this can be used to group reports by deprecated feature. anticipatedremoval a date object (rendered as a string) representing the date when the feature is expected to be removed from the current browser. if the date is not known, this property will return null. message a string containing a human-readable description of the deprecation, including information such as what newer feature has superceded it, if any. this typically matches the message a browser will display in its devtools console when a deprecated feature is used, if one is available. sourcefile a string containing the path to the source file where the deprecated feature was used, if known, or null otherwise. linenumber a number representing the line in the source file in which the deprecated feature was used, if known...
Document.alinkColor - Web APIs
blue, darkblue, etc.) or the hexadecimal value of the color (e.g., #0000ff) notes the default value for this property in mozilla firefox is red (#ee0000 in hexadecimal). document.alinkcolor is deprecated in dom level 2 html. one alternative is the css selector :active. another alternative is document.body.alink, although this is deprecated in html 4.01 in favor of the css alternative. gecko supports both alinkcolor/:active and :focus. internet explorer 6 and 7 support alinkcolor/:active only for html anchor (<a>) links and the behavior is the same as :focus under gecko. there is no support for :focus in ie. ...
Document.createElement() - Web APIs
document.body.insertbefore(newdiv, currentdiv); } web component example the following example snippet is taken from our expanding-list-web-component example (see it live also). in this case, our custom element extends the htmlulistelement, which represents the <ul> element. // create a class for the element class expandinglist extends htmlulistelement { constructor() { // always call super first in constructor super(); // constructor definition left out for brevity ... } } // define the new element customelements.define('expanding-list', expandinglist, { extends: "ul" }); if we wanted to create an instance of this element programmatically, we'd use a call along the following lines: let expandinglist = document.createelement('ul', { is : 'expanding-list' }) the ...
Document.designMode - Web APIs
in ie6-10, the value is capitalized. ...
Document.doctype - Web APIs
Web › API › Document › doctype
specifications specification status comment domthe definition of 'document: doctype' in that specification. living standard ...
Document.getElementsByName() - Web APIs
t type="hidden" name="up"> <input type="hidden" name="down"> <script> var up_names = document.getelementsbyname("up"); console.log(up_names[0].tagname); // displays "input" </script> </html> notes the name attribute can only be applied in (x)html documents. the returned nodelist collection contains all elements with the given name, such as <meta>, <object>, and even elements which do not support the name attribute at all. the getelementsbyname method works differently in ie10 and below. there, getelementsbyname() also returns elements that have an id attribute with the specified value. be careful not to use the same string as both a name and an id. the getelementsbyname method works differently in ie. there, getelementsbyname() does not return all elements which may not have a n...
Document.getElementsByTagNameNS() - Web APIs
> </div> </div> <p>some outer text</p> <p>some outer text</p> <button onclick="getallparaelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> potential workaround for other browsers which do not support if the desired browser did not support xpath, another approach (such as traversing the dom through all its children, identifying all @xmlns instances, etc.) would be necessary to find all tags with the desired local name and namespace, but xpath is much faster. (to accommodate explorer, one could call an xpath wrapper instead of the xpath in the function below (as explorer supports xpath wit...
Document.height - Web APIs
Web › API › Document › height
instead, use document.body.clientheight. see element.clientheight. returns the height of the document object. in most cases, this is equal to the <body> element of the current document. ...
Document.implementation - Web APIs
the document.implementation property returns a domimplementation object associated with the current document. syntax domimpobj = document.implementation; example var modname = "html"; var modver = "2.0"; var conformtest = document.implementation.hasfeature( modname, modver ); alert( "dom " + modname + " " + modver + " supported?: " + conformtest ); // alerts with: "dom html 2.0 supported?: true" if dom level 2 html module is supported. a list of module names (e.g., core, html, xml, etc.) is available in the dom level 2 conformance section. notes the w3c's dom level 1 recommendation only specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?). if available, other dom...
Document.open() - Web APIs
Web › API › Document › open
about principals. three-argument document.open() there is a lesser-known and little-used three-argument version of document.open() , which is an alias of window.open() (see its page for full details). this call, for example opens github.com in a new window, with its opener set to null: document.open('https://www.github.com','', 'noopener=true') two-argument document.open() browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) where type specified the mime type of the data you are writing (e.g. text/html) and replace if set (i.e. a string of "replace") specified that the history entry for the new document would replace the current history entry of the document being written to. this form is now obsolete; it won't throw an ...
Document: pointercancel event - Web APIs
: a hardware event occurs that cancels the pointer activities. this may include, for example, the user switching applications using an application switcher interface or the "home" button on a mobile device. the device's screen orientation is changed while the pointer is active. the browser decides that the user started pointer input accidentally. this can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events. the touch-action css property prevents the input from continuing. after the pointercancel event is fired, the browser will also send pointerout followed by pointerleave. examples using addeventlistener(): document.addeventlistener('pointercancel', (event) => { console.l...
Document: pointerenter event - Web APIs
the pointerenter event fires when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown). bubbles no cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): document.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: document.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer events obsolete ...
Document: pointerout event - Web APIs
the pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. bubbles yes cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): document.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: document.onpointerout = (event) => { console.log('pointer moved out'); }; specifications specification status ...
Document.queryCommandEnabled() - Web APIs
return value returns a boolean which is true if the command is enabled and false if the command isn't. notes for 'cut' and 'copy' commands the method only returns true when called from a user-initiated thread. ...
Document.registerElement() - Web APIs
see enabling web components in firefox. ...
Document.width - Web APIs
Web › API › Document › width
note: starting in gecko 6.0, document.width is no longer supported. instead, use document.body.clientwidth. see element.clientwidth. returns the width of the <body> element of the current document in pixels. not supported by internet explorer. syntax pixels = document.width; example function init() { alert("the width of the document is " + document.width + " pixels."); } alternatives document.body.clientwidth /* width of <body> */ document.documentelement.clientwidth /* width of <html> */ window.innerwidth /* window's width */ specification html5 ...
Document.write() - Web APIs
Web › API › Document › write
cument.open(). after writing, call document.close() to tell the browser to finish loading the page. if the document.write() call is embedded within an inline html <script> tag, then it will not call document.open(). for example: <script> document.write("<h1>main title</h1>") </script> note: document.write() and document.writeln do not work in xhtml documents (you'll get an "operation is not supported" [ns_error_dom_not_supported_err] error in the error console). this happens when opening a local file with the .xhtml file extension or for any document served with an application/xhtml+xml mime type. more information is available in the w3c xhtml faq. note: using document.write() in deferred or asynchronous scripts will be ignored and you'll get a message like "a call to document.write() ...
Document.writeln() - Web APIs
Web › API › Document › writeln
es a string of text followed by a newline character to a document. syntax document.writeln(line); parameters line is string containing a line of text. example document.writeln("<p>enter password:</p>"); notes document.writeln is the same as document.write but adds a newline. note: document.writeln (like document.write) does not work in xhtml documents (you'll get a "operation is not supported" (ns_error_dom_not_supported_err) error on the error console). this is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml mime type. more information is available in the w3c xhtml faq. specifications specification status comment html living standardthe definition of 'document.writeln()' in that...
Document.xmlEncoding - Web APIs
thunderbird 10.0 / seamonkey 2.7)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns the encoding as determined by the xml declaration. should be null if unspecified or unknown. warning: do not use this attribute; it has been removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7). if the xml declaration states: <?xml version="1.0" encoding="utf-16"?> ...the result should be "utf-16". however, firefox 3.0 includes information on endianness (e.g., utf-16be for big endian encoding), and while this extra information is removed as of firefox 3.1b3, firefox 3.1b3 is still consulting the file's encoding, ...
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
obsolete css object model (cssom) view modulethe definition of 'elementsfrompoint()' in that specification. working draft ...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
node object. examples html content <div> <p>some text</p> </div> <p>top node at point 30, 20:</p> <div id="output"></div> javascript content var output = document.getelementbyid("output"); if (document.nodefrompoint) { var node = document.nodefrompoint(30, 20); output.textcontent += node.localname; } else { output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.nodefrompoint()</code>" + "</span>"; } specifications not part of any specification at present. ...
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
...
DocumentTimeline.DocumentTimeline() - Web APIs
the documenttimeline() constructor of the web animations api creates a new instance of the documenttimeline object associated with the active document of the current browsing context. syntax var sharedtimeline = new documenttimeline(options); parameters options an object specifying options for the new timeline. currently the only supported option is the origintime member which specifies the zero time for the documenttimeline as a real number of milliseconds relative to the navigationstart moment of the active document for the current browsing context. examples we could share a single documenttimeline among multiple animations, thus allowing us to manipulate just that group of animations via their shared timeline. this bit of code would start all the cats animating 500 milliseco...
Events and the DOM - Web APIs
ner // assuming mybutton is a button element mybutton.addeventlistener('click', greet, false) function greet(event){ // print and have a look at the event object // always print arguments in case of overlooking any other arguments console.log('greet:', arguments) alert('hello world') } this is the method you should use in modern web pages. note: internet explorer 6–8 didn't support this method, offering a similar eventtarget.attachevent api instead. for cross-browser compatibility, use one of the many javascript libraries available. more details can be found on the eventtarget.addeventlistener reference page. html attribute <button onclick="alert('hello world!')"> the javascript code in the attribute is passed the event object via the event parameter. the return v...
How to create a DOM tree - Web APIs
s street="123 main st" city="arlington" state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta" state="ga" country="usa"/> <address street="123 west st" city="seattle" state="wa" country="usa"/> <address street="321 south avenue" city="denver" state="co" country="usa"/> </person> </people> the w3c dom api, supported by mozilla, can be used to create an in-memory representation of this document like so: var doc = document.implementation.createdocument("", "", null); var peopleelem = doc.createelement("people"); var personelem1 = doc.createelement("person"); personelem1.setattribute("first-name", "eric"); personelem1.setattribute("middle-initial", "h"); personelem1.setattribute("last-name", "jung"); v...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
uences of spaces at the beginning and end of a line are removed, so we finally get this: <h1>helloā—¦<span>world!</span></h1> this is why people visiting the web page will simply see the phrase "hello world!" nicely written at the top of the page, rather than a weirdly indented "hello" followed but an even more weirdly indented "world!" on the line below that. note: firefox devtools have supported highlighting text nodes since version 52, making it easier to see exactly what nodes whitespace characters are contained within. pure whitespace nodes are marked with a "whitespace" label. whitespace in block formatting contexts above we just looked at elements that contain inline elements, and inline formatting contexts. if an element contains at least one block element, then it instead...
DoubleRange - Web APIs
properties max a floating-point value specifying the largest permissible value of the property it describes. min a floating-point value specifying the smallest permissible value of the property it describes. the specified min and/or and max values are required. ...
EXT_float_blend - Web APIs
buffers by enabling the extension webgl_color_buffer_float (for webgl1) or ext_color_buffer_float (for webgl2). doing so automatically enables ext_float_blend as well. with this extension enabled, calling drawarrays() or drawelements() with blending enabled and a draw buffer with 32-bit floating-point components will no longer result in an invalid_operation error. usage notes on devices that support the ext_float_blend extension, it is automatically, implicitly, enabled when any one or more of ext_color_buffer_float, oes_texture_float, or webgl_color_buffer_float are enabled. this ensures that content written before ext_float_blend was exposed by webgl will function as expected. examples const gl = canvas.getcontext('webgl2'); // enable necessary extensions gl.getextension('ext_color_...
EXT_sRGB - Web APIs
Web › API › EXT sRGB
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. the constants in webgl2 are: gl.srgb, gl.srgb8, gl.srgb8_alpha8 and gl.framebuffer_attachment_color_encoding. constants this extension exposes the following constants, which can be used in the teximage2d(), texsubimage2d(), renderbufferstorage() and getframebufferattachmentparameter() methods. ...
EXT_texture_compression_bptc - Web APIs
the ext_texture_compression_bptc extension is part of the webgl api and exposes 4 bptc compressed texture formats. these compression formats are called bc7 and bc6h in microsoft's directx api. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver. there is no support on windows. this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_rgba_bptc_unorm_ext compresses 8-bit fixed-point data. each 4x4 block of texels consists of 128 bits of rgba ...
EXT_texture_compression_rgtc - Web APIs
gtc extension is part of the webgl api and exposes 4 rgtc compressed texture formats. rgtc is a block-based texture compression format suited for unsigned and signed red and red-green textures (red-green texture compression). webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver. there is no support on windows. this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_red_rgtc1_ext each 4x4 block of texels consists of 64 bits of unsigned red ima...
EcdsaParams - Web APIs
ubtlecrypto.sign() or subtlecrypto.verify() when using the ecdsa algorithm. properties name a domstring. this should be set to ecdsa. hash a domstring. an identifier for the digest algorithm to use. this should be one of the following: sha-256: selects the sha-256 algorithm. sha-384: selects the sha-384 algorithm. sha-512: selects the sha-512 algorithm. warning: sha-1 is also supported here but the sha-1 algorithm is considered vulnerable and should no longer be used. examples see the examples for subtlecrypto.sign() or subtlecrypto.verify(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.ecdsaparams' in that specification. recommendation ...
EffectTiming.iterations - Web APIs
ationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { iterations: numberofiterations }; timingproperties.iterations = numberofiterations; value a floating-point value specifying the number of times the animation sequence will play through. any value from 0 (don't play the animation at all) to positive infinity (run the animation indefinitely) is supported. defaults to 1, meaning the animation sequence plays through once then stops automatically. exceptions typeerror an attempt was made to set the value of this property to a negative number or nan. the property's value is left unchanged. examples in the forgotten key example, alice waves her arm up and down the entire time the page is open by passing infinity as the value for her iter...
Element: auxclick event - Web APIs
interface mouseevent event handler property onauxclick preventing default actions for the vast majority of browsers that map middle click to opening a link in a new tab, including firefox, it is possible to cancel this behavior by calling preventdefault() from within an auxclick event handler. when listening for auxclick events originating on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button. on windows this is usually autoscroll, and on macos and linux this is usually clipboard paste. this can be done by preventing the default behaviour of the mousedown or pointerdown event. additionally, you may need to avoid opening a system context menu af...
Element.classList - Web APIs
Web › API › Element › classList
nd future elements in the doc. document.documentelement.firstchild.appendchild(document.createelement('style')).stylesheet.csstext=( '_*{x-uclp:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' + // ie6 '[class]{x-uclp/**/:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' //ie7-8 ); } })(window); // 3. ...
Element.clientTop - Web APIs
Web › API › Element › clientTop
he clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width". (actually might be math.round(parsefloat()).) for example, if the computed "border-top-width" is zero, then clienttop is also zero. note: this property will round the value to an integer. if you need a fractional value, use element.getboundingclientrect(). gecko-based applications support clienttop starting with gecko 1.9 (firefox 3, implemented in bug 111207). this property is not supported in firefox 2 and earlier. syntax var top = element.clienttop; example in the following illustration, the client area is show in white. (the segments labeled "top", "right", etc. have no significance regarding the client area.) the clienttop value is the distance from where the margin ...
Element.computedStyleMap() - Web APIs
in other browsers you'll just see a link. did you realize how many default css properties a link had? update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values. specifications specification status comment css typed om level 1the...
Element: mouseenter event - Web APIs
mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a new li element var newlistitem = document.createelement("li"); // add the text node to the li element newlistitem.appendchild(newtextnode); // add the newly created list item to list unorderedlist.appendchild(newlistitem); } result specifications specification status ui eventsthe ...
Element: mouseleave event - Web APIs
mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create a new li element var newlistitem = document.createelement("li"); // add the text node to the li element newlistitem.appendchild(newtextnode); // add the newly created list item to list unorderedlist.appendchild(newlistitem); } result specifications specification status ui eventsthe ...
Element.setPointerCapture() - Web APIs
te a specific element as the capture target of future pointer events. subsequent events for the pointer will be targeted at the capture element until capture is released (via element.releasepointercapture()). note: when pointer capture is set, pointerover, pointerout, pointerenter, and pointerleave events are only generated when crossing the boundary of the capture target. this has the effect of suppressing these events on all other elements. overview of pointer capture pointer capture allows events for a particular pointer event (pointerevent) to be re-targeted to a particular element instead of the normal (or hit test) target at a pointer's location. this can be used to ensure that an element continues to receive pointer events even if the pointer device's contact moves off the element (...
Element: webkitmouseforcechanged event - Web APIs
the non-standard webkitmouseforcechanged event is fired by safari each time the amount of pressure changes on the trackpad/touchscreen. bubbles unknown cancelable unknown interface mouseevent webkitmouseforcechanged is a proprietary, webkit-specific event introduced by apple to support their force touch events feature. this event first fires after the mousedown event and stops firing before the mouseup event. specifications not part of any specification. apple has a description at the mac developer library. ...
Encoding API - Web APIs
the encoding api provides a mechanism for handling text in various character encodings, including legacy non-utf-8 encodings. the api provides four interfaces: textdecoder, textencoder, textdecoderstream and textencoderstream. interfaces textdecoder textencoder textdecoderstream textencoderstream tutorials & tools a shim allowing to use this interface in browsers that don't support it. stringview – a c-like representation of strings based on typed arrays. specifications specification status comment encoding living standard initial definition. ...
Event.composed - Web APIs
Web › API › Event › composed
ke the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
Event.composedPath() - Web APIs
ke the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
Event.returnValue - Web APIs
Web › API › Event › returnValue
you should use preventdefault(), and defaultprevented instead of this historical property. ...
Event.srcElement - Web APIs
Web › API › Event › srcElement
initially implemented in internet explorer, event.srcelement is a now-standard alias (defined in the dom standard but flagged as "historical") for the event.target property. it's supported in all major browser engines, but only for compatibility reasons. use event.target instead. specifications specification status comment domthe definition of 'event.srcelement' in that specification. living standard ...
Event.timeStamp - Web APIs
Web › API › Event › timeStamp
syntax time = event.timestamp; value this value is the number of milliseconds elapsed from the beginning of the current document's lifetime till the event was created. in newer implementations, the value is a domhighrestimestamp accurate to 5 microseconds (0.005 ms). in older implementations, the value is a domtimestamp, accurate to a millisecond. ...
Event - Web APIs
Web › API › Event
explorer and eventually adopted into the dom specification in order to ensure existing sites continue to work. ideally, you should try to use event.preventdefault() and event.defaultprevented instead, but you can use returnvalue if you choose to do so. event.srcelement a non-standard alias (from old versions of microsoft internet explorer) for event.target. some other browsers are starting to support it for web compatibility purposes. event.target read only a reference to the target to which the event was originally dispatched. event.timestamp read only the time at which the event was created (in milliseconds). by specification, this value is time since epoch—but in reality, browsers' definitions vary. in addition, work is underway to change this to be a domhighrestimestamp instea...
EventTarget() - Web APIs
the eventtarget() constructor creates a new eventtarget object instance. syntax var myeventtarget = new eventtarget(); parameters none. return value an instance of the eventtarget object. ...
EventTarget - Web APIs
eventtarget is a dom interface implemented by objects that can receive events and may have listeners for them. element, document, and window are the most common event targets, but other objects can be event targets, too. for example xmlhttprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><re...
FeaturePolicy - Web APIs
the featurepolicy interface of the feature policy api represents the set of policies applied to the current execution context. featurepolicy methods featurepolicy.allowsfeature returns a boolean that indicates whether or not a particular feature is enabled in the specified context. featurepolicy.features returns a list of names of all features supported by the user agent. feature whose name appears on the list might not be allowed by the feature policy of the current execution context and/or might not be accessible because of user's permissions. featurepolicy.allowedfeatures returns a list of names of all features supported by the user agent and allowed by the feature policy. note that features appearing on this list might still be behind a user permission. featurepolicy.getallo...
File.lastModified - Web APIs
Web › API › File › lastModified
if it is missing, lastmodified inherits the current time from date.now() at the moment the file object gets created. const filewithdate = new file([], 'file.bin', { lastmodified: new date(2017, 1, 1), }); console.log(filewithdate.lastmodified); //returns 1485903600000 const filewithoutdate = new file([], 'file.bin'); console.log(filewithoutdate.las...
FileReader.readAsDataURL() - Web APIs
for a full compatibility code you can see our crossbrowser possible solution for image preview. see also this more powerful example. specifications specification status comment file apithe definition of 'readasdataurl()' in that specification. working draft initial definition ...
Force Touch events - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. force touch events are a proprietary, apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad. events webkitmouseforcewillbegin this event is fired before the mousedown event. its main use is that it can be event.preventdefault()ed. webkitmouseforcedown this event is fired after the mousedown event as soon as sufficient pressure has been applied for it to qualify as a "for...
GainNode.gain - Web APIs
Web › API › GainNode › gain
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id =...
GainNode - Web APIs
Web › API › GainNode
mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id =...
Gamepad.mapping - Web APIs
Web › API › Gamepad › mapping
if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard. ...
Gamepad.timestamp - Web APIs
Web › API › Gamepad › timestamp
elopers to determine if the axes and button data have been updated from the hardware. the value must be relative to the navigationstart attribute of the performancetiming interface. values are monotonically increasing, meaning that they can be compared to determine the ordering of updates, as newer values will always be greater than or equal to older values. note: this property is not currently supported anywhere. syntax readonly attribute domhighrestimestamp timestamp; example var gp = navigator.getgamepads()[0]; console.log(gp.timestamp); value a domhighrestimestamp. specifications specification status comment gamepadthe definition of 'gamepad.timestamp' in that specification. working draft initial definition ...
GeolocationCoordinates.altitudeAccuracy - Web APIs
the geolocationcoordinates.altitudeaccuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters. this value is null if the implementation doesn't support measuring altitude. syntax let altacc = geolocationcoordinatesinstance.altitudeaccuracy value a positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.altitudeaccuracy' in that specification. recommendation initial specification. ...
Using the Geolocation API - Web APIs
itude = position.coords.longitude; status.textcontent = ''; maplink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; maplink.textcontent = `latitude: ${latitude} °, longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocation.getcurrentposition(success, error); } } document.queryselector('#find-me').addeventlistener('click', geofindme); result ...
Geolocation API - Web APIs
itude = position.coords.longitude; status.textcontent = ''; maplink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; maplink.textcontent = `latitude: ${latitude} °, longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocation.getcurrentposition(success, error); } } document.queryselector('#find-me').addeventlistener('click', geofindme); result specifications specification status comment geolocation api recommendation ...
GlobalEventHandlers.onanimationcancel - Web APIs
lebox').addeventlistener('click', function() { if (box.style.display == "none") { box.style.display = "flex"; document.getelementbyid("togglebox").innerhtml = "hide the box"; } else { box.style.display = "none"; document.getelementbyid("togglebox").innerhtml = "show the box"; } }); toggling the box to display: none has the effect of aborting its animation. in browsers that support animationcancel, the event is fired and this handler is called. result assembled together, you get this: if your browser supports animationcancel, hiding the box using the button will cause a message to be displayed about the event. specification specification status comment css animationsthe definition of 'onanimationcancel' in that specification. working dr...
GlobalEventHandlers.onanimationend - Web APIs
result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationend' in that specification. working draft ...
GlobalEventHandlers.onanimationstart - Web APIs
result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationstart' in that specification. working draft ...
GlobalEventHandlers.onplay - Web APIs
unction; var handlerfunction = element.onplay; handlerfunction should be either null or a javascript function specifying the handler for the event. example <p>this example demonstrates how to assign an "onplay" event to a video element.</p> <video controls onplay="alertplay()"> <source src="mov_bbb.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> your browser does not support html5 video. </video> <p>video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">big buck bunny</a>.</p> <script> function alertplay() { alert("the video has started to play."); } </script> specification specification status comment html living standardthe definition of 'onplay' in that specification. living standard ...
GlobalEventHandlers.onpointerdown - Web APIs
n, in turn, looks at the value of pointertype to determine what kind of pointing device was used, then uses that information to customize a string to replace the contents of the target box. then the event's preventdefault() method is called to ensure that the mousedown event isn't triggered, potentially causing events to be handled twice if we had a handler for those events in case pointer event support is missing. we also have a handler for pointerup events: targetbox.onpointerup = handleup; function handleup(evt) { targetbox.innerhtml = "tap me, click me, or touch me!"; evt.preventdefault(); } this code's job is to just restore the original text into the target box after the user's interaction with the element ends (for example, when they release the mouse button, or when they lift...
HTMLBaseFontElement - Web APIs
ies inherits properties from its parent, htmlelement. htmlbasefontelement.color is a domstring representing the text color using either a named color or a color specified in the hexadecimal #rrggbb format. htmlbasefontelement.face is a domstring representing a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. htmlbasefontelement.size is a domstring representing the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. relative value starts with a '+' or a '-'. methods no specific m...
HTMLButtonElement - Web APIs
, or it satisfies its constraints. htmlbuttonelement.validity read only is a validitystate representing the validity states that this button is in. htmlbuttonelement.value is a domstring representing the current form control value of the button. methods inherits methods from its parent, htmlelement name return type description checkvalidity() boolean not supported for reset or button elements. reportvalidity() boolean not supported for reset or button elements. setcustomvalidity(in domstring error) void not supported for reset or button elements. with gecko-based browser, use the :-moz-submit-invalid pseudo-class to style submit buttons based on the validation of a form. specifications specification ...
HTMLCanvasElement.captureStream() - Web APIs
that indicates the rate of capture of each frame. if not set, a new frame will be captured each time the canvas changes; if set to 0, frames will not be captured automatically; instead, they will only be captured when the returned track's requestframe() method is called. return value a reference to a mediastream object, which has a single canvascapturemediastreamtrack in it. exceptions notsupportederror the value of framerate is negative. example // find the canvas element to capture var canvaselt = document.queryselector('canvas'); // get the stream var stream = canvaselt.capturestream(25); // 25 fps // do things to the stream // e.g. send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specification...
HTMLCanvasElement.getContext() - Web APIs
later calls to this method on the same canvas element return the same drawing context instance as was returned the last time the method was invoked with the same contexttype argument. to get a different drawing context object you need to pass a different contexttype or call the method on a different canvas element. ...
HTMLCanvasElement.mozOpaque - Web APIs
ng the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting performance can be optimized. this has been standardized as setting the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext(). use of mozopaque should be avoided. firefox will stop supporting it in the future. syntax var opaque = canvas.mozopaque; canvas.mozopaque = true; examples given this <canvas> element: <canvas id="canvas" width="300" height="300" moz-opaque></canvas> you can get or set the mozopaque property. for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain performance in your application when translucency is no...
HTMLCanvasElement.toDataURL() - Web APIs
uri containing a representation of the image in the format specified by the type parameter (defaults to png). the returned image is in a resolution of 96 dpi. if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image format. the default format type is image/png. encoderoptions optional 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. if this argument is a...
HTMLCollection - Web APIs
t of range. an alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. htmlcollection.nameditem() returns the specific node whose id or, as a fallback, name matches the string specified by name. matching by name is only done as a last resort, only in html, and only if the referenced element supports the name attribute. returns null if no node exists by the given name. an alternative to accessing collection[name] (which instead returns undefined when name does not exist). this is mostly useful for non-javascript dom implementations. usage in javascript htmlcollection also exposes its members directly as properties by both name and index. html ids may contain : and . as valid characte...
HTMLDialogElement: cancel event - Web APIs
living standard ...
HTMLDialogElement: close event - Web APIs
living standard ...
HTMLDocument - Web APIs
n find documentation for the members of htmldocument under the document interface. specifications html living standardthe definition of 'htmldocument' in that specification. living standard turn the htmldocument interface into a document extension. document object model (dom) level 2 html specificationthe definition of 'htmldocument' in that specification. obsolete supersedes dom 1 document object model (dom) level 1 specificationthe definition of 'htmldocument' in that specification. obsolete initial definition ...
HTMLElement.click() - Web APIs
Web › API › HTMLElement › click
this event then bubbles up to elements higher in the document tree (or event chain) and fires their click events. ...
HTMLElement.dir - Web APIs
Web › API › HTMLElement › dir
arabic languages and hebrew are typical languages using the rtl directionality. an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. ...
inert - Web APIs
Web › API › HTMLElement › inert
the focus inside the modal when it's visible. according to the spec: when a node is inert, then the user agent must act as if the node was absent for the purposes of targeting user interaction events, may ignore the node for the purposes of text search user interfaces (commonly known as "find in page"), and may prevent the user from selecting text in that node. polyfills currently, browser support is lacking. check out the following polyfills: inert ...
HTMLElement: pointercancel event - Web APIs
: a hardware event occurs that cancels the pointer activities. this may include, for example, the user switching applications using an application switcher interface or the "home" button on a mobile device. the device's screen orientation is changed while the pointer is active. the browser decides that the user started pointer input accidentally. this can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events. the touch-action css property prevents the input from continuing. after the pointercancel event is fired, the browser will also send pointerout followed by pointerleave. examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('p...
HTMLElement: pointerenter event - Web APIs
the pointerenter event fires when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown). bubbles no cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: const para = document.queryselector('p'); para.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer event...
HTMLElement: pointerout event - Web APIs
the pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. bubbles yes cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: const para = document.queryselector('p'); para.onpointerout = (event) => { console.log('pointe...
HTMLElement - Web APIs
returns a domsettabletokenlist… htmlelement.itemprop read only returns a domsettabletokenlist… htmlelement.itemvalue returns a object representing the item value. htmlelement.lang is a domstring representing the language of an element's attributes, text, and element contents. htmlelement.nomodule is a boolean indicating whether an import script can be executed in user agents that support module scripts. htmlorforeignelement.nonce returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed. htmlelement.offsetheight read only returns a double containing the height of an element, relative to the layout. htmlelement.offsetleft read only returns a double, the distance from this element's...
HTMLFontElement.color - Web APIs
...
HTMLFontElement.size - Web APIs
...
HTMLFontElement - Web APIs
...
HTMLFormElement.acceptCharset - Web APIs
this list can be comma-separated or space-separated. ...
HTMLFormElement.name - Web APIs
element overrides the form.name property, so that you can't access it. internet explorer (ie) does not allow the name attribute of an element created using createelement() to be set or modified using the name property. syntax var string = form.name; form.name = string; example var form1name = document.getelementbyid('form1').name; if (form1name != document.form.form1) { // browser doesn't support this form of reference } specifications specification status comment html living standardthe definition of 'htmlformelement: name' in that specification. living standard ...
HTMLImageElement - Web APIs
is empty or null. the specified src url is the same as the url of the page the user is currently on. the specified image is corrupted in some way that prevents it from being loaded. the specified image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were specified in the <img> element's attributes. the specified image is in a format not supported by the user agent. example var img1 = new image(); // image constructor img1.src = 'image1.png'; img1.alt = 'alt'; document.body.appendchild(img1); var img2 = document.createelement('img'); // use dom htmlimageelement img2.src = 'image2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifications ...
HTMLInputElement.multiple - Web APIs
the htmlinputelement.multiple property indicates if an input can have more than one value. firefox currently only supports multiple for <input type="file">. example // fileinput is a <input type=file multiple> let fileinput = document.getelementbyid('myfileinput'); if (fileinput.multiple == true) { for (let i = 0; i < fileinput.files.length; i++) { // loop fileinput.files } // only one file available } else { let file = fileinput.files.item(0); } ...
HTMLInputElement.select() - Web APIs
input type="text" id="text-box" size="20" value="hello world!"> <button onclick="selecttext()">select text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.select(); } result notes calling element.select() will not necessarily focus the input, so it is often used with htmlelement.focus(). ...
HTMLInputElement.setSelectionRange() - Web APIs
selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password. chrome, starting from version 33, throws an exception while accessing those properties and method on the rest of input types. for example, on input of type number: "failed to read the 'selectionstart' property from 'htmlinputelement': the input element's type ('number') does not support selection". if you wish to select all text of an input element, you can use the htmlinputelement.select() method instead. syntax element.setselectionrange(selectionstart, selectionend [, selectiondirection]); parameters if selectionend is less than selectionstart, then both are treated as the value of selectionend. selectionstart the 0-based index of the first selected character. an...
HTMLInputElement.stepUp() - Web APIs
o exceed the set max value, or defy the constraints set by the step attribute. if the value before invoking the stepup() method is invalid—for example, if it doesn't match the constraints set by the step attribute—invoking the stepup() method will return a value that does match the form controls constraints. 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 exception is thrown. syntax element.stepup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. example click the button in ...
HTMLLinkElement - Web APIs
htmllinkelement.target is a domstring representing the name of the target frame to which the resource applies. methods no specific method; inherits methods from its parent, htmlelement, and linkstyle. specifications specification status comment preload candidate recommendation defines <link rel="preload">, and the as property. note that currently firefox only supports preloading of cacheable resources. html living standardthe definition of 'htmllinkelement' in that specification. living standard adds the following properties: crossorigin, referrerpolicy, and as. html 5.1the definition of 'htmllinkelement' in that specification. recommendation html5the definition of 'htmllinkelement' in that specification. recomme...
HTMLMediaElement.defaultPlaybackRate - Web APIs
the htmlmediaelement.defaultplaybackrate property indicates the default playback rate for the media. syntax var dspeed = video.defaultplaybackrate; audio.defaultplaybackrate = 1.0; value a double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. the value 0.0 is invalid and throws a not_supported_err exception. example var obj = document.createelement('video'); console.log(obj.defaultplaybackrate); // 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.defaultplaybackrate' in that specification. living standard no change from html5 html5the definition of 'htmlmediaelement.defaultplaybackrate' in that specification. recomm...
HTMLMediaElement.load() - Web APIs
ffect. syntax mediaelement.load(); parameters none. return value undefined. usage notes calling load() aborts all ongoing operations involving this media element, then begins the process of selecting and loading an appropriate media resource given the options specified in the <audio> or <video> element and its src attribute or child <source> element(s). this is described in more detail in supporting multiple formats in video and audio content. the process of aborting any ongoing activities will cause any outstanding promises returned by play() being resolved or rejected as appropriate based on their status before the loading of new media can begin. pending play promises are aborted with an "aborterror" domexception. appropriate events will be sent to the media element itself as the ...
HTMLMediaElement.play() - Web APIs
an exception name passed in as its sole input parameter (as opposed to a traditional exception being thrown). possible errors include: notallowederror the user agent (browser) or operating system doesn't allow playback of media in the current context or situation. this may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button. notsupportederror the media source (which may be specified as a mediastream, mediasource, blob, or file, for example) doesn't represent a supported media format. other exceptions may be reported, depending on browser implementation details, media player implementation, and so forth. usage notes although the term "autoplay" is usually thought of as referring to pages that immediately begin playing m...
HTMLMediaElement.seekToNextFrame() - Web APIs
you should not use this method in production code, because its implementation may change—or be removed outright—without notice. you are, however, invited to experiment with it. this method lets you access frames of video media without the media being performed in real time. ...
HTMLOrForeignElement.tabIndex - Web APIs
the tabindex property of the htmlorforeignelement interface represents the tab order of the current element. tab order is as follows: elements with a positive tabindex. elements that have identical tabindex values should be navigated in the order they appear. navigation proceeds from the lowest tabindex to the highest tabindex. elements that do not support the tabindex attribute or support it and assign tabindex to 0, in the order they appear. elements that are disabled do not participate in the tabbing order. values don't need to be sequential, nor must they begin with any particular value. they may even be negative, though each browser trims very large values. syntax element.tabindex = index; var index = element.tabindex; value index is an integer example const b1 = document...
HTMLSelectElement.selectedOptions - Web APIs
ed to let the user order various food items. html the html that creates the selection box and the <option> elements representing each of the food choices looks like this: <label for="foods">what do you want to eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <button name="order" id="order"> order now </button> <p id="output"> </p> the <select> element is set to allow multiple items to be selected, and it is 7 rows tall. note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected prop...
HTMLStyleElement.type - Web APIs
warncss(); } ...
HTMLTableCellElement - Web APIs
taining the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablecellelement.ch a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional 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 scripts; or at the left for right-to-left scripts) of the character defined by htmltablecellelement.ch. this property was optional and was not very well supported. htmltablecellelement.height a domstring containing a length of pixel of the hinted h...
HTMLTableRowElement - Web APIs
htmlcollection is live and is automatically updated when cells are added or removed. htmltablerowelement.ch is a domstring containing one single character. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablerowelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well supported. htmltablerowelement.rowindex read only returns a long value which gives the logical ...
HTMLTableSectionElement - Web APIs
lcollection is live and is automatically updated when rows are added or removed. htmltablesectionelement.ch is a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablesectionelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well supported. htmltablesectionelement.valign is a domstring representing an enumerated value ...
HTMLTextAreaElement - Web APIs
create a textarea with a maximum number of characters per line and a maximum number of lines: first, create a function that takes the text field and a key event as input and determines if any of the limits have been reached. if the limit has not been reached, it will return the key. ...
HTMLVideoElement.msIsStereo3D - Web APIs
...
HTMLVideoElement - Web APIs
the htmlvideoelement interface provides special properties and methods for manipulating video objects. it also inherits properties and methods of htmlmediaelement and htmlelement. the list of supported media formats varies from one browser to the other. you should either provide your video in a single format that all the relevant browsers supports, or provide multiple video sources in enough different formats that all the browsers you need to support are covered. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
l public, and the expected amount of code that would be handled by javascript was relatively low at that time. as time passed, of course, we know that computers have evolved into powerful multi-core systems, and javascript has become one of the most prolifically-used languages in the computing world. a vast number of the most popular applications are based at least in part on javascript code. to support this, it was necessary to find ways to allow for projects to escape the limitations of a single-threaded language. starting with the addition of timeouts and intervals as part of the web api (settimeout() and setinterval()), the javascript environment provided by web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application devel...
IDBCursor - Web APIs
Web › API › IDBCursor
...
IDBVersionChangeEvent - Web APIs
on read only returns the new version of the database. deprecated properties idbversionchangeevent.version read only the new version of the database in a versionchange transaction. warning: while this property is still implemented in older browsers, the latest specification replaces it with the oldversion and newversion attributes. see the compatibility table to know what browsers support them. methods no specific method, but inherits properties from its parent, method. example in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. upon a version change (after an upgradedneeded event), the success event will implement the idbversionchangeevent interface. for a full working example, see our to-do notif...
IIRFilterNode.getFrequencyResponse() - Web APIs
ay of frequencies, specified in hertz, which you want to filter. magresponseoutput a float32array to receive the computed magnitudes of the freqency response for each frequency value in the frequencyarray. phaseresponseoutput a float32array to receive the computed phase response values in radians for each frequency value in the input frequencyarray. return value undefined exceptions notsupportederror the three arrays provided are not all of the same length. examples in the following example we are using an iir filter on a media stream (for a complete full demo, see our stream-source-buffer demo live, or read its source.) as part of this demo, we get the frequency responses for this iir filter, for five sample frequencies. we first create the float32array objects we need, one co...
IdleDeadline.didTimeout - Web APIs
the read-only didtimeout property on the idledeadline interface is a boolean value which indicates whether or not the idle callback is being invoked because the timeout interval specified when window.requestidlecallback() was called has expired. if didtimeout is true, the idledeadline object's timeremaining() method will return approximately 0. idle callbacks support the concept of a timeout in order to ensure that whatever task they're meant to perform actually happens, even if the user agent never has enough idle time available. your callback will typically check the value of didtimeout if it needs to perform an action even if the browser is too busy to grant you the time; you should react by performing the needed task or, ideally, a minimal amount of work that can be done to keep things...
ImageCapture.getPhotoSettings() - Web APIs
n settings. syntax const settingspromise = imagecapture.getphotosettings() return value a promise that resolves with a photosettings object containing the following properties: filllightmode: the flash setting of the capture device, one of "auto", "off", or "on". imageheight: the desired image height as an integer. the user agent selects the closest width value to this setting if it only supports discrete heights. imagewidth: the desired image width as an integer. the user agent selects the closest width value to this setting if it only supports discrete widths. redeyereduction: a boolean indicating whether the red-eye reduction should be used if it is available. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from...
startSoftwareUpdate - Web APIs
lltrigger object syntax boolean startsoftwareupdate ( string url); parameters the startsoftwareupdate method has the following parameter: url a uniform resource locator specifying the location of the xpi file containing the software. returns true. description the startsoftwareupdate method triggers a software download and install from the specified url. this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. note also that xpis installed with this method must have their own install.js files in which the full installation is defined. ...
KeyboardEvent.initKeyboardEvent() - Web APIs
web applications should use constructor instead of this if it's available. ...
KeyboardEvent.key - Web APIs
Web › API › KeyboardEvent › key
ntation dependent interval and the keyboardevent.repeat read only property is set to true. if the key produces a character key that would result in a character being inserted into possibly an <input>, <textarea> or an element with htmlelement.contenteditable set to true, the beforeinput and input event types are fired in that order. note that some other implementations may fire keypress event if supported. the events will be fired repeatedly while the key is held down. a keyup event is fired once the key is released. this completes the process. in sequence 1 & 3, the keyboardevent.key attribute is defined and is set appropriately to a value according to the rules defined ealier. keyboardevent sequence example consider the event sequence generated when we interact with the shift and the ...
KeyframeEffect.setKeyframes() - Web APIs
yellow", "green" ], // offset: 0, 0.5, 1 }, 2000); the special keys offset, easing, and composite (described below) may be specified alongside the property values. element.animate({ opacity: [ 0, 0.9, 1 ], offset: [ 0, 0.8 ], // shorthand for [ 0, 0.8, 1 ] easing: [ 'ease-in', 'ease-out' ], }, 2000); after generating a suitable set of keyframes from the property value lists, each supplied offset is applied to the corresponding keyframe. if there are insufficient values, or if the list contains null values, the keyframes without specified offsets will be evenly spaced as with the array format described above. if there are too few easing or composite values, the corresponding list will be repeated as needed. implicit to/from keyframes in newer browser versions, you are ...
LargestContentfulPaint - Web APIs
e || lastentry.loadtime; }); po.observe({type: 'largest-contentful-paint', buffered: true}); // send data to the server. addeventlistener('visibilitychange', function fn() { if (lcp && document.visibilitystate === 'hidden') { console.log('lcp:', lcp); removeeventlistener('visibilitychange', fn, true); } }, true); } catch (e) { // do nothing if the browser doesn't support this api. } specifications specification status comment largest contentful paintthe definition of 'largestcontentfulpaint' in that specification. editor's draft initial definition. ...
LayoutShift - Web APIs
} specifications specification status comment layout instability apithe definition of 'layoutshift' in that specification. editor's draft initial definition. ...
LocalFileSystem - Web APIs
localfilesystemurl() lets you look up the entry for a file or directory with a local url. void resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters url the url of a local file in the file system. successcallback the success callback that is called when the browser provides the file or directory for the supplied url. errorcallback the error callback that is called when errors happen or when the request to obtain the entry object is denied. returns void exceptions this method can raise an fileerror with the following code: exception description encoding_err the syntax of the url was invalid. not_found_err the url was structurally correct, but refers to a...
LockedFile.getMetadata() - Web APIs
llows to retrieve some metadata about the locked file. syntax var request = instanceoflockedfile.getmetadata(param); parameters param optional an object used to request specific metadata. each key is a boolean where true means the metadata is expected and where false means it is not expected. note that if the key is undefined, it is considered as if it were true. the following metadata are supported: size : will provide the size of the file lastmodified : will provide the date when the file was last modified return a filerequest object. in case of success, the request's result is an object with the metadata requested through the param object. they have the following format: size : a number lastmodified : a date object specifications specification status co...
MIDIAccess - Web APIs
s, and obtaining access to those devices. properties midiaccess.inputs read only returns an instance of midiinputmap which provides access to any available midi input ports. midiaccess.outputs read only returns an instance of midioutputmap which provides access to any available midi output ports. midiaccess.sysexenabled read only a boolean attribute indicating whether system exclusive support is enabled on the current midiaccess instance. event handlers midiaccess.onstatechange called whenever a new midi port is added or an existing port changes state. examples navigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.onsta...
MIDIMessageEvent - Web APIs
sageevent creates a new midimessageevent object instance. properties midiconnectionevent.data a uint8array containing the data bytes of a single midi message. see the midi specification for more information on its form. note: even though the web midi api specifies a receivedtime property that returns a domhighrestimestamp, chrome (the only implementation at the time of writing) does not support that property since the basic event.timestamp property already returns a domhighrestimestamp in chrome. examples // printing all messages to console navigator.requestmidiaccess().then(midiaccess => { array.from(midiaccess.inputs).foreach(input => { input[1].onmidimessage = console.log; }) }); specifications specification status comment web midi apithe defi...
MSCandidateWindowHide - Web APIs
mentations and the behavior may change in the future. mscandidatewindowhide fires after the input method editor (ime) candidate window closes and is fully hidden. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mscandidatewindowhide", handler, usecapture) nbsp; parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interf...
MSCandidateWindowShow - Web APIs
or may change in the future. mscandidatewindowshow fires immediately after the input method editor (ime) candidate window is set to appear, but before it renders. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface f...
MSCandidateWindowUpdate - Web APIs
ndidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any visual updates have rendered. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interfa...
MSRangeCollection - Web APIs
the msrangecollection object is an array of one or more range objects. ...
MSSiteModeEvent - Web APIs
deprecated. preventdefault cancels the default action of an event. stopimmediatepropagation prevents any further propagation of an event. stoppropagation prevents propagation of an event beyond the current target. properties property description actionurl gets the url of a jump list item that is removed. *this property is not supported for windows store apps using javascript. bubbles gets a value that indicates whether an event propagates up from the event target. buttonid gets the thumbnail toolbar button id that is clicked. *this property is not supported for windows store apps using javascript. cancelable gets a value that indicates whether you can cancel an event's default action. ...
MediaCapabilitiesInfo - Web APIs
...
MediaCapabilities - Web APIs
itrates. the information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient. the information is accessed through the mediacapabilities property of the navigator interface. methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient. mediacapabilities.decodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient. specifications specification status comment media capabilitiest...
MediaDeviceInfo - Web APIs
exists or the user has granted persistent permission for media device access. the set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user. methods none. example here's an example that uses enumeratedevices() to get a list of devices. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones. navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpu...
MediaDevices.enumerateDevices() - Web APIs
se is fulfilled. each object in the array describes one of the available media input and output devices. if enumeration fails, the promise is rejected. example here's an example of using enumeratedevices(). it simply outputs a list of the device ids, with their labels if available. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } // list cameras and microphones. navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpu...
MediaError.code - Web APIs
Web › API › MediaError › code
ted by the user's request. media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available. media_err_decode 3 despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error. media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable. example this example creates a <video> element, establishes an error handler for it, and then sets the element's src attribute to the video resource to present in the element. the error handler simply outputs a message var obj = document.createelement('video'); obj.oner...
MediaError.message - Web APIs
switch(err.code) { case mediaerror.media_err_aborted: s += "the user canceled the audio."; break; case mediaerror.media_err_network: s+= "a network error occurred while fetching the audio."; break; case mediaerror.media_err_decode: s+= "an error occurred while decoding the audio."; break; case mediaerror.media_err_src_not_supported: s+= "the audio is missing or is in a format not supported by your browser."; break; default: s += "an unknown error occurred."; break; } let message = err.message; if (message && message.length) { s += " " + message; } displayerrormessage("<strong>error " + err.code + ":</strong> " + s + "<br>"); }; this gets the mediaer...
MediaError - Web APIs
ted by the user's request. media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available. media_err_decode 3 despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error. media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable. mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diag...
MediaImage - Web APIs
contexts, like player interface to show the current playing video or audio track. properties src the url from which user agent can fetch the image's data. sizes specifies the resource in multiple sizes so that user agent does not have to scale a single image. type the mime type hint for the user agant. note that it is just a hint so that user agent may ignore images of types it does not support; user agent still may use mime type sniffing after downloading the image to determine its type. specifications specification status comment media session standardthe definition of 'mediaimage' in that specification. draft initial definition. ...
getConfiguration() - Web APIs
the mediakeysystemaccess.getconfiguration() method returns a mediakeysystemconfiguration object with the supported combination of configuration options. syntax var mediakeysystemconfiguration = mediakeysystemaccess.getconfiguration(); specifications specification status comment encrypted media extensionsthe definition of 'getconfiguration()' in that specification. recommendation initial definition ...
MediaKeySystemAccess - Web APIs
e of this object using the navigator.requestmediakeysystemaccess() method. properties mediakeysystemaccess.keysystem read only returns a domstring identifying the key system being used. methods mediakeysystemaccess.createmediakeys() returns a promise that resolves to a new mediakeys object. mediakeysystemaccess.getconfiguration() returns a mediakeysystemconfiguration object with the supported combination of configuration options. specifications specification status comment encrypted media extensionsthe definition of 'mediakeysystemaccess' in that specification. recommendation initial definition. ...
audioCapabilities - Web APIs
the mediakeysystemconfiguration.audiocapabilities read-only property returns an array of supported audio type and capability pairs. syntax var audiocapabilities[ {contenttype: 'contenttype', robustness:'robustness'}] = mediasystemconfiguration.audiocapabilities; specifications specification status comment encrypted media extensionsthe definition of 'audiocapabilities' in that specification. recommendation initial definition ...
initDataTypes - Web APIs
an initialization data type is a string indicating the format of the initialization data. ...
videoCapabilities - Web APIs
the mediakeysystemconfiguration.videocapabilities read-only property returns an array of supported video type and capability pairs. syntax var videocapabilities[{contenttype: 'contenttype', robustness:'robustness'}] = mediasystemconfiguration.videocapabilities; specifications specification status comment encrypted media extensionsthe definition of 'videocapabilities' in that specification. recommendation initial definition ...
MediaKeySystemConfiguration - Web APIs
the mediakeysystemconfiguration dictionary holds configuration information about the media key system in use. properties mediakeysystemconfiguration.initdatatypes read only returns a list of supported initialization data type names. an initialization data type is a string indicating the format of the initialization data. mediakeysystemconfiguration.audiocapabilities read only returns a list of supported audio type and capability pairs. mediakeysystemconfiguration.videocapabilities read only returns a list of supported video type and capability pairs. mediakeysystemconfiguration.distinctiveidentifier read only indicates whether a persistent distinctive identifier is required. mediakeysystemconfiguration.persistentstate read only indicates whether the ability to per...
MediaQueryList.onchange - Web APIs
the event object is a mediaquerylistevent instance, which is recognised as a medialistquery instance in older browsers, for backwards compatibility purposes. syntax mediaquerylist.onchange = function() { ... ...
MediaQueryList - Web APIs
you can create a mediaquerylist by calling matchmedia() on the window object. the resulting object handles sending notifications to listeners when the media query state changes (i.e. when the media query test starts or stops evaluating to true). this is very useful for adaptive design, since this makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status. ...
MediaRecorder: error event - Web APIs
bubbles no cancelable no interface mediarecordererrorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror. ...
MediaRecorder.onerror - Web APIs
s made on a source that has been deleted or removed. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid. unknownerror an non-security related error occurred that cannot otherwise be categorized. recording stops, the mediarecorder's state becomes inactive, one last dataavai...
MediaRecorder.start() - Web APIs
mediarecorder object. you can implement the onerror event handler to respond to these errors. invalidmodificationerror the number of tracks on the stream being recorded has changed. you can't add or remove tracks while recording media. invalidstateerror the mediarecorder is not in the inactive state; you can't start recording media if it's already being recorded. see the state property. notsupportederror the media stream you're attempting to record is inactive, or one or more of the stream's tracks is in a format that can't be recorded using the current configuration. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happen...
MediaRecorder.stream - Web APIs
the mediarecorder.stream read-only property returns the stream that was passed into the mediarecorder() constructor when the mediarecorder was created. syntax var stream = mediarecorder.stream values the mediastream passed into the mediarecorder() constructor when the mediarecorder was originally created. example if (navigator.getusermedia) { console.log('getusermedia supported.'); navigator.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { var mediarecorder = new mediarecorder(stream); var mystream = mediarecorder.stream; console.log(mystream); ... specifications specification status comment mediastream recordin...
MediaRecorderErrorEvent.error - Web APIs
g of media recording, including these specifically identified by the specification. the descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the specified options weren't valid. the message atttribute should provide additional information, if it exists. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a m...
MediaSession.setPositionState() - Web APIs
call this method on the navigator object's mediasession object. ...
MediaSource.endOfStream() - Web APIs
example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuf...
MediaSource.removeSourceBuffer() - Web APIs
the removesourcebuffer() method of the mediasource interface removes the given sourcebuffer from the sourcebuffers list associated with this mediasource object. syntax mediasource.removesourcebuffer(sourcebuffer); parameters sourcebuffer the sourcebuffer object to be removed. return value undefined exceptions exception explanation notfounderror the supplied sourcebuffer doesn't exist in mediasource.sourcebuffers. examples for (i = 0; i < 10; i++) { var sourcebuffer = mediasource.addsourcebuffer(mimecodec); } mediasource.removesourcebuffer(mediasource.sourcebuffers[0]); specifications specification status comment media source extensionsthe definition of 'removesourcebuffer()' in that specification. recomm...
MediaStreamAudioSourceNode() - Web APIs
working draft ...
MediaStreamTrack.getCapabilities() - Web APIs
owser's capabilities are, your script can use applyconstraints() to ask for the track to be configured to match ideal or acceptable settings. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const capabilities = track.getcapabilities() return value a mediatrackcapabilities object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties. specifications specification status comment media capture and streamsthe definition of 'getcapabilities()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack - Web APIs
ned event handler property. unmute sent to the track when data becomes available again, ending the muted state. also available through the onunmute event handler property. specifications specification status comment identity for webrtcthe definition of 'isolated tracks' in that specification. candidate recommendation additional properties for isolated track support media capture and streamsthe definition of 'mediastreamtrack' in that specification. candidate recommendation initial definition ...
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
working draft ...
MediaStream Recording API - Web APIs
r 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media. if you need or want to check to see if a specific mime type is supported, that's possible as well. just call mediarecorder.istypesupported(). examining potential input sources if your goal is to record camera and/or microphone input, you may wish to examine the available input devices before beginning the process of constructing the mediarecorder. to do so, you'll need to call navigator.mediadevices.enumeratedevices() to get a list of the available media devic...
MediaTrackConstraints.displaySurface - Web APIs
atrackconstraints dictionary's displaysurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the displaysurface constrainable property. this is used to specify the type or types of display surfaces which getdisplaymedia() will let the user select among for sharing purposes. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.displaysurface as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring ...
MediaTrackConstraints.echoCancellation - Web APIs
the mediatrackconstraints dictionary's echocancellation property is a constrainboolean describing the requested or mandatory constraints placed upon the value of the echocancellation constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this valu...
MediaTrackConstraints.logicalSurface - Web APIs
e logicalsurface constrainable property. this is used to specify whether or not getdisplaymedia() should allow the user to choose display surfaces which are not necessarily fully visible on the screen, such as occluded windows or the complete content of windows which are large enough to require scrolling to see their entire contents. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.logicalsurface as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { logicalsurface: constraint }; constraintsobject.logicalsurface = constraint; value a constrainboolean wh...
MediaTrackControls.volume - Web APIs
the mediatrackconstraints dictionary's volume property is a constraindouble describing the requested or mandatory constraints placed upon the value of the volume constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { volume: constraint }; constraintsobject.volume = constraint; value a constraindouble describing the acceptable or required value(s) for an audio track's volume, on a linear scale where 0.0 means silence and 1.0 is the highest supported volume. if this value ...
MediaTrackSettings.aspectRatio - Web APIs
ng the aspect ratio of the mediastreamtrack as currently configured. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.aspectratio property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.aspectratio as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var aspectratio = mediatracksettings.aspectratio; value a double-precision floating-point number indicating the current configuration ...
MediaTrackSettings.autoGainControl - Web APIs
ither getusermedia() or mediastreamtrack.applyconstraints(). automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. this feature is typically used on microphones, although it can be provided by other input sources as well. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.autogaincontrol as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var autogaincontrol = mediatracksettings.autogaincontrol; value a boolean value which is true if the track has automatic gain cont...
MediaTrackSettings.channelCount - Web APIs
audio channel the mediastreamtrack is currently configured to have. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.channelcount property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.channelcount as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var channelcount = mediatracksettings.channelcount; value an integer value indicating the number of audio channels on the track. a va...
MediaTrackSettings.deviceId - Web APIs
tifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.deviceid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var devic...
MediaTrackSettings.displaySurface - Web APIs
e stream presents the complete contents of one or more of the user's screens. any empty space (if the displays are of different dimensions) is filled with a backdrop chosen by the user agent. window the stream's video track presents the contents of a single window selected by the user. the window may be from any application, not necessarily just from within the user agent. not all user agents support all of these surface types. specifications specification status comment screen capturethe definition of 'mediatracksettings.displaysurface' in that specification. working draft initial definition ...
MediaTrackSettings.echoCancellation - Web APIs
e which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device. for example, it might apply a filter that negates the sound being produced on the speakers from being included in the input track generated from the microphone. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax v...
MediaTrackSettings.facingMode - Web APIs
video track represented by the mediastreamtrack is currently facing. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.facingmode property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var fac...
MediaTrackSettings.frameRate - Web APIs
in frames per second, of the mediastreamtrack as currently configured. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.framerate property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.framerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var framerate = mediatracksettings.framerate; value a double-precision floating-point number indicating the current configuration of the...
MediaTrackSettings.groupId - Web APIs
sion unique domstring which identifies the group of devices which includes the source for the mediastreamtrack. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.groupid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var groupi...
MediaTrackSettings.height - Web APIs
the number of pixels tall mediastreamtrack is currently configured to be. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.height property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.height as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var height = mediatracksettings.height; value an integer value indicating the height, in pixels, of the video track as currently configured...
MediaTrackSettings.latency - Web APIs
with your specified constraints for this property's value as described in the mediatrackconstraints.latency property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). this is, of course, an approximation, since latency can vary for many reasons including cpu, transmission, and storage overhead. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var latenc...
MediaTrackSettings.sampleRate - Web APIs
samples per second the mediastreamtrack is currently configured for. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.samplerate property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplerate = mediatracksettings.samplerate; value an integer value indicating how many samples each second of audio data includes. ...
MediaTrackSettings.sampleSize - Web APIs
in bits per sample) the mediastreamtrack is currently configured for. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.samplesize property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplesize as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplesize = mediatracksettings.samplesize; value an integer value indicating how many bits each audio sample is represented by. th...
MediaTrackSettings.volume - Web APIs
the mediatracksettings dictionary's volume property is a double-precision floating-point number indicating the volume of the mediastreamtrack as currently configured, as a value from 0.0 (silence) to 1.0 (maximum supported volume for the device). this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.volume property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints ...
MediaTrackSettings.width - Web APIs
the number of pixels wide mediastreamtrack is currently configured to be. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.width property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the video track as currently configured. e...
MerchantValidationEvent() - Web APIs
rchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validationurl could not be parsed as a url. rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent.complete() - Web APIs
he rejection handler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code. another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated. example in this example, we see the client-side code needed to support merchant validation for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation data from the url... */ } this code sets up a handler for the merchantvalidation event. the event handle...
MessagePort: message event - Web APIs
the message event is fired on a messageport object when a message arrives on that channel. ...
MessagePort: messageerror event - Web APIs
the messageerror event is fired on a messageport object when it receives a message that can't be deserialized. ...
Microdata DOM API - Web APIs
collection[name] returns a propertynodelist object containing any elements that add a property named name. the name index has to be one of the values listed in the names list. collection . names returns an array with the property names of the elements in the collection. propertynodelist . getvalues() returns an array of the various values that the relevant elements have. the object's supported property indices are as defined for htmlcollection objects. the supported property names consist of the property names of all the elements represented by the collection, in tree order, ignoring later duplicates. the names attribute must return a live read only array object giving the property names of all the elements represented by the collection, listed in tree order, but with duplicate...
Microsoft API extensions - Web APIs
these extensions are prefixed with ms or ms. note: these apis will only work in microsoft applications, and are not on a standards track. ...
MimeType - Web APIs
Web › API › MimeType
e type of the associated plugin. mimetype.description returns a description of the associated plugin or an empty string if there is none. mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. for example, a browser's content decryption module may appear in the plugin list but support more file extensions than can be anticipated. it might therefore return an empty string. mimetype.enabledplugin returns an instance of plugin containing information about the plugin itself. specifications specification status comment html living standardthe definition of 'mimetype' in that specification. living standard initial definition. ...
MimeTypeArray - Web APIs
the mimetypearray interface returns an array of mimetype instances, each of which contains information about a supported browser plugins. this object is returned by navigatorplugins.mimetypes. properties mimetypearray.length the number of items in the array. methods mimetypearray.item() returns the mimetype object with the specified index. mimetypearray.nameditem() returns the mimetype object with the specified name. example the following example tests whether a plugin is available for the application/pdf mime type and if so, which plugin that is. var mimetypes = navigator.mimetype; var flashplugin = mimetypes['video/x-flv']; if (typeof flashplugin === "undefined") { var vid = document.createelement('video'); // use vid.canplaytype() to test for a supported mime type. ...
msFirstPaint - Web APIs
this proprietary property is specific to internet explorer and microsoft edge. syntax p = object.msfirstpaint; value an integer value that represents the time when the document began to be displayed or 0 if the document could not be loaded. the numerical value reported represents the number of milliseconds between the recorded time and midnight january 1, 1970 (utc). this property is supported only for documents displayed in ie9 standards mode. example the following example shows how to calculate the time that is required to request the document before the document begins to display for the user. var otiming = window.performance.timing; var itimems = otiming.msfirstpaint - otiming.navigationstart; ...
NDEFMessage - Web APIs
constructor ndefmessage.ndefmessage() returns a new ndefmessage containing specified data. ...
NDEFReader.onreading - Web APIs
the onreading property of ndefreader interface of the web nfc api is called whenever a new reading is available from compatible nfc devices, e.g. nfc tags supporting ndef, when these devices are within the reader's magnetic induction field. specifications specification status comment web nfc, ndefreader.onreadig draft initial definition. ...
NDEFReader.scan() - Web APIs
Web › API › NDEFReader › scan
with undefined immediatelly after scheduling read operations for the nfc adapter. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: aborterror the scan operation was aborted with abortsignal passed in options. notallowederror the permission for this operation was rejected. notsupportederror there is no nfc adapter compatible with web nfc, or a connection can not be established. specifications specification status comment web nfc, scan() draft initial definition. ...
NDEFReader - Web APIs
constructor ndefreader.ndefreader() returns an ndefreader with configuration specified in the parameters or default ones if no parameters are specified. properties in addition to the properties listed below, ndefreader inherits properties from its parent interface, eventtarget. ndefreader.onreading an event handler for reading event, that notifies about availability of a new reading. ...
NDEFRecord() - Web APIs
the ndefrecord() constructor of the web nfc api returns a newly constructed ndefrecord object that represents data that can be read from or written to compatible nfc devices, e.g. nfc tags supporting ndef. syntax writer = new ndefrecord(ndefrecordinit); parameters ndefrecordinit read only ndefrecordinit with initialization data. return value a new ndefrecord. specifications specification status comment web nfc, ndefrecord draft initial definition. ...
NDEFRecord.toRecords() - Web APIs
the torecords() method of the ndefrecord interface of web nfc api parses record payload ndefrecord.data besed on ndefrecord.recordtype and returns the result. in practice, it's possible to implement the parsing mechanism manually, but this method simplifies the process. syntax ndefrecord.torecords() parameters none. return value a list of ndefrecords. exceptions notsupported the user agent does not know how to parse this combination of ndefrecord.data and ndefrecord.recordtype. specifications specification status comment web nfc, ndefrecord.torecords() draft initial definition. ...
NDEFRecord - Web APIs
constructor ndefrecord() returns a new ndefrecord with configuration specified in the parameters or default ones if no parameters are specified. attributes ndefrecord.recordtype read only represents the ndef record type. ndefrecord.mediatype read only represents the mime type of the ndef record payload. ndefrecord.id read only represents the identificator of the record. ...
NDEFWriter.write() - Web APIs
Web › API › NDEFWriter › write
ssfully completed. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: aborterror the write operation was aborted with abortsignal passed in options. notallowederror the permission for this operation was rejected or overwrite is false and there are already records on the tag. notsupportederror there is no nfc adapter compatible with web nfc, or the available nfc adapter does not support pushing messages, or connection can not be established. notreadableerror the ua is not allowed to access underlying nfc adapter (e.g., due to user preference). networkerror transfer failed after it already started (e.g., the tag was removed from the reader). specifications sp...
NDEFWriter - Web APIs
constructor ndefwriter.ndefwriter() returns an ndefwriter. ...
Navigator.cookieEnabled - Web APIs
ng to set a cookie in such scenario would fail). it returns false in firefox and chromium-based browsers. note: web browsers may prevent writing certain cookies in certain scenarios. for example, chrome 80+ does not allow creating cookies with samesite=none attribute, unless they are created over https and with secure attribute. example if (!navigator.cookieenabled) { // the browser does not support or is blocking cookies from being set. } specifications specification status comment html living standardthe definition of 'navigator.cookieenabled' in that specification. living standard initial definition ...
Navigator.getUserMedia() - Web APIs
: true, video: { width: 1280, height: 720 } }, function(stream) { var video = document.queryselector('video'); video.srcobject = stream; video.onloadedmetadata = function(e) { video.play(); }; }, function(err) { console.log("the following error occurred: " + err.name); } ); } else { console.log("getusermedia not supported"); } ...
Navigator.maxTouchPoints - Web APIs
the maxtouchpoints read-only property of the navigator interface returns the maximum number of simultaneous touch contact points are supported by the current device. syntax touchpoints = navigator.maxtouchpoints; example if (navigator.maxtouchpoints > 1) { // browser supports multi-touch } specifications specification status comment pointer events – level 2the definition of 'maxtouchpoints' in that specification. recommendation non-stable version. pointer eventsthe definition of 'maxtouchpoints' in that specification. obsolete initial definition. ...
Navigator.msLaunchUri() - Web APIs
he uri, the successcallback is invoked, otherwise, the nohandlercallback is called. to help protect a user's privacy, windows displays a prompt for the user to allow the service or app to be launched. the user can choose to not see the prompt after the first instance for a particular protocol and automatically open the app or service without a user intervention. the mslaunchuri() method does not support http, secure hypertext transfer protocol (https), file transfer protocol (ftp), file, res, javascript, or microsoft visual basic scripting edition (vbscript) protocols. if the user's system does not have a program registered to handle a specific protocol, and a nohandlercallback is provided, windows internet explorer will invoke the nohandlercallback. this enables developers to provide a cus...
Navigator.registerContentHandler() - Web APIs
ri is the uri to the handler as a string. title is the title of the handler presented to the user as a string. example navigator.registercontenthandler( "application/vnd.mozilla.maybe.feed", "http://www.example.tld/?foo=%s", "my feed reader" ); notes for firefox 2 and above, only the application/vnd.mozilla.maybe.feed, application/atom+xml, and application/rss+xml mime types are supported. all values have the same effect, and the registered handler will receive feeds in all atom and rss versions (see bug 391286). firefox is the only browser that implemented this feature, and it wasn't implemented to match the standard. this feature has since been removed from the html standard and shouldn't be used. specifications specification status comment h...
Navigator.serviceWorker - Web APIs
igator.serviceworker read-only property returns the serviceworkercontainer object for the associated document, which provides access to registration, removal, upgrade, and communication with the serviceworker. the feature may not be available in private mode. syntax var workercontainerinstance = navigator.serviceworker; value serviceworkercontainer examples this code checks if the browser supports service workers. if ('serviceworker' in navigator) { // supported! } specifications specification status comment service workersthe definition of 'navigator.serviceworker' in that specification. working draft initial definition. ...
Navigator.vibrate() - Web APIs
Web › API › Navigator › vibrate
if a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead. if the method was unable to vibrate because of invalid parameters, it will return false, else it returns true. if the pattern leads to a too long vibration, it is truncated: the max length depends on the implementation. syntax var successbool = window.navigator.vibrate(pattern); pattern provides a pattern of vibration and pause intervals. ...
Navigator.onLine - Web APIs
twork state by listening for the events on window.ononline and window.onoffline. syntax online = window.navigator.online; value online is a boolean true or false. example view a live example. to check if you are online, query window.navigator.online, as in the following example: if (navigator.online) { console.log('online'); } else { console.log('offline'); } if the browser doesn't support navigator.online the above example will always come out as false/undefined. to see changes in the network state, use addeventlistener to listen for the events on window.online and window.offline, as in the following example: window.addeventlistener('offline', function(e) { console.log('offline'); }); window.addeventlistener('online', function(e) { console.log('online'); }); specification...
NavigatorPlugins.javaEnabled() - Web APIs
this method indicates whether the current browser is java-enabled or not. syntax result = window.navigator.javaenabled() example if (window.navigator.javaenabled()) { // browser has java } notes the return value for this method indicates whether the preference that controls java is on or off - not whether the browser offers java support in general. specifications specification status comment html living standardthe definition of 'navigatorplugins.javaenabled' in that specification. living standard initial definition. ...
NavigatorPlugins.plugins - Web APIs
of enumerating the navigator.plugins array and comparing every plugin's name. this privacy change does not disable any plugins; it just hides some plugin names from enumeration. syntax var plugins = navigator.plugins; plugins is pluginarray object used to access plugin objects either by name or as a list of items. the returned value is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods. examples the following example function returns the version of the shockwave flash plugin. function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); if (typeof flash != 'object') { // flash is not present return undefined; }...
NavigatorPlugins - Web APIs
navigatorplugins.plugins read only returns a pluginarray listing the plugins installed in the browser. methods the navigatorplugins interface doesn't inherit any methods. ...
Node.appendChild() - Web APIs
Web › API › Node › appendChild
osition. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child list of the specified parent node. newer api avaliable! the parentnode.append() method supports multiple arguments and appending strings. syntax element.appendchild(achild) parameters achild the node to append to the given parent node (commonly an element). return value the returned value is the appended child (achild), except when achild is a documentfragment, in which case the empty documentfragment is returned. notes chaining may not work as expected, due to appendchild...
Node.rootNode - Web APIs
Web › API › Node › rootNode
node() method. the node.rootnode read-only property returns a node object representing the topmost node in the tree, or the current node if it's the topmost node in the tree. this is found by walking backward along node.parentnode until the top is reached. syntax rootnode = node.rootnode; value a node object representing the topmost node in the tree. example running the following line in supporting browsers should return a reference to the html/document node: console.log(document.body.rootnode); notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get. ...
NodeList - Web APIs
Web › API › NodeList
e its length and item properties and cause errors if your script assumes it only has to deal with element objects. also, for..in is not guaranteed to visit the properties in any particular order. for...of loops will loop over nodelist objects correctly: const list = document.queryselectorall('input[type=checkbox]'); for (let checkbox of list) { checkbox.checked = true; } recent browsers also support iterator methods (foreach()) as well as entries(), values(), and keys(). there is also an internet explorer-compatible way to use array.prototype.foreach for iteration: const list = document.queryselectorall('input[type=checkbox]'); array.prototype.foreach.call(list, function (checkbox) { checkbox.checked = true; }); specifications specification status comment ...
Notification.maxActions - Web APIs
note: this feature is available in web workers. the maxactions attribute of the notification interface returns the maximum number of actions supported by the device and the user agent. effectively, this is the maximum number of elements in notification.actions array which will be respected by the user agent. syntax notification.maxactions value an integer number which indicates the largest number of notification actions that can be presented to the user by the user agent and the device. examples the following snippet logs the maximum number of supported actions. const maxactions = notification.maxactions; console.log('this device can display at most ' + maxactions + ' actions on each notification.'); specifications specification status comment ...
Notifications API - Web APIs
n web workers. the notifications api allows web pages to control the display of system notifications to the end user. these are outside the top-level browsing context viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app. the api is designed to be compatible with existing notification systems, across different platforms. concepts and usage on supported platforms, showing a system notification generally involves two things. first, the user needs to grant the current origin permission to display system notifications, which is generally done when the app or site initialises, using the notification.requestpermission() method. this should be done in response to a user gesture, such as clicking a button, for example: btn.addeventlistener('clic...
OES_element_index_uint - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. extended methods this extension extends webglrenderingcontext.drawelements(): the type parameter now accepts gl.unsigned_int. ...
OES_texture_float - Web APIs
inear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use floating-point textures, the texture will be marked as incomplete. to use linear filtering on floating-point textures, enable the oes_texture_float_linear extension in addition to this extension. floating-point color buffers this extension implicitly enables the webgl_color_buffer_float extension (if supported), which allows rendering to 32-bit floating-point color buffers. examples var ext = gl.getextension('oes_texture_float'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, gl.float, image); specifications specification status comment oes_texture_floatthe definition of 'oes_texture_float'...
OES_texture_half_float - Web APIs
_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures, the texture will be marked as incomplete. to use linear filtering on half floating-point textures, enable the oes_texture_half_float_linear extension in addition to this extension. half floating-point color buffers this extension implicitly enables the ext_color_buffer_half_float extension (if supported), which allows rendering to 16-bit floating point formats. examples var ext = gl.getextension('oes_texture_half_float'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, ext.half_float_oes, image); specifications specification status comment oes_texture_half_floatthe definition of 'oes_...
OfflineAudioCompletionEvent - Web APIs
the web audio api offlineaudiocompletionevent interface represents events that occur when the processing of an offlineaudiocontext is terminated. the complete event implements this interface. note: this interface is marked as deprecated; it is still supported for legacy reasons, but it will soon be superseded when the promise version of offlineaudiocontext.startrendering is supported in browsers, which will no longer need it. constructor offlineaudiocompletionevent.offlineaudiocompletionevent creates a new offlineaudiocompletionevent object instance. properties also inherits properties from its parent, event. offlineaudiocompletionevent.renderedbuffer read only an audiobuffer containing the result of processing an offlineaudiocontext. methods inherits methods from its pare...
OfflineAudioContext.OfflineAudioContext() - Web APIs
to create for the audio context, in sample-frames, where one sample-frame is a unit that can contain a single sample of audio data for every channel in the audio data. for example, a 5-second buffer with a samplerate of 48000hz would have a length of 5 * 48000 = 240000 sample-frames. samplerate the sample-rate of the linear audio data in sample-frames per second. all user agents are required to support a range of 22050hz to 96000hz, and may support a wider range than that. the most commonly-used rate is 44100hz, which is the sample rate used by cd audio. it is important to note that, whereas you can create a new audiocontext using the new audiocontext() constructor with no arguments, the offlineaudiocontext() constructor requires three arguments, since it needs to create an audiobuffer. t...
OfflineAudioContext.startRendering() - Web APIs
the startrendering() method of the offlineaudiocontext interface starts rendering the audio graph, taking into account the current connections and the current scheduled changes. the complete event (of type offlineaudiocompletionevent) is raised when the rendering is finished, containing the resulting audiobuffer in its renderedbuffer property. browsers currently support two versions of the startrendering() method — an older event-based version and a newer promise-based version. the former will eventually be removed, but currently both mechanisms are provided for legacy reasons. syntax event-based version: offlineaudioctx.startrendering(); offlineaudioctx.oncomplete = function(e) { // e.renderedbuffer contains the output buffer } promise-based version: offlineaudioctx.startrender...
OffscreenCanvas.getContext() - Web APIs
syntax offscreen.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas. possible values are: "2d" creates a canvasrenderingcontext2d object representing a two-dimensional rendering context. ...
OverconstrainedError.constraint - Web APIs
the constraint read-only property of the overconstrainederror interface returns the constraint that was supplied in the constructor, meaning the contraint that was not satisfied. syntax var constraint = overconstrainederror.constraint; value a string specifications specification status comment media capture and streamsthe definition of 'constraint' in that specification. candidate recommendation initial definition. ...
OverconstrainedError.message - Web APIs
syntax var message = overconstrainederror.message; value a domstring. ...
OverconstrainedError - Web APIs
ediastreamtrack cannot currently be met. when this event is thrown on a mediastreamtrack, it is muted until either the current constraints can be established or until satisfiable constraints are applied. constructor overconstrainederror.overconstrainederror() creates a new overconstrainederror object. properties overconstrainederror.constraint read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied. overconstrainederror.message read only returns the text supplied in the constructor. overconstrainederror.name read only will always return overconstrainederror. methods none. specifications specification status comment media capture and streamsthe definition of 'overconstrainederror' in tha...
PannerNode.distanceModel - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode.maxDistance - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode.panningModel - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode.setOrientation() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode.setPosition() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode.setVelocity() - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
PannerNode - Web APIs
e implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner position information var width = window.innerwidth; var height = window.innerheight; var xpos = math.floor(width/2); var ypos = math.floor(height/2); var zpos = 295; // define other variables var audiocontext = window.audiocontext || window.we...
ParentNode.childElementCount - Web APIs
ouldn't affect compatibility. syntax var count = node.childelementcount; count the return value, which is an unsigned long (simply an integer) type. node an object representing a document, documentfragment, or element. example var foo = document.getelementbyid('foo'); if (foo.childelementcount > 0) { // do something } polyfill for ie8 & ie9 & safari this property is completely unsupported prior to ie9. in ie9 and safari, it is unsupported in the document and documentfragment objects. ;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.childelementcount == null) { object.defineproperty(constructor.prototype, 'childelementcount', { get: function() { var i = 0, count = 0, node, nodes = this.childnodes; ...
ParentNode.children - Web APIs
em() method on the collection, or by using javascript array-style notation. if the node has no element children, then children is an empty list with a length of 0. example const foo = document.getelementbyid('foo'); for (let i = 0; i < foo.children.length; i++) { console.log(foo.children[i].tagname); } polyfill // overwrites native 'children' prototype. // adds document & documentfragment support for ie9 & safari. // returns array instead of htmlcollection. ;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.children == null) { object.defineproperty(constructor.prototype, 'children', { get: function() { let i = 0, node, nodes = this.childnodes, children = []; while (node = nodes[i++]) { if (node.node...
ParentNode.firstElementChild - Web APIs
syntax var element = node.firstelementchild; example <ul id="foo"> <li>first (1)</li> <li>second (2)</li> <li>third (3)</li> </ul> <script> var foo = document.getelementbyid('foo'); // yields: first (1) console.log(foo.firstelementchild.textcontent); </script> polyfill for ie8, ie9 and safari // overwrites native 'firstelementchild' prototype. // adds document & documentfragment support for ie9 & safari. ;(function(constructor) { if (constructor && constructor.prototype && constructor.prototype.firstelementchild == null) { object.defineproperty(constructor.prototype, 'firstelementchild', { get: function() { var node, nodes = this.childnodes, i = 0; while (node = nodes[i++]) { if (node...
ParentNode.lastElementChild - Web APIs
d moved to parentnode. this is a fairly technical change that shouldn't affect compatibility. syntax const element = node.lastelementchild example <ul id="foo"> <li>first (1)</li> <li>second (2)</li> <li>third (3)</li> </ul> <script> const foo = document.getelementbyid('foo'); console.log(foo.lastelementchild.textcontent); // logs: third (3) </script> polyfill the code below adds support of lastelementchild() to document and documentfragment in internet explorer and safari. // overwrites native 'lastelementchild' prototype. // returns array instead of htmlcollection. ;(function(constructor) { if(constructor && constructor.prototype && constructor.prototype.lastelementchild == null) { object.defineproperty(constructor.prototype, 'lastelementchild', { get: ...
ParentNode.querySelector() - Web APIs
ll the elements matching the selector list, use queryselectorall() instead. note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector(). syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping,...
PasswordCredential - Web APIs
syntax var mycredential = new passwordcredential(passwordcredentialdata) var mycredential = new passwordcredential(htmlformelement) parameters either of the following: passwordcredentialdata a passwordcredentialdata dictionary containing the following fields: iconurl: (optional) the url of a user's avatar image. id: the id of the user signing in. name: (optional) the name of the user signing in. password: the password of the user signing in. ...
PaymentMethodChangeEvent.methodName - Web APIs
the read-only methodname property of the paymentmethodchangeevent interface is a string which uniquely identifies the payment handler currently selected by the user. the payment handler may be a payment technology, such as apple pay or android pay, and each payment handler may support multiple payment methods; changes to the payment method within the payment handler are described by the paymentmethodchangeevent. syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler. this may be a string chosen from the list of standardized payment method identifiers, or a url used by the payment processing service. see payment method identifiers in payment request api for more information. the default va...
PaymentRequest.shippingAddress - Web APIs
mentrequest constructor. in the example below, the cost of shipping varies by geography. when the paymentrequest.onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost. // initialization of paymentrequest arguments are excerpted for the sake of // brevity. var payment = new paymentrequest(supportedinstruments, details, options); payment.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity. }).catch(function(err) { console.error("uh oh, something bad ...
PaymentRequestUpdateEvent.updateWith() - Web APIs
these represent the line items on a receipt or invoice. error optional a domstring specifying an error message to present to the user. ...
PayerResponse.payerPhone - Web APIs
this option is only present when the requestpayerphone option is set to true in the paymentoptions object passed to the paymentrequest constructor. ...
PaymentResponse.retry() - Web APIs
there are any fields whose values are not acceptable, call the response's complete() method with a value of "fail" to indicate failure. if the response's data is valid and acceptable, call complete("success") to finalize the payment and proces it. if show() is rejected, the payment request failed, usually because either there's already one being processed, because the user agent doesn't support any of the specified payment methods, or because of a security issue. see the list of exceptions for show() for further details. call complete("fail") to close the payment request. async function handlepayment() { const payrequest = new paymentrequest(methoddata, details, options); try { let payresponse = await payrequest.show(); while (payresponse has errors) { /* let t...
performance.getEntries() - Web APIs
b workers. syntax general syntax: entries = window.performance.getentries(); return value entries an array of performanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_performanceentry_methods() { console.log("performanceentry tests ..."); if (performance.mark === undefined) { console.log("... ...
performance.getEntriesByName() - Web APIs
argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function use_performanceentry_methods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... ...
performance.getEntriesByType() - Web APIs
a list of performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useperformanceentrymethods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... ...
PerformanceNavigationTiming - Web APIs
returns a timestamp that is the difference between the performancenavigationtiming.loadeventend and performanceentry.starttime properties. this interface also extends following performanceresourcetiming properties for navigation performance entry types by qualifying and constraining them as follows: performanceresourcetiming.initiatortyperead only returns "navigation". the interface also supports the following properties: performancenavigationtiming.domcomplete read only a domhighrestimestamp representing a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete. performancenavigationtiming.domcontentloadedeventend read only a domhighrestimestamp representing the time value equal to the time immediate...
PerformanceObserverEntryList.getEntries() - Web APIs
ions dictionary, having the following fields: "name", the name of a performance entry. "entrytype", the entry type. the valid entry types are listed in the performanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the performanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed performanceentry objects that meets the criteria of the filter. the items will be in chronological order based on the entries' starttime. if no objects that meet the filter are found, an empty list is returned. if no argument is given, all entries are returned. example function print_perf_entry(pe) { console.log("name: " ...
PerformancePaintTiming - Web APIs
the time to first-contentful-paint was 2787.460 milliseconds. specifications specification status comment paint timingthe definition of 'performancepainttiming' in that specification. working draft initial definition. ...
PerformanceResourceTiming.connectStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'connectstart' in that specification. ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'domainlookupend' in that specificatio...
PerformanceResourceTiming.domainLookupStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'domainlookupstart' in that specificat...
PerformanceResourceTiming.initiatorType - Web APIs
candidate recommendation initial definition. ...
PerformanceResourceTiming.nextHopProtocol - Web APIs
working draft initial definition. ...
PerformanceResourceTiming.redirectStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'redirectstart' in that specification.
PerformanceResourceTiming.requestStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'requeststart' in that specification. ...
PerformanceResourceTiming.responseStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'responsestart' in that specification.
PerformanceResourceTiming.secureConnectionStart - Web APIs
*end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'secureconnectionstart' in that specif...
PerformanceResourceTiming - Web APIs
nly returns "resource". performanceentry.nameread only returns the resources url. performanceentry.starttimeread only returns the timestamp for the time a resource fetch started. this value is equivalent to performanceentry.fetchstart. performanceentry.durationread only returns a timestamp that is the difference between the responseend and the starttime properties. the interface also supports the following properties which are listed in the order in which they are recorded for the fetching of a single resource. an alphabetical listing is shown in the navigation, at left. performanceresourcetiming.initiatortyperead only a string representing the type of resource that initiated the performance entry, as specified in performanceresourcetiming.initiatortype. performanceresource...
Using the Performance API - Web APIs
f the performance object is done via the tojson() method. in the following example, json serialization for the performance, performance.timing and performance.navigation objects is printed in the object element. ...
Using the Permissions API - Web APIs
ed the initial permission request, as we'll see below). the permissions api provides the tools to allow developers to implement a better user experience as far as permissions are concerned. for example, it can query whether permission to use a particular api is granted or denied, and specifically request permission to use an api. at the moment, implementation of the api is at an early stage, so support in browsers is pretty spotty: it can only be found in chrome 44 and later and firefox 43 and later. the only supported method right now is permissions.query(), which queries permission status. the only two apis currently recognized by the permissions api in chrome are geolocation and notification, with firefox also recognizing push and webmidi. more features will be added as time progr...
Permissions API - Web APIs
ermission-related tasks, for example querying a permission using the permissions.query() method to return a promise that resolves with the permissionstatus for a specific api. not all apis' permission statuses can be queried using the permissions api. notable apis that are permissions-aware include: clipboard api notifications api push api web midi api more apis will gain permissions api support over time. examples we have made a simple example available called location finder. you can run the example live, or view the source code on github. read more about how it works in our article using the permissions api. interfaces navigator.permissions and workernavigator.permissions read only provides access to the permissions object from the main context and worker context respecti...
Plugin - Web APIs
Web › API › Plugin
rties of plugin objects are no longer enumerable in the latest browser versions. properties plugin.description read only a human readable description of the plugin. plugin.filename read only the filename of the plugin file. plugin.name read only the name of the plugin. plugin.version read only the plugin's version number string. methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types. plugin.nameditem returns the mime type of a supported item. specifications specification status comment html living standardthe definition of 'plugin' in that specification. living standard initial definition. ...
PluginArray - Web APIs
note: own properties of pluginarray objects are no longer enumerable in the latest browser versions. properties pluginarray.lengthread only the number of plugins in the array. ...
PointerEvent.isPrimary - Web APIs
the isprimary read-only property of the pointerevent interface indicates whether or not the pointer device that created the event is the primary pointer. it returns true if the pointer that caused the event to be fired is the primary device and returns false otherwise. in a multi-pointer scenario (such as a touch screen that supports more than one touch point), this property is used to identify a master pointer among the set of active pointers for each pointer type. only a primary pointer will produce compatibility mouse events. authors who desire only single-pointer interaction can achieve that by ignoring non-primary pointers. a pointer is considered primary if the pointer represents a mouse device. a pointer representing pen input is considered the primary pen input if its pointerdown e...
PointerEvent.pressure - Web APIs
ure read-only property of the pointerevent interface indicates the normalized pressure of the pointer input. syntax var pressure = pointerevent.pressure; return value pressure the normalized pressure of the pointer input in the range of 0 to 1, inclusive, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. for hardware that does not support pressure, such as a mouse, the value is 0.5 when the pointer is active buttons state and 0 otherwise. example in this snippet, when a pointerdown event is fired, different functions are called depending on the value of the event's pressure property. someelement.addeventlistener('pointerdown', function(event) { if (event.pressure == 0) { // no pressure process_no_pressure(event);...
PointerEvent.tangentialPressure - Web APIs
nt interface represents the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress). syntax var tanpressure = pointerevent.tangentialpressure; return value a float representing the normalized tangential pressure of the pointer input in the range -1 to 1, inclusive, where 0 is the neutral position of the control. note that some hardware may only support positive values in the range 0 to 1. for hardware that does not support tangential pressure, the value will be 0. example in this snippet, when a pointerdown event is fired, different functions are called depending on the value of the event's tangentialpressure property. someelement.addeventlistener('pointerdown', function(event) { if (event.tangentialpressure == 0) { // no pressure ...
PointerEvent.tiltX - Web APIs
perty is typically only useful for a pen/stylus pointer type. for an illustration of this property see figure 2 in the specification. syntax var tiltx = pointerevent.tiltx; return value tiltx the angle in degrees between the y-z plane of the pointer (stylus) and the screen. the range of values is -90 to 90, inclusive, where a positive value is a tilt to the right. for devices that do not support this property, the value is 0. example this example illustrates simple accessing of the tiltx and tilty properties. someelement.addeventlistener("pointerdown", function(event) { process_tilt(event.tiltx, event.tilty); }, false); specifications specification status comment pointer events – level 2the definition of 'tiltx' in that specification. recommendat...
PointerEvent.tiltY - Web APIs
is typically only useful for a pen/stylus pointer type. for an illustration of this property, see figure 3 in the specification. syntax var tilty = pointerevent.tilty; return value tilty the angle in degrees between the x-z plane of the pointer (stylus) and the screen. the range of values is -90 to 90, inclusive, where a positive value is a tilt towards the user. for devices that do not support this property, the value is 0. example this example illustrates simple accessing of the tiltx and tilty properties. someelement.addeventlistener("pointerdown", function(event) { process_tilt(event.tiltx, event.tilty); }, false); specifications specification status comment pointer events – level 2the definition of 'tilty' in that specification. recommendati...
Proximity Events - Web APIs
a handy way to know when a user is close to a device. these events make it possible to react to such a change, for example by shutting down the screen of a smartphone when the user is having a phone call with the device close to their ear. note: obviously, the api requires the device to have a proximity sensor, which are mostly available only on mobile devices. devices without such a sensor may support those events but will never fire them. proximity events when the device proximity sensor detects a change between the device and an object, it notifies the browser of that change. when the browser gets such a notification, it fires a deviceproximityevent for any change, and a userproximityevent event in the case of a more rough change. this event can be captured at the window object level...
PublicKeyCredential.getClientExtensionResults() - Web APIs
= publickeycredential.getclientextensionresults() parameters none. return value an arraybuffer containing the result of the processing of the different extensions by the client. this object contains a map between the extensions' identifiers and their results from the processing. warning! as of march 2019, only appid (used during creation with publickeycredentialrequestoptions.extensions) is supported by chrome and edge. firefox does not seem to support any extension. examples var publickey = { // here are the extensions (as "inputs") extensions: { "loc": true, // this extension has been defined to include location information in attestation "uvi": true // user verification index: how the user was verified }, challenge: new uint8array(16) /* from the server */, rp: ...
PublicKeyCredentialRequestOptions.extensions - Web APIs
exists for the creation operation (navigators.credentials.create()), see publickeycredentialcreationoptions.extensions. syntax extensions = publickeycredentialrequestoptions.extensions value an object with various keys and values. here is the current (as of march 2019) list of potential extensions which may be used during the registration operation. warning! as of june 2020, only appid is supported by chrome and edge. firefox does not seem to support any extension. also chrome doesn't plan to support any other extension in future extension identifier type description appid usvstring fido appid. an appid which was used with legacy fido js apis to identify the current relying party. txauthsimple usvstring simple transaction authorizatio...
PushManager.register() - Web APIs
syntax var request = navigator.push.register(); return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a string, which is the endpoint url. note: if you do not need the url any more, please use pushmanager.unregister() to clean up after yourself. ...
PushManager - Web APIs
the pushmanager interface of the push api provides a way to receive notifications from third-party servers as well as request urls for push notifications. this interface is accessed via the serviceworkerregistration.pushmanager property. note: this interface replaces functionality previously offered by the obsolete pushregistrationmanager interface. properties pushmanager.supportedcontentencodings returns an array of supported content codings that can be used to encrypt the payload of a push message. methods pushmanager.getsubscription() retrieves an existing push subscription. it returns a promise that resolves to a pushsubscription object containing details of an existing subscription. if no existing subscription exists, this resolves to a null value. pushmanager.permissi...
RTCConfiguration.certificates - Web APIs
rtificates for use by an rtcpeerconnection instead of having the rtcpeerconnection generate them automatically, you do so by calling the static rtcpeerconnection.generatecertificate() function. the certificates property's value cannot be changed once it's first specified. if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encryption algorithms. the implementation of rtcpeerconnection will choose which certificate to use based on the algorithms it and the remote peer support, as determined during dtls handshake. if you don't provide certificates, ne...
RTCDTMFSender - Web APIs
the rtcdtmfsender interface provides a mechanism for transmitting dtmf codes on a webrtc rtcpeerconnection. you gain access to the connection's rtcdtmfsender through the rtcrtpsender.dtmf property on the audio track you wish to send dtmf with. the primary purpose for webrtc's dtmf support is to allow webrtc-based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services. for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;...
RTCDTMFToneChangeEvent - Web APIs
pecifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing. constructors rtcdtmftonechangeevent() returns a new rtcdtmftonechangeevent. it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the properties of the event. methods supports the methods defined in event. there are no additional methods. examples this snippet is derived loosely from the full, working example you'll find in when a tone finishes playing in using dtmf with webrtc. it appends each tone to a display box as it's played, and, once all tones have been sent, re-enabled a previously-disabled "send" button, allowing the next dmtf string to be entered. dt...
RTCDataChannel.send() - Web APIs
r the specified data would need to be buffered, and there isn't room for it in the buffer. in this scenario, the underlying transport is immediately closed. typeerror the specified data is too large for the other peer to receive. since there are multiple techniques for breaking up large data into smaller pieces for transfer, it's possible to encounter scenarios in which the other peer does not support the same ones. for example, if one peer is a modern browser that supports using the eor (end of record) flag to indicate when a received message is the last piece of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is creat...
RTCDataChannel.stream - Web APIs
and 65,535) which uniquely identifies the rtcdatachannel. this id is set at the time the data channel is created, either by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true). this property has been replaced with the rtcdatachannel.id property. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var stream = adatachannel.stream; value an unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. example var datachannel = pc.createdatachannel("samplechannel"); console.log("data channel stream id: " + datachannel.stream); ...
RTCIceCandidate.address - Web APIs
. the address field's value is set when the rtcicecandidate() constructor is used. you can't specify the address in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly. syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more information about the source of the remote peer than the use...
RTCIceCandidate.foundation - Web APIs
s a string which uniquely identifies the candidate across multiple transports. as such, the foundation can be used to correlate candidates that are present on multiple rtcicetransport objects syntax var foundation = rtcicecandidate.foundation; value a domstring which uniquely identifies the candidate across all rtcicetransports on which it is available. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the field "4234997325" is the foundation. example this code snippet uses the foundation of two candidates to determ...
RTCIceCandidate.protocol - Web APIs
ate, if selected, would use tcp as the transport protocol for its data. the tcptype property provides additional information about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol for its data. this is the preferred protocol for media interactions because of its better performance profile. note: if protocol is null — and protocol is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. usage notes here's an example candidate a-line from an ice transaction: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the third field, "udp", is the protocol type, indicating that the candidate would use the udp transport protocol. example this code ...
RTCIceCandidatePairStats.availableOutgoingBitrate - Web APIs
datepairstats.availableoutgoingbitrate; value a floating-point value which approximates the amount of available bandwidth for outgoing data on the network connection described by the rtcicecandidatepair. the value is reported in bits per second and is computed over a 1-second interval. the returned value is undefined in each of the following situations: the underlying implementation doesn't support computing a sender-side estimate of the outgoing bit rate. the rtcicecandidatepair described by this object has never been used. the candidate pair was once in use, but no longer is. the value returned is calculated by adding up the available bit rate for every rtp stream using the connection described by this candidate pair. the returned value doesn't take into account overhead introduce...
RTCIceCandidatePairStats - Web APIs
cicetransport that was inspected to obtain the transport-related statistics (as found in rtctransportstats) used in generating this object. obsolete properties the following properties have been removed from the specification and should no longer be used. you should update any existing code to avoid using them as soon as is practical. check the compatibility table for details on which browsers support them and in which versions. priority optional an integer value indicating the candidate pair's priority. readable optional a boolean value indicating whether or not data can be sent over the connection described by the candidate pair. writable optional a boolean value indicating whether or not data can be received on the connection described by the candidate pair. non-standard...
RTCIceCandidateStats.mozLocalTransport - Web APIs
the non-standard mozilla extension to the rtcicecandidatestats dictionary, mozlocaltransport, has been supplanted by the standard relayprotocol property. syntax instead of using mozlocaltransport, you should use code like this: localtransport = rtcicecandidatestats.relayprotocol; specifications not part of any specification. ...
RTCIceServer.url - Web APIs
Web › API › RTCIceServer › url
the obsolete rtciceserver dictionary's url property specifies the url of a single ice server to be used while negotiating connections. it was removed from the specification in june 2013 but is still broadly used in older examples and books, so we include documentation here to help adapt old code to new browsers. this property has been removed from the specification; while it's still supported by many browsers, it should no longer be used. you should instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. syntax var iceserver = { ... url = iceserverurl, ... }; var serverurl = iceserver.url; iceserver.
RTCPeerConnection() - Web APIs
this isn't specified, "all" is assumed. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. if this value is set (it defaults to null), the rtcpeerconnection will not connect to a remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". return value a newly-created rtcpeerconnection object, configured as described by configuration, if specified; otherwise, configured to appropriate basic defaults. specifications specification status comment webrtc 1.0: real-time communication between bro...
RTCPeerConnection: addstream event - Web APIs
h is sent for each media track added to the rtcpeerconnection. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. if it does, a track event listener is set up; otherwise, an addstream event listener is set up. pc is an rtcpeerconnection. if (pc.addtrack !== undefined) { pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being ad...
RTCPeerConnection.createAnswer() - Web APIs
the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process. ...
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer. the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and options 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 rtcsessiondescription object containing the newly-created offer. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failureca...
RTCPeerConnection.getStreamById() - Web APIs
nnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection. if no stream matches, it returns null. this property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. ...
RTCPeerConnection.signalingState - Web APIs
er it to the local peer, which has set the offer as the remote description by calling rtcpeerconnection.setremotedescription(). "have-local-pranswer" the offer sent by the remote peer has been applied and an answer has been created (usually by calling rtcpeerconnection.createanswer()) and applied by calling rtcpeerconnection.setlocaldescription(). this provisional answer describes the supported media formats and so forth, but may not have a complete set of ice candidates included. further candidates will be delivered separately later. "have-remote-pranswer" a provisional answer has been received and successfully applied in response to an offer previously sent and established by calling setlocaldescription(). "closed" the connection is closed. ...
RTCRtpCodecParameters - Web APIs
s. clockrate optional an unsigned long integer value specifying the codec's clock rate in hertz (hz). the clock rate is the rate at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload format media type registry for details. channels optional an unsigned short integer indicating the number of channels the codec should support. for example, for audio codecs, a value of 1 specifies monaural sound while 2 indicates stereo. sdpfmtpline optional a domstring containing the format-specific parameters field from the "a=fmtp" line in the codec's sdp, if one is present; see section 5.8 of the ietf specification for jsep. note: on an rtcrtpreceiver, the format-specific parameters come from the sdp sent by the remote peer,...
RTCRtpEncodingParameters.maxBitrate - Web APIs
.maxbitrate; value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a track of media it encodes in terms of bits per second. other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the specified bandwidth, in which case the actual bandwidth will be lower. this value is computed using the standard transport independent application specific maximum (tias) bandwidth as defined by rfc 3890, section 6.2.2; this is the maximum bandwidth needed without considering protocol overheads from ip, tcp or udp, and so forth. specifications specification status commen...
RTCRtpParameters - Web APIs
he parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose. this parameter cannot be changed once initially set. headerextensions an array of zero or more rtp header extensions, each identifying an extension supported by the sender or receiver. header extensions are described in rfc 3550: 5.3.1. this parameter cannot be changed once initially set. rtcp an rtcrtcpparameters object providing the configuration parameters used for rtcp on the sender or receiver. this parameter cannot be changed once initially set. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtps...
RTCRtpSender.dtmf - Web APIs
Web › API › RTCRtpSender › dtmf
turns a rtcdtmfsender object which can be used to send dtmf tones over the rtcpeerconnection . see using dtmf for details on how to make use of the returned rtcdtmfsender object. syntax var dtmfsender = rtcrtpsender.dtmf; value an rtcdtmfsender which can be used to send dtmf over the rtp session, or null if the track being carried by the rtp session or the rtcpeerconnection as a whole doesn't support dtmf. only audio tracks can support dtmf, and typically only one audio track per rtcpeerconnection will have an associated rtcdtmfsender example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.dtmf' in that specification. candidate recommendation ...
RTCRtpSender.replaceTrack() - Web APIs
re-encoded state differs from that of the original track. the new track is an audio track with a different number of channels fom the original. media sources that have built-in encoders — such as hardware encoders — may not be able to provide the negotiated codec. software sources may not implement the negotiated codec. ...
RTCRtpSender - Web APIs
lso obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer. properties rtcrtpsender.dtmf read only an rtcdtmfsender which can be used to send dtmf tones using telephone-event payloads on the rtp session represented by the rtcrtpsender object. if null, the track and/or the connection doesn't support dtmf. only audio tracks can support dtmf. rtcrtpsender.track read only the mediastreamtrack which is being handled by the rtcrtpsender. if track is null, the rtcrtpsender doesn't transmit anything. rtcrtpsender.transport read only the rtcdtlstransport over which the sender is exchanging the rtp and rtcp packets used to manage transmission of media and control data. this value is null un...
RTCRtpSynchronizationSource - Web APIs
ceived. while the published specification describes this as an interface, it has since been changed to a dictionary in follow-up drafts. properties also implements the properties of rtcrtpcontributingsource. voiceactivityflag optional a boolean value indicating whether or not voice activity is included in the last rtp packet played from the source. if the peer has indicated that it's not supporting voice activity detection, this field is not provided. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsynchronizationsource' in that specification. candidate recommendation initial definition. ...
RTCSessionDescription - Web APIs
iption consists of a description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session. the process of negotiating a connection between two peers involves exchanging rtcsessiondescription objects back and forth, with each description suggesting one combination of connection configuration options that the sender of the description supports. once the two peers agree upon a configuration for the connection, negotiation is complete. properties the rtcsessiondescription interface doesn't inherit any properties. rtcsessiondescription.type read only an enum of type rtcsdptype describing the session description's type. rtcsessiondescription.sdp read only a domstring containing the sdp describing the session. constants ...
Range.compareBoundaryPoints() - Web APIs
range. range.end_to_start compares the end boundary-point of sourcerange to the start boundary-point of range. range.start_to_end compares the start boundary-point of sourcerange to the end boundary-point of range. range.start_to_start compares the start boundary-point of sourcerange to the start boundary-point of range. if the value of the parameter is invalid, a domexception with a notsupportederror code is thrown. sourcerange a range to compare boundary points with the range. example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoints(range.start_to_end, sourcera...
ReadableStream.ReadableStream() - Web APIs
the total number of chunks that can be contained in the internal queue before backpressure is applied. size(chunk) a method containing a parameter chunk — this indicates the size to use for each chunk, in bytes. note: you could define your own custom queuingstrategy, or use an instance of bytelengthqueuingstrategy or countqueuingstrategy for this object value. if no queuingstrategy is supplied, the default used is the same as a countqueuingstrategy with a high water mark of 1. return value an instance of the readablestream object. exceptions rangeerror the supplied type value is neither "bytes" nor undefined. examples in the following simple example, a custom readablestream is created using a constructor (see our simple random stream example for the full code). the ...
ReadableStream.cancel() - Web APIs
cancel is used when you've completely finished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read. that data is lost after cancel is called, and the stream is not readable any more. to read those chunks still and not completely get rid of the stream, you'd use readablestreamdefaultcontroller.close(). syntax var promise = readablestream.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation. ...
ReadableStream - Web APIs
h the body property of a response object. constructor readablestream() creates and returns a readable stream object from the given handlers. properties readablestream.locked read only the locked getter returns whether or not the readable stream is locked to a reader. methods readablestream.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestream.getiterator() creates a readablestream async iterator instance and locks the stream to it. while the stream is locked, no other reader can be acquired until this one is released. readablestream.getreader() creates a reader and locks the stream to it. while the stream is locked, no ot...
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
urns a readablestreambyobreader object instance. note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method. syntax var readablestreambyobreader = new readablestreambyobreader(stream); parameters stream the readablestream to be read. return value an instance of the readablestreambyobreader object. exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader, or its stream controller is not a readablebytestreamcontroller. examples tbd specifications specification status comment streamsthe definition of 'readablestreambyobreader()' in that specification. living standard initial definition. ...
ReadableStreamBYOBReader.cancel() - Web APIs
note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()). syntax var promise = readablestreambyobreader.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. ...
ReadableStreamDefaultController.desiredSize - Web APIs
the desiredsize read-only property of the readablestreamdefaultcontroller interface returns the desired size required to fill the stream's internal queue. syntax var desiredsize = readablestreamdefaultcontroller.desiredsize; value an integer. note that this can be negative if the queue is over-full. examples the a readable stream with an underlying push source and backpressure support example in the spec provides a good example of using desiredsize to manually detect when the stream is full and apply backpressure, and also of using readablestreamdefaultcontroller.error() to manually trigger a stream error if another part of the system it relies on fails. specifications specification status comment streamsthe definition of 'desiredsize' in that specification. ...
ReadableStreamDefaultController.error() - Web APIs
the stream is not readable. syntax readablestreamdefaultcontroller.error(e); parameters e the error you want future interactions to fail with. return value undefined. exceptions typeerror the source object is not a readablestreamdefaultcontroller, or the stream is not readable for some other reason. examples the a readable stream with an underlying push source and backpressure support example in the spec provides a good example of using readablestreamdefaultcontroller.desiredsize to manually detect when the stream is full and apply backpressure, and also of using error() to manually trigger a stream error if another part of the system it relies on fails. specifications specification status comment streamsthe definition of 'error()' in that specifi...
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
blestreamdefaultreader object instance. note: you generally wouldn't use this constructor manually; instead, you'd use the readablestream.getreader() method. syntax var readablestreamdefaultreader = new readablestreamdefaultreader(stream); parameters stream the readablestream to be read. return value an instance of the readablestreamdefaultreader object. exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader. examples in the following simple example, a previously-created custom readablestream is read using a readablestreamdefaultreader created using getreader(). (see our simple random stream example for the full code). each chunk is read sequentially and output to the ui, until the stream has finis...
ReadableStreamDefaultReader.cancel() - Web APIs
cancel is used when you've completely finished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read. that data is lost after cancel is called, and the stream is not readable any more. to read those chunks still and not completely get rid of the stream, you'd use readablestreamdefaultcontroller.close(). ...
ReadableStreamDefaultReader - Web APIs
the readablestreamdefaultreader interface of the streams api represents a default reader that can be used to read stream data supplied from a network (e.g. a fetch request). constructor readablestreamdefaultreader() creates and returns a readablestreamdefaultreader object instance. properties readablestreamdefaultreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreamdefaultreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestreamdefau...
RenderingContext - Web APIs
renderingcontext is a webidl typedef which can refer to any one of the interfaces that represent a graphics rendering context within a <canvas> element: canvasrenderingcontext2d, webglrenderingcontext, or webgl2renderingcontext. by using the shorthand renderingcontext, methods and properties which can make use of any of these interfaces can be specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces." as such, renderingcontext is an implementation detail, and isn't something web developers directly use. there is no renderingcontext interface, and there are no objects which implement type renderingcontext. the primary use of this type...
Request.mode - Web APIs
Web › API › Request › mode
ceworkers do not affect the semantics of the web and prevents security and privacy issues arising from leaking data across domains. cors — allows cross-origin requests, for example to access various apis offered by 3rd party vendors. these are expected to adhere to the cors protocol. only a limited set of headers are exposed in the response, but the body is readable. navigate — a mode for supporting navigation. the navigate value is intended to be used only by html navigation. a navigate request is created only while navigating between documents. default mode requests can be initiated in a variety of ways, and the mode for a request depends on the particular means by which it was initiated. for example, when a request object is created using the request.request constructor, th...
ResizeObserverEntry.borderBoxSize - Web APIs
the borderboxsize read-only property of the resizeobserverentry interface returns an array containing the new border box size of the observed element when the callback is run. syntax var myborderboxsize = resizeobserverentry.borderboxsize; value an array containing objects with the new border box size of the observed element. the array is necessary to support elements that have multiple fragments, which occur in multi-column scenarios. each object in the array contains two properties: blocksize the length of the observed element's border box in the block dimension. for boxes with a horizontal writing-mode, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width. inlinesize the length of the observed element's...
Resource Timing API - Web APIs
"resource" type performance entry. implementation status as shown in the performanceresourcetiming interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers. however, note that some properties have little to no implementation so see each property's "browser compatibility" section for more specific interoperability data. to test your browser's support for these interfaces, run the perf-api-support application. see also resource timing standard; w3c editor's draft caniuse data resource timing practical tips; steve souders; 2014 august 21 measuring network performance with resource timing api; ilya grigorik; 2013 december 11 a primer for web performance timing apis; xiaoqian wu; w3c editor's draft ...
Response() - Web APIs
Web › API › Response › Response
thin a headers object or object literal of bytestring key/value pairs (see http headers for a reference). examples in our fetch response example (see fetch response live) we create a new response object using the constructor, passing it a new blob as a body, and an init object containing a custom status and statustext: var myblob = new blob(); var init = { "status" : 200 , "statustext" : "supersmashinggreat!" }; var myresponse = new response(myblob,init); specifications specification status comment fetchthe definition of 'response()' in that specification. living standard initial definition ...
Response.error() - Web APIs
Web › API › Response › error
relevant to serviceworkers; the error method is used to return an error if you so wish it. an error response has its type set to error. note: an "error" response never really gets exposed to script: such a response to a fetch() would reject the promise. syntax var errorresponse = response.error(); parameters none. return value a response object. example tbd (does not yet appear to be supported anywhere). specifications specification status comment fetchthe definition of 'error()' in that specification. living standard ...
SVGAngle - Web APIs
Web › API › SVGAngle
parsed as a valid <angle>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. methods newvaluespecifiedunits reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is raised if unittype is svg_angletype_unknown or not a valid unit type constant (one of the other svg_angletype_* constants defined on this interface). a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. converttospecifiedunits preserve the same underlying stored value, but reset ...
SVGAnimationElement: repeatEvent event - Web APIs
e repeats. it will be fired each time the element repeats, after the first iteration. note: associated with the repeatevent event is an integer that indicates which repeat iteration is beginning; this can be found in the detail property of the event object. the value is a 0-based integer, but the repeat event is not raised for the first iteration and so the observed values will be >= 1. this is supported in firefox, but not in chrome. bubbles no cancelable no interface timeevent event handler property onrepeat examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <anima...
SVGAnimationElement - Web APIs
thrown. svganimationelement.getcurrenttime() returns a float representing the current time in seconds relative to time zero for the given time container. svganimationelement.getsimpleduration() returns a float representing the number of seconds for the simple duration for this animation. if the simple duration is undefined (e.g., the end time is indefinite), then a domexception with code not_supported_err is raised. svganimationelement.beginelement() creates a begin instance time for the current time. the new instance time is added to the begin instance times list. the behavior of this method is equivalent to beginelementat(0). svganimationelement.beginelementat() creates a begin instance time for the current time plus the specified offset. the new instance time is added to the...
SVGTests - Web APIs
Web › API › SVGTests
the svgtests interface is used to reflect conditional processing attributes and is mixed into other interfaces for elements that support these attributes. properties svgtests.requiredfeatures read only an svgstringlist corresponding to the requiredfeatures attribute of the given element. svgtests.requiredextensions read only an svgstringlist corresponding to the requiredextensions attribute of the given element. svgtests.systemlanguage read only an svgstringlist corresponding to the systemlanguage attribute of the given element. methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri. specifications specification status comment scalable vector graphics (svg) 2the definition of 'sv...
SVGTextContentElement - Web APIs
it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtextpathelement. ...
SVGTextPositioningElement - Web APIs
it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement. ...
SVGZoomAndPan - Web APIs
the svgzoomandpan interface is used to reflect the zoomandpan attribute, and is mixed in to other interfaces for elements that support this attribute. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgzoomandpan" target="_top"><rect x="1" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgzoomandpan</text></a></svg></div...
Screen.mozBrightness - Web APIs
icates how bright the screen's backlight is, on a scale from 0 (very dim) to 1 (full brightness); this value is a double-precision float. you can read and write this attribute even when the screen is disabled, but the backlight is off while the screen is disabled. if you write a value of x into this attribute, the attribute may not have the same value x when you later read it. most screens don't support as many different brightness levels as there are doubles between 0 and 1. the value's precision might be reduced before storing it. syntax let screenbrightness = window.screen.mozbrightness; specifications not part of specification. ...
Screen.orientation - Web APIs
andscape-primary") { console.log("that looks good."); } else if (orientation === "landscape-secondary") { console.log("mmmh... the screen is upside down!"); } else if (orientation === "portrait-secondary" || orientation === "portrait-primary") { console.log("mmmh... you should rotate your device to landscape"); } else if (orientation === undefined) { console.log("the orientation api isn't supported in this browser :("); } specifications specification status comment screen orientation apithe definition of 'orientation' in that specification. working draft initial definition ...
Screen Wake Lock API - Web APIs
n application needs to keep running. wakelocksentinel provides a handle to the underlying platform wake lock and if referenced can be manually released and reacquired. get an instance of the object by calling wakelock.request. navigator.wakelock returns a wakelock object instance, from which all other functionality can be accessed. examples feature detection this code checks for wake lock support and updates the ui accordingly. if ('wakelock' in navigator) { issupported = true; statuselem.textcontent = 'screen wake lock api supported!'; } else { wakebutton.disabled = true; statuselem.textcontent = 'wake lock is not supported by this browser.'; } requesting a wake lock the following example demonstrates how to request a wakelocksentinel object. the wakelock.request method i...
Selection.addRange() - Web APIs
the selection.addrange() method adds a range to a selection. syntax selection.addrange(range); parameters range a range object that will be added to the selection. example currently only firefox supports multiple selection ranges, other browsers will not add new ranges to the selection if it already contains one. html <p>i <strong>insist</strong> that you <strong>try</strong> selecting the <strong>strong words</strong>.</p> <button>select strong words</button> javascript let button = document.queryselector('button'); button.addeventlistener('click', function () { let selection = window.getselection(); let strongs = document.getelementsbytagname('strong'); if (selection.rangecount > 0) { selection.removeallranges(); } for (let i = 0; i < strongs.leng...
SensorErrorEvent.SensorErrorEvent() - Web APIs
the sensorerrorevent constructor creates a new sensorerrorevent object which provides information about errors thrown by any of the interfaces based on sensor. syntax sensorerrorevent = new sensorerrorevent(type, {error: domexception}); parameters type will always be 'sensorerrorevent'. options optional currently only one option is supported: error: an instance of domexception. specifications specification status comment generic sensor apithe definition of 'sensorerrorevent' in that specification. candidate recommendation initial definition. ...
Server-sent events - Web APIs
simple sse demo using php specification specification status comment html living standardthe definition of 'server-sent events' in that specification. living standard see also tools eventsource polyfill for node.js remy sharp’s eventsource polyfill yaffle’s eventsource polyfill rick waldron’s jquery plugin intercooler.js declarative sse support related topics ajax javascript websockets other resources a twitter like application powered by server-sent events and its code on github. html5 and server-sent events server-sent events using asp.net ...
ServiceWorker - Web APIs
} specifications specification status comment service workersthe definition of 'serviceworker' in that specification. working draft initial definition. ...
ServiceWorkerContainer.controller - Web APIs
bject. example if ('serviceworker' in navigator) { // do a one-off check to see if a service worker's in control. if (navigator.serviceworker.controller) { console.log(`this page is currently controlled by: ${navigator.serviceworker.controller}`); } else { console.log('this page is not currently controlled by a service worker.'); } } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkerregistration.controller' in that specification. working draft initial definition ...
ServiceWorkerContainer.ready - Web APIs
with a serviceworkerregistration. example if ('serviceworker' in navigator) { navigator.serviceworker.ready .then(function(registration) { console.log('a service worker is active:', registration.active); // at this point, you can call methods that require an active // service worker, like registration.pushmanager.subscribe() }); } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe definition of 'serviceworkerregistration.ready' in that specification. working draft initial definition. ...
ServiceWorkerRegistration.pushManager - Web APIs
syntax var pushmanager = serviceworkerregistration.pushmanager; value a pushmanager object. examples this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. ...
ServiceWorkerRegistration.showNotification() - Web APIs
: the direction of the notification; it can be auto, ltr or rtl icon: a usvstring containing the url of an image to be used as an icon by the notification. image: a usvstring containing the url of an image to be displayed in the notification. lang: specify the lang used within the notification. this string must be a valid bcp 47 language tag. renotify: a boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. if options’s renotify is true and options’s tag is the empty string a typeerror will be thrown. the default is false. requireinteraction: indicates that on devices with sufficiently large screens, a notification should remain active until the user clicks or dismisses it. if this value is absent or false, the desktop version of chr...
SourceBuffer.updating - Web APIs
the updating read-only property of the sourcebuffer interface indicates whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. syntax var isupdating = sourcebuffer.updating; value a boolean. example tbd specifications specification status comment media source extensionsthe definition of 'updating' in that specification. recommendation initial definition. ...
SourceBuffer - Web APIs
ritten by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourceb...
SourceBufferList: indexed property getter - Web APIs
the indexed property getter of the sourcebufferlist interface allows the sourcebuffer objects in the list to be accessed with an array operator (i.e. [].) syntax var mysourcebuffer = sourcebufferlist[index]; parameters index the index position of the sourcebuffer object you want to return. return value a sourcebuffer object. exceptions no specific exceptions are thrown, but if the supplied index is great than or equal to sourcebufferlist.length, the operation will return undefined. example tbd. specifications specification status comment media source extensionsthe definition of 'sourcebuffer() getter' in that specification. recommendation initial definition. ...
SpeechGrammar - Web APIs
constructor speechgrammar.speechgrammar() creates a new speechgrammar object. properties speechgrammar.src sets and returns a string containing the grammar from within in the speechgrammar object instance. speechgrammar.weight optional sets and returns the weight of the speechgrammar object. ...
SpeechGrammarList.addFromURI() - Web APIs
syntax speechgrammarlistinstance.addfromuri(src,weight); returns void. parameters src a domstring representing the uri of the grammar to be added. weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. ...
SpeechGrammarList - Web APIs
constructor speechgrammarlist.speechgrammarlist() creates a new speechgrammarlist object. properties speechgrammarlist.length read only returns the number of speechgrammar objects contained in the speechgrammarlist. ...
SpeechRecognitionError.error - Web APIs
ress to cancel speech input. audio-capture audio capture failed. network network communication required for completing the recognition failed. not-allowed the user agent disallowed any speech input from occurring for reasons of security, privacy or user preference. service-not-allowed the user agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. bad-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar format or semantic tag format was unsupported. language-not-supported the language was not supported. examples var recog...
SpeechRecognitionErrorEvent.error - Web APIs
ress to cancel speech input. audio-capture audio capture failed. network network communication required for completing the recognition failed. not-allowed the user agent disallowed any speech input from occurring for reasons of security, privacy or user preference. service-not-allowed the user agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. bad-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar format or semantic tag format was unsupported. language-not-supported the language was not supported. examples var recog...
SpeechRecognitionEvent.emma - Web APIs
urns an extensible multimodal annotation markup language (emma) — xml — representation of the result. note: emma is defined in the specification emma: extensible multimodal annotation markup language. you can see muliple emma examples in the spec. syntax var myemma = event.emma; value a valid xml document. the exact contents can vary across user agents and recognition engines, but all supporting implementations will expose a valid xml document complete with an emma namespace. if the speech recognition system does not supply emma data then the user agent will return null. examples recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(eve...
SpeechSynthesis.onvoiceschanged - Web APIs
e voices list is being determined asynchronously, or when client-side voices are installed/uninstalled while a speech synthesis application is running. syntax speechsynthesisinstance.onvoiceschanged = function() { ... }; examples this could be used to populate a list of voices that the user can choose between when the event fires (see our speak easy synthesis demo.) note that firefox doesn't support it at present, and will just return a list of voices when speechsynthesis.getvoices() is fired. with chrome however, you have to wait for the event to fire before populating the list, hence the bottom if statement seen below. var voices = []; function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'...
SpeechSynthesisUtterance.text - Web APIs
syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised. ...
SpeechSynthesisVoice.localService - Web APIs
syntax var amilocal = speechsynthesisvoiceinstance.localservice; value a boolean. ...
SpeechSynthesisVoice - Web APIs
the speechsynthesisvoice interface of the web speech api represents a voice that the system supports. every speechsynthesisvoice has its own relative speech service including information about language, name and uri. properties speechsynthesisvoice.default read only a boolean indicating whether the voice is the default voice for the current app language (true), or not (false.) speechsynthesisvoice.lang read only returns a bcp 47 language tag indicating the language of the voice. speechsynthesisvoice.localservice read only a boolean indicating whether the voice is supplied by a local speech synthesizer service (true), or a remote speech synthesizer service (false.) speechsynthesisvoice.name read only returns a human-readable name that represents the voice. speechsynthesisvoi...
StorageQuota - Web APIs
methods storagequota.queryinfo returns a storageinfo object containting the current data usage and available quota information for the application. ...
Streams API concepts - Web APIs
tee streams, see the teeing section below) note that there are two different types of readable stream. as well as the conventional readable stream there is a type called a byte stream — this is an extended version of a conventional stream for reading underlying byte sources (otherwise known as byob, or “bring your own buffer”) sources. these allow streams to be read straight into a buffer supplied by the developer, minimizing the copying required. which underlying stream (and by extension, reader and controller) your code will use depends on how the stream was created in the first place (see the readablestream() constructor page). important: byte streams are not implemented anywhere as yet, and questions have been raised as to whether the spec details are in a finished enough state ...
Using readable streams - Web APIs
cle explains the basics. note: this article assumes that you understand the use cases of readable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for information on writable streams try using writable streams instead. browser support you can consume fetch body objects as streams and create your own custom readable streams in firefox 65+ and chrome 42+ (and equivalent chromium-based browsers). pipe chains are only supported in chrome at the moment, and that functionality is subject to change. finding some examples we will look at various examples in this article, taken from our dom-examples/streams repo. you can find th...
Using writable streams - Web APIs
tream functionality. note: this article assumes that you understand the use cases of writable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for information about readable streams, try using readable streams instead. browser support the streams api is experimental, and support is at an early stage right now. only chrome currently has basic writable streams implemented. introducing an example in our dom-examples/streams repo you’ll find a simple writer example (see it live also). this takes a given message and writes it into a writable stream, displaying each chunk on the ui as it is written to the stream and also di...
StyleSheet.parentStyleSheet - Web APIs
terface returns the style sheet, if any, that is including the given style sheet. syntax objref = stylesheet.parentstylesheet example // find the top level stylesheet if (stylesheet.parentstylesheet) { sheet = stylesheet.parentstylesheet; } else { sheet = stylesheet; } notes this property returns null if the current stylesheet is a top-level stylesheet or if stylesheet inclusion is not supported. specifications specification status comment css object model (cssom)the definition of 'stylesheet: parentstylesheet' in that specification. working draft ...
SubtleCrypto.decrypt() - Web APIs
lowing exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or there was an error decrypting the ciphertext). supported algorithms the decrypt() method supports the same algorithms as the encrypt() method. examples note: you can try the working examples on github. rsa-oaep this code decrypts ciphertext using rsa-oaep. see the complete code on github. function decryptmessage(privatekey, ciphertext) { return window.crypto.subtle.decrypt( { name: "rsa-oaep" }, privatekey, ciphert...
SubtleCrypto.sign() - Web APIs
Web › API › SubtleCrypto › sign
ing the data to be signed. return value signature is a promise that fulfills with an arraybuffer containing the signature. exceptions the promise is rejected when the following exception is encountered: invalidaccesserror raised when the signing key is not a key for the request signing algorithm or when trying to use an algorithm that is either unknown or isn't suitable for signing. supported algorithms the web crypto api provides four algorithms that can be used for signing and signature verification. three of these algorithms — rsassa-pkcs1-v1_5, rsa-pss, and ecdsa — are public-key cryptosystems that use the private key for signing and the public key for verification. these systems all use a digest algorithm to hash the message to a short fixed size before signing. the c...
SubtleCrypto.verify() - Web APIs
n value result is a promise that fulfills with a boolean: true if the signature is valid, false otherwise. exceptions the promise is rejected when the following exception is encountered: invalidaccesserror raised when the encryption key is not a key for the requested verifying algorithm or when trying to use an algorithm that is either unknown or isn't suitable for a verify operation. supported algorithms the verify() method supports the same algorithms as the sign() method. examples note: you can try the working examples out on github. rsassa-pkcs1-v1_5 this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, and encode it in a form we can use for sign operation. */ function getmessageencoding() { ...
Text.wholeText - Web APIs
Web › API › Text › wholeText
the text.wholetext read-only property returns the full text of all text nodes logically adjacent to the node. the text is concatenated in document order. this allows to specify any text node and obtain all adjacent text as a single string. ...
TextDecoder() - Web APIs
'iso-2022-jp' "csshiftjis", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis" 'shift-jis' "cseuckr", "csksc56011987", "euc-kr", "iso-ir-149", "korean", "ks_c_5601-1987", "ks_c_5601-1989", "ksc5601", "ksc_5601", "windows-949" 'euc-kr' "csiso2022kr", "iso-2022-kr" 'iso-2022-kr' ...
TextEncoder() - Web APIs
the textencoder() constructor returns a newly created utf-8 textencoder object. syntax encoder = new textencoder(); parameters textencoder() takes no parameters since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53, an encoding type label was accepted as a paramer to the textencoder object, since then both browers have removed support for any encoder type other than utf-8, to match the spec. any type label passed into the textencoder constructor will now be ignored and a utf-8 textencoder will be created. exceptions textencoder() throws no exceptions since firefox 48 and chrome 53 note: prior to firefox 48 and chrome 53 an exception would be thrown for an unknown encoding type. specifications specification status comment encod...
TextTrackList.length - Web APIs
ack. example this snippet gets the number of text tracks in the first media element found in the dom by queryselector(). var mediaelem = document.queryselector("video, audio"); var numtexttracks = 0; if (mediaelem.texttracks) { numtexttracks = mediaelem.texttracks.length; } note that this sample checks to be sure htmlmediaelement.texttracks is defined, to avoid failing on browsers without support for texttrack. specifications specification status comment html living standardthe definition of 'texttracklist: length' in that specification. living standard ...
msManipulationViewsEnabled - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msmanipulationviewsenabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using css rules. this proprietary property is specific to internet explorer and microsoft edge. value returns true if manipulation features are support available, such as touch panning and zooming using css rules. example using a json file: { msmanipulationviewsenabled: true, } see also touch api microsoft api extensions ...
Touch.force - Web APIs
Web › API › Touch › force
pressure the user is applying to the touch surface for a touch point. syntax touchitem.force; return value a float that represents the amount of pressure the user is applying to the touch surface. this is a value between 0.0 (no pressure) and 1.0 (the maximum amount of pressure the hardware can recognize). a value of 0.0 is returned if no value is known (for example the touch device does not support this property). in environments where force is known, the absolute pressure represented by the force attribute, and the sensitivity in levels of pressure, may vary. example this example illustrates using the touch interface's touch.force property. this property is a relative value of pressure applied, in the range 0.0 to 1.0, where 0.0 is no pressure, and 1.0 is the highest level of pressur...
TouchEvent.touches - Web APIs
nvokes different handlers depending on the number of touch points. someelement.addeventlistener('touchstart', function(e) { // invoke the appropriate handler depending on the // number of touch points. switch (e.touches.length) { case 1: handle_one_touch(e); break; case 2: handle_two_touches(e); break; case 3: handle_three_touches(e); break; default: console.log("not supported"); break; } }, false); specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation initial definition. ...
TrackDefault.TrackDefault() - Web APIs
a new track. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. if not specified, this value will be an empty string and the sourcebuffer can contain any tracks of the specified type. errors when this constructor is invoked, the following errors can occur: error explanation invalidaccesserror the supplied language is not a valid language code, e.g. en-us. typeerror there are values specified in the kinds array that do not apply to the specified type. example tbd ...
TrackDefaultList.TrackDefault() - Web APIs
example tbd. ...
UIEvent.pageX - Web APIs
Web › API › UIEvent › pageX
the non-standard, read-only uievent property pagex returns the horizontal coordinate of the event relative to the whole document. this property was never part of any standard, and was only implemented across a subset of browsers, and only for a limited number of versions. a standardized version of pagex was added to the mouseevent interface, however, and is well-supported. you should not expect to find pagex on any non-mouse events. do not look for pagex on any non-mouse events in new code and update existing code as soon as possible. syntax var pos = event.pagex value an integer value, in pixels, indicating the x coordinate at which the mouse pointer was located when the event occurred. this value is relative to the left edge of the entire document, regardless of the curren...
ULongRange - Web APIs
properties max a numeric value in the range of signed 32-bit integers, specifying the largest permissible value of the property it describes. min a numeric value in the range of signed 32-bit integers, specifying the smallest permissible value of the property it describes. ...
URL - Web APIs
Web › API › URL
construct, normalize, and encode urls. it works by providing properties which allow you to easily read and modify the components of a url. you normally create a new url object by specifying the url as a string when calling its constructor, or by providing a relative url and a base url. you can then easily read the parsed components of the url or make changes to the url. if a browser doesn't yet support the url() constructor, you can access a url object using the window interface's window.url property. be sure to check to see if any of your target browsers require this to be prefixed. note: this feature is available in web workers. constructor new url() creates and returns a url object referencing the url specified using an absolute url string, or a relative url string and a base url s...
USBAlternateInterface - Web APIs
mplementers forum. a value of 0xff indicates a vendor-defined interface. usbalternateinterface.interfacesubclassread only returns the subclass of this interface. this is equal to the binterfacesubclass field of the interface descriptor defining this interface. the meaning of this value depends on the interfaceclass field. usbalternateinterface.interfaceprotocolread only returns the protocol supported by this interface. this is equal to the binterfaceprotocol field of the interface descriptor defining this interface. the meaning of this value depends on the interfaceclass and interfacesubclass fields. usbalternateinterface.interfacenameread only returns the name of the interface, if one is provided by the device. this is the value of the string descriptor with the index specified by t...
USBConfiguration.interfaces - Web APIs
syntax var interfaces[] = usbconfiguration.interfaces value an array containing instances of usbinterface. ...
USBDevice.claimInterface() - Web APIs
interfaces are device-specific. return value a promise. example the following example shows claiminterface() in the context of connecting to a usb device. ...
USBDevice.clearHalt() - Web APIs
web page (the host system, in usb terminology) to clear that condition. see the for details. syntax var promise = usbdevice.clearhalt(direction, endpointnumber) parameters direction indicates whether the devices input or output should be cleared. valid values are 'in' or 'out'. endpointnumber indicates the number of the endpoint to clear. the promise will reject if an invalid endpoint is supplied. return value a promise. example the following example shows how to test for and clear a 'stall' condition in the result of a data transfer. what data can be passed to a usb device and how it is passed is particular and unique to each device. while (true) { let result = await data.transferin(1, 6); if (result.data && result.data.bytelength === 6) { console.log('channel 1...
USBDevice.selectAlternateInterface() - Web APIs
the selectalternateinterface() method of the usbdevice interface returns a promise that resolves when the specified alternative endpoint is selected. syntax var promise = usbdevice.selectalternateinterface(interfacenumber, alternatesetting) parameters interfacenumber the index of one of the interfaces supported by the device. interfaces are device-specific. alternatesetting the configuration of the selected interface. return value a promise. specifications specification status comment webusbthe definition of 'selectalternateinterface()' in that specification. draft initial definition. ...
USBDevice.usbVersionMajor - Web APIs
the usbversionmajor read only property of the usbdevice interface is one of three properties that declare the usb protocol version supported by the device. the other two properties are usbdevice.usbversionminor and usbdevice.usbversionsubminor. syntax var serialnumber = usbdevice.usbversionmajor value the last of three properties that declare the usb protocol version supported by the device. specifications specification status comment webusbthe definition of 'usbversionmajor' in that specification. draft initial definition. ...
USBDevice.usbVersionMinor - Web APIs
the usbversionminor read only property of the usbdevice interface is one of three properties that declare the usb protocol version supported by the device. the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionsubminor. syntax var serialnumber = usbdevice.usbversionminor value the second of three properties that declare the usb protocol version supported by the device. specifications specification status comment webusbthe definition of 'usbversionminor' in that specification. draft initial definition. ...
USBDevice.usbVersionSubminor - Web APIs
the usbversionsubminor read only property of the usbdevice interface is one of three properties that declare the usb protocol version supported by the device. the other two properties are usbdevice.usbversionmajor and usbdevice.usbversionminor. syntax var serialnumber = usbdevice.usbversionsubminor value the first of three properties that declare the usb protocol version supported by the device. specifications specification status comment webusbthe definition of 'usbversionsubminor' in that specification. draft initial definition. ...
USBEndpoint - Web APIs
endpoint numbers will depend on what other interfaces the device provides. this code identifies the correct endpoints by searching for the interface implementing the usb cdc interface class and then identifying the candidate endpoints based on their type and direction. let inendpoint = undefined; let outendpoint = undefined; for (const interface of device.configuration.interfaces) { // only support devices with out multiple alternate interfaces. const alternate = interface.alternates[0]; // identify the interface implementing the usb cdc class. const usb_cdc_class = 10; if (alternate.interfaceclass != usb_cdc_class) { continue; } for (const endpoint of alternate.endpoints) { // identify the bulk transfer endpoints. if (endpoint.type != "bulk") { continue;...
User Timing API - Web APIs
nt removed. if this method is called with no arguments, all measure type entries will be removed from the performance timeline. interoperability as shown in the performance interface's browser compatibility table, the user timing methods are broadly implemented by desktop and mobile browsers (the only exceptions are desktop safari and mobile safari, however the safari technology preview 24 has support). to test your browser's support for this api, run the perf-api-support application. see also user timing standard; w3c editor's draft caniuse data a primer for web performance timing apis; xiaoqian wu; w3c editor's draft ...
validityState.badInput - Web APIs
the read-only badinput property of a validitystate object indicates if the user has provided input that the browser is unable to convert. for example, if you have a number input element whose content is a string. note: while this is unsupported in internet explorer, any non-numeric value will be dismissed from the field if it is a number input. example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe definition of 'validitystate.badinput' in that specification. living standard live standard html 5.1the definition of 'validitystate.badin...
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's pattern attribute. if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true. examples given the following: <p> <label>enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placehold...
Vibration API - Web APIs
describing vibrations vibration is described as a pattern of on-off pulses, which may be of varying lengths. ...
VideoConfiguration - Web APIs
the videoconfiguration dictionary of the media capabilities api is used to define the video file being tested when calling the mediacapabilities methods encodinginfo() and decodinginfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled. properties the videoconfiguration dictionary is made up of five video properties, including: contenttype: a valid video mime type. see our web video codec guide for types which may be supported. width: the width of the video. height: the height of the video. bitrate: the number of bits used to encode one second of the video file. framerate: the number of frames making up one second of video playback. examples // create media configuration to be tested...
VideoTrack.id - Web APIs
Web › API › VideoTrack › id
the id property contains a string which uniquely identifies the track represented by the videotrack. this id can be used with the videotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one specified by a media element's videotracks property. specifications specification status comment html living standardthe definition of 'videotrack: id' in that specification. living standard ...
VideoTrack - Web APIs
at any given time, so setting this property to true for one track while another track is active will make that other track inactive. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within a video track list by calling videotracklist.gettrackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main video track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, a track whose kind is "sign" might have a label of "a sign-language interpretation". thi...
VideoTrackList.length - Web APIs
ck. example this snippet gets the number of video tracks in the first <video> element found in the dom by queryselector(). var videoelem = document.queryselector("video"); var numvideotracks = 0; if (videoelem.videotracks) { numvideotracks = videoelem.videotracks.length; } note that this sample checks to be sure htmlmediaelement.videotracks is defined, to avoid failing on browsers without support for videotrack. specifications specification status comment html living standardthe definition of 'videotracklist: length' in that specification. living standard ...
Visual Viewport API - Web APIs
iewport. it also adds two events, onresize and onscroll, that fire whenever the visual viewport changes. these events allow you to position elements relative to the visual viewport that would normally be anchored to the layout viewport. accessing the api window.visualviewport read only a read-only reference to the window's visualviewport object. if this property doesn't exist, the api is unsupported. interfaces visualviewport represents the visual viewport for a given window. a window's visualviewport object provides information about the viewport's position and size, and receives the resize and event:visualviewport:scroll events you can onitor to know when chances occur to the window's viewport. example the code below is based on the sample the specification, though it adds a...
WEBGL_compressed_texture_astc - Web APIs
ia. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: astc compression is typically available on mali arm gpus, intel gpus, and nividia tegra chips. this extension is available to both, webgl1 and webgl2 contexts. methods this extension exposes one new methods. ext.getsupportedprofiles() returns an array of strings containing the names of the astc profiles supported by the implementation. constants the compressed texture formats are exposed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). constants blocks bits per pixel arraybuffer bytelength bytes if height and width are 512 ...
WEBGL_compressed_texture_etc1 - Web APIs
tion textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture format is exposed by a constant and can be used with the compressedteximage2d() method (note that etc1 is not supported with the compressedtexsubimage2d() method). ext.compressed_rgb_etc1_webgl compresses 24-bit rgb data with no alpha channel. examples var ext = gl.getextension('webgl_compressed_texture_etc1'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.compressedteximage2d(gl.texture_2d, 0, ext.compressed_rgb_etc1_webgl, 512, 512, 0, texturedata); specifications ...
WEBGL_compressed_texture_pvrtc - Web APIs
allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: pvrtc is typically only available on mobile devices with powervr chipsets. it is used in all generations of the iphone, ipod touch and ipad and supported on certain android devices that use a powervr gpu. this extension is available to both, webgl1 and webgl2 contexts. note: on ios devices, this extension is named webkit_webgl_compressed_texture_pvrtc. constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2)...
WEBGL_debug_renderer_info - Web APIs
information about the graphics driver for debugging purposes. depending on the privacy settings of the browser, this extension might only be available to privileged contexts. generally, the graphics driver information should only be used in edge cases to optimize your webgl content or to debug gpu problems. the webglrenderingcontext.getparameter() method can help you to detect which features are supported and the failifmajorperformancecaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow. webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: depending on the privacy settings of the browser, this exten...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
the webgl2renderingcontext.getinternalformatparameter() method of the webgl 2 api returns information about implementation-dependent support for internal formats. syntax any gl.getinternalformatparameter(target, internalformat, pname); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. internalformat a glenum specifying the internal format about which to retrieve information (must be a color-renderable, depth-renderable or stencil-renderable format). pname a glenum specifying the type of information to query. possible values: gl.samples: returns a int32array containing sample counts supported for internalformat in descending order. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
ng the type of the sync object (always gl.sync_fence). gl.sync_status: returns a glenum indicating the status of the sync object (gl.signaled or gl.unsignaled). gl.sync_condition: returns a glenum indicating the sync objects' condition (always gl.sync_gpu_commands_complete). gl.sync_flags: returns a glenum indicating the flags with which the sync object was created (always 0 as no flags are supported). return value depends on the pname parameter, either a glenum or a glbitfield. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.getsyncparameter(sync, gl.sync_status); specifications specification status comment webgl 2.0the definition of 'getsyncparameter' in that specification. editor's draft initial definition for webgl. ...
WebGL2RenderingContext.texStorage2D() - Web APIs
els. internalformat a glenum specifying the texture store format. possible values: gl.r8 gl.r16f gl.r32f gl.r8ui gl.rg8 gl.rg16f gl.rg32f gl.rg8ui gl.rgb8 gl.srgb8 gl.rgb565 gl.r11f_g11f_b10f gl.rgb9_e5 gl.rgb16f gl.rgb32f gl.rgb8ui gl.rgba8 gl.srgb8_aplha8 gl.rgb5_a1 gl.rgba4 gl.rgba16f gl.rgba32f gl.rgba8ui unlike opengl 3.0, webgl 2 doesn't support the following etc2 and eac compressed texture formats (see section 5.37 in the webgl 2 spec). you might be able to enable them via the webgl_compressed_texture_etc extension, though. gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_etc2_eac gl.compressed_srgb8_etc2 gl.compress...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
gl.framebuffer_complete: the framebuffer is ready to display. gl.framebuffer_incomplete_attachment: the attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete. gl.framebuffer_incomplete_missing_attachment: there is no attachment. gl.framebuffer_incomplete_dimensions: height and width of the attachment are not the same. gl.framebuffer_unsupported: the format of the attachment is not supported or if depth and stencil attachments are not the same renderbuffer. when using a webgl 2 context, the following values can be returned additionally: gl.framebuffer_incomplete_multisample: the values of gl.renderbuffer_samples are different among attached renderbuffers, or are non-zero if the attached images are a mix of renderbuffers and ...
WebGLRenderingContext.getExtension() - Web APIs
the webglrenderingcontext.getextension() method enables a webgl extension. syntax gl.getextension(name); parameters name a string for the name of the webgl extension to enable. return value a webgl extension object, or null if name does not match (case-insensitive) to one of the strings in webglrenderingcontext.getsupportedextensions. examples once a webgl extension is enabled, you are able to use the methods, properties or constants that this extension object provides. var canvas = document.getelementbyid('canvas'); gl = canvas.getcontext('webgl'); gl.getextension('webgl_lose_context').losecontext(); webgl extensions extensions for the webgl api are registered in the webgl extension registry. the current extensions are: angle_instanced_arrays ext_blend_minmax ext_colo...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
ther a gl.fragment_shader or a gl.vertex_shader. precisiontype a precision type value. either gl.low_float, gl.medium_float, gl.high_float, gl.low_int, gl.medium_int, or gl.high_int. return value a webglshaderprecisionformat object or null, if an error occurs. exceptions gl.invalid_enum if the shader or precision types aren't recognized. gl.invalid_operation if the shader compiler isn't supported. examples the following code gets the precision format of a gl.vertex_shader with a gl.medium_float precision type. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float); // webglshaderprecisionformat { rangemin: 127, rangemax: 127, precision: 23 } specifications specification s...
WebGLRenderingContext.lineWidth() - Web APIs
minimum and maximum width for a line is implementation defined. the maximum minimum width is allowed to be 1.0. the minimum maximum width is also allowed to be 1.0. because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width. as of january 2017 most implementations of webgl only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits. syntax void gl.linewidth(width); parameters width a glfloat specifying the width of rasterized lines. default value: 1. return value none. examples setting the line width: gl.linewidth(5); getting the line width: gl.getparameter(gl.line_width); getting the range of available widths. ...
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
renderingcontext.uniformmatrix4fv(location, transpose, value); parameters location a webgluniformlocation object containing the location of the uniform attribute to modify. the location is obtained using getuniformlocation(). transpose a glboolean specifying whether to transpose the matrix. must be false. value a float32array or sequence of glfloat values. the values are assumed to be supplied in column major order. return value undefined examples gl.uniformmatrix2fv(loc, false, [2,1, 2,2]); specifications specification status comment webgl 1.0the definition of 'uniformmatrix' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gluniform' in that specification. standard man page of the open...
A basic 2D WebGL animation example - Web APIs
pt> this starts by specifying the precision of the float type, as required. then we set the global gl_fragcolor to the value of the uniform uglobalcolor, which is set by the javascript code to the color being used to draw the square. html the html consists solely of the <canvas> that we'll obtain a webgl context on. <canvas id="glcanvas" width="600" height="460"> oh no! your browser doesn't support canvas! </canvas> javascript globals and initialization first, the global variables. we won't discuss these here; instead, we'll talk about them as they're used in the code to come. let gl = null; let glcanvas = null; // aspect ratio and coordinate system // details let aspectratio; let currentrotation = [0, 1]; let currentscale = [1.0, 1.0]; // vertex information let vertexarray; let...
WebGL constants - Web APIs
constant name value description unpack_flip_y_webgl 0x9240 ...
Lighting in WebGL - Web APIs
in other words, if you want lighting you have to calculate it yourself. fortunately, it's not all that hard to do, and this article will cover some of the basics. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. ...
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
y) is a javascript api for rendering high-performance interactive 3d and 2d graphics within any compatible web browser without the use of plug-ins. webgl does so by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. this conformance makes it possible for the api to take advantage of hardware graphics acceleration provided by the user's device. support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. the webgl 2 api introduces support for much of the opengl es 3.0 feature set; it's provided through the webgl2renderingcontext interface. the <canvas> element is also used by the...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
ge = () => { if (pc.iceconnectionstate === "failed") { pc.restartice(); } }; with this improved technique, instead of directly calling onnegotiationneeded with options to trigger ice restart, the failed ice connection state simply calls restartice(). restartice() tells the ice layer to automatically add the icerestart flag to the next ice message sent. problem solved! rollback no longer supported in the pranswer state the last of the api changes that stand out is that you can no longer roll back when in either of the have-remote-pranswer or the have-local-pranswer states. fortunately, when using perfect negotiation there's no need to do this anyway, since the situations that cause this are caught and prevented before rolling these back ever becomes necessary. thus, attempting to t...
Taking still photos with WebRTC - Web APIs
try this sample then read on to learn how it works. you can also jump straight to the code on github if you like. the html markup our html interface has two main operational sections: the stream and capture panel and the presentation panel. each of these is presented side-by-side in its own <div> to facilitate styling and control. 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 capture a video frame. ...
WebSocket.close() - Web APIs
Web › API › WebSocket › close
f status codes of closeevent for permitted values. reason optional a human-readable string explaining why the connection is closing. this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. syntax_err the reason string is too long or contains unpaired surrogates. note: in gecko, this method didn't support any parameters prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). specifications specification status comment html living standard the definition of 'websocket.close()' in that specification. living standard initial definition ...
WebSocket.send() - Web APIs
Web › API › WebSocket › send
is not currently open. syntax_err the data is a string that has unpaired surrogates. note: gecko's implementation of the send() method differs somewhat from the specification in gecko 6.0; gecko returns a boolean indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in gecko 8.0. as of gecko 11.0, support for arraybuffer is implemented but not blob data types. specifications specification status comment html living standardthe definition of 'websocket: send' in that specification. living standard initial definition ...
Writing a WebSocket server in C# - Web APIs
t breaks down as such: fin (bit 0) rsv1 (bit 1) rsv2 (bit 2) rsv3 (bit 3) opcode (bit 4:7) 1 0 0 0 0x1=0001 fin bit: this bit indicates whether the full message has been sent from the client. messages may be sent in frames, but for now we will keep things simple. rsv1, rsv2, rsv3: these bits must be 0 unless an extension is negotiated which supplies a nonzero value to them. opcode: these bits describe the type of message received. opcode 0x1 means this is a text message. full list of opcodes the second byte, which currently has a value of 131, is another bitfield that breaks down as such: mask (bit 0) payload length (bit 1:7) 1 0x83=0000011 mask bit: defines whether the "payload data" is masked. ...
The WebSocket API (WebSockets) - Web APIs
rary commands (stdin/stdout) as a websocket. ws: a popular websocket client & server library for node.js. jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. related topics ajax javascript specifications specification status comments html living standardthe definition of 'websocket api' in that specification. living standard websockets candidate recommendation rfc 6455: the websocket protocol ietf rfc ...
WebXR application life cycle - Web APIs
etry, simulating cameras, spatial tracking, and more. life cycle outline most applications using webxr will follow a similar overall design pattern: check to see if the user's device and browser are both capable of presenting the xr experience you want to provide. make sure the webxr api is available; if navigator.xr is undefined, you can assume the user's browser and/or device doesn't support webxr. if it's not supported, disable any user interface used to activate xr features and abort any attempts to enter xr mode. call navigator.xr.issessionsupported(), specifying the webxr experience mode you want to provide: inline, immersive-vr, or immersive-ar, in order to determine whether or not the type of session you wish to provide is available. if the session type you want to us...
Rendering and the WebXR frame animation callback - Web APIs
n each pass through the renderer. two of the most common are handling of user inputs and performing updates to the positions of objects (or the viewer) based on known factors, such as those user control states or known animation paths of the objects in the scene. handling user control inputs there are three methods by which users might provide input while using a webxr application. first, webxr supports directly handling inputs from the controllers which are integrated with the xr hardware itself. these input sources may include devices such as hand controllers, optical tracking systems, acclerometers and magnetometers, and other devices of that nature. the second type of input is a gamepad that's connected through the xr system. this uses interfaces inherited from the gamepad api but you ...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
ded and unbounded spaces sometimes when your primary experience uses an unbounded space, you may have a need to temporarily transition the user's experience to a bounded space. for instance, it may be easier to implement the interactions with the objects in a single room in a house by switching to a bounded space representing the single room. this might make it easier to do things like implement support for customizing the walls, placing furniture on the floor, and so forth. in cases like this, where you need to begin tracking using a different reference space than the one you've been using, you can use a combination of getviewerpose() and some matrix computations to transition everything in your scene to be based at the new reference frame's origin. because getviewerpose() is only availab...
Keyframe Formats - Web APIs
yellow", "green" ], // offset: 0, 0.5, 1 }, 2000); the special keys offset, easing, and composite (described below) may be specified alongside the property values. element.animate({ opacity: [ 0, 0.9, 1 ], offset: [ 0, 0.8 ], // shorthand for [ 0, 0.8, 1 ] easing: [ 'ease-in', 'ease-out' ], }, 2000); after generating a suitable set of keyframes from the property value lists, each supplied offset is applied to the corresponding keyframe. if there are insufficient values, or if the list contains null values, the keyframes without specified offsets will be evenly spaced as with the array format described above. if there are too few easing or composite values, the corresponding list will be repeated as needed. implicit to/from keyframes in newer browser versions, you are ...
Web Animations API Concepts - Web APIs
at go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs. history over a decade ago, synchronized multimedia integration language, or smil (pronounced "smile"), brought animation to svg. back then it was the only animation engine browsers had to worry about. while four out of five browsers supported smil, it only animated svg elements, could not be used from css, and was very complex — often leading to inconsistent implementations. ten years later, the safari team introduced the css animations and css transitions specs. the internet explorer team requested an animations api to consolidate and normalize animation functionality across all browsers, and thus efforts began in earnest am...
Controlling multiple parameters with ConstantSourceNode - Web APIs
s to the audiocontext's destination, so that any sound delivered to the gain nodes will reach the output, whether that output be speakers, headphones, a recording stream, or any other destination type. after setting the window's load event handler to be the setup() function, the stage is set. let's see how the action plays out. toggling the oscillators on and off because oscillatornode doesn't support the notion of being in a paused state, we have to simulate it by terminating the oscillators and starting them again when the play button is clicked again to toggle them back on. let's look at the code. function toggleplay(event) { if (playing) { playbutton.innerhtml = "ā–¶ļø"; stoposcillators(); } else { playbutton.innerhtml = "āø"; startoscillators(); } } if the pl...
Migrating from webkitAudioContext - Web APIs
en removed. this attribute was an alias of the loop attribute, so you can just use the loop attribute instead. instead of having code like this: var source = context.createbuffersource(); source.looping = true; you can change it to respect the last version of the specification: var source = context.createbuffersource(); source.loop = true; note, the loopstart and loopend attributes are not supported in webkitaudiocontext. changes to determining playback state the playbackstate attribute of audiobuffersourcenode and oscillatornode has been removed. depending on why you used this attribute, you can use the following techniques to get the same information: if you need to compare this attribute to unscheduled_state, you can basically remember whether you've called start() on the node...
Using IIR filters - Web APIs
s drawn the frequency response of the audio, so you can see what effect the iir filter has. you can check out the full demo here on codepen. also see the source code on github. it includes some different coefficient values for different lowpass frequencies — you can change the value of the filternumber constant to a value between 0 and 3 to check out the different available effects. browser support iir filters are supported well across modern browsers, although they have been implemented more recently than some of the more longstanding web audio api features, like biquad filters. the iirfilternode the web audio api now comes with an iirfilternode interface. but what is this and how does it differ from the biquadfilternode we have already? an iir filter is a infinite impulse response...
Attestation and Assertion - Web APIs
y the authenticator signature - a signature over the clientdatajson and authenticatordata that can be verified with the public key that was created during registration. userhandle - optional. (nullable) a user identifier. this may be a username, or a hash of a username, etc. used by a service to give a scope to credentials. maximum length of 64 bytes. older authenticators (u2f) do not support this output. it's important to highlight that the signature for assertion uses a different key pair than attestation. an assertion is signed using the key pair for a service, which was generated during registration. an attestation is signed using the attestation private key and attestation certificate that were burned into all models of the same device. (except in the case of self-attesta...
Web Authentication API - Web APIs
data breaches, and attacks against sms texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts as a replacement or supplement to those on those existing webpages. similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existi...
Web Speech API - Web APIs
ce. speechsynthesisevent contains information about the current state of speechsynthesisutterance objects that have been processed in the speech service. speechsynthesisutterance represents a speech request. it contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.) speechsynthesisvoice represents a voice that the system supports. every speechsynthesisvoice has its own relative speech service including information about language, name and uri. window.speechsynthesis specced out as part of a [nointerfaceobject] interface called speechsynthesisgetter, and implemented by the window object, the speechsynthesis property provides access to the speechsynthesis controller, and therefore the entry point to speech synthesis ...
Web Storage API - Web APIs
age does the same thing, but persists even when the browser is closed and reopened. stores data with no expiration date, and gets cleared only through javascript, or clearing the browser cache / locally stored data. storage limit is the maximum amongst the three. these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties hang off) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved and removed. a different storage object is used for the sessionstorage and localstorage for each origin — they f...
The structured clone algorithm - Web APIs
ts is not preserved. property descriptors, setters, getters, and similar metadata-like features are not duplicated. for example, if an object is marked readonly with a property descriptor, it will be read/write in the duplicate, since that's the default. the prototype chain is not walked or duplicated. note: native error types can be cloned in chrome, and firefox is working on it. supported types object type notes all primitive types however, not symbols. boolean objects string objects date regexp lastindex is not preserved. blob file filelist arraybuffer arraybufferview including other typed arrays. imagebitmap i...
Using Web Workers - Web APIs
in and out of a thread through serialized objects. so you have to work really hard to cause problems in your code. content security policy workers are considered to have their own execution context, distinct from the document that created them. for this reason they are, in general, not governed by the content security policy of the document (or parent worker) that created them. so for example, suppose a document is served with the following header: content-security-policy: script-src 'self' among other things, this will prevent any scripts it includes from using eval(). however, if the script constructs a worker, code running in the worker's context will be allowed to use eval(). to specify a content security policy for the worker, set a content-security-policy response header for the r...
window.cancelAnimationFrame() - Web APIs
equestanimationframe() that requested the callback. examples var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; var cancelanimationframe = window.cancelanimationframe || window.mozcancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff. other browsers can use something like date.now(). var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // t...
Window.controllers - Web APIs
the controllers property of the window interface returns the xul controllers of the chrome window. syntax controllers = window.controllers controllers is an object of type xulcontrollers (nsicontrollers). specification xul-specific. not part of specification. by default, a window's controller contains the code that supports the global window commands. chrome code can add controllers (to be used in conjunction with the godocommand and goupdatecommand functions in globaloverlay.js). however, the added controllers must be explicitly removed when the window is unloaded, as this is not done automatically. each missing removal can cause bug 415775: assertion: xpconnect is being called on a scope without a 'components' property! ...
Window.convertPointFromNodeToPage() - Web APIs
given a point specified in a particular dom node's coordinate system, the window method convertpointfromnodetopage() returns a point which specifies the same position in the page's coordinate system. this method is non-standard and should not be used. please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses). syntax point = window.convertpointfromnodetopage(node, nodepoint); parameters node the node in whose coordinate system the point specified by nodepoint is described. nodepoint a point object describing a point in node's coordinate system; this point will be converted to the page's coordinate system. return value a point object specifying a point in the page's coordinate system. specification...
Window.convertPointFromPageToNode - Web APIs
given a point specified in the page's coordinate system, the window method convertpointfrompagetonode() returns a point object specifying the same location in the coordinate system of the specified dom node. please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses). syntax point = window.convertpointfrompagetonode(node, pagepoint); parameters node the node into whose coordinate system the point is to be converted. pagepoint a point object specifying a point in the coordinate system of the page, which is to be converted into the node's coordinate system. return value a point object describing the specified location in the node's coordinate system. specifications this method was specified in the d...
Window.find() - Web APIs
Web › API › Window › find
see bug 672395. the window.find() method finds a string in a window. syntax window.find(astring, acasesensitive, abackwards, awraparound, awholeword, asearchinframes, ashowdialog); astring the text string for which to search. acasesensitive boolean. if true, specifies a case-sensitive search. abackwards boolean. if true, specifies a backward search. awraparound boolean. if true, specifies a wrap around search. awholeword unimplemented boolean. if true, specifies a whole word search. this is not implemented; see bug 481513. asearchinframes boolean. if true, specifies a search in frames. returns true if the string is found; otherwise, false. ...
Window.getAttention() - Web APIs
button for the window flashes, if this hasn't been disabled by the user. on linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately. this may be configurable as well. on macintosh, the icon in the upper right corner of the desktop flashes. the function is disabled for web content. neither gecko nor internet explorer supports this feature now for web content. getattention will still work when used from chrome in a gecko application. specification dom level 0. not part of specification. ...
Window.getComputedStyle() - Web APIs
o match. omitted (or null) for real elements. the returned style is a live cssstyledeclaration object, which updates automatically when the element's styles are changed. throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted(). note: valid pseudo-element selector refers to syntactic validity, e.g. ::unsupported is considered valid, even though the pseudo-element itself is not supported. examples in this example we style a <p> element, then retrieve those styles using getcomputedstyle(), and print them into the text content of the <p>. html <p>hello</p> css p { width: 400px; margin: 0 auto; padding: 20px; font: 2rem/2 sans-serif; text-align: center; background: purple; colo...
Window: message event - Web APIs
the message event is fired on a window object when the window receives a message, for example from a call to window.postmessage() from another browsing context. ...
Obsolete features - Web APIs
fullscreen this feature no longer works in msie 6 sp2 the way it worked in msie 5.x. the windows taskbar, as well as the titlebar and the status bar of the window are not visible, nor accessible when fullscreen is enabled in msie 5.x. fullscreen always upsets users with large monitor screen or with dual monitor screen. ...
Window.pageYOffset - Web APIs
the read-only window property pageyoffset is an alias for scrolly; as such, it returns the number of pixels the document is currently scrolled along the vertical axis (that is, up or down) with a value of 0.0, indicating that the top edge of the document is currently aligned with the top edge of the window's content area. there is slightly better support for pageyoffset than for scrolly in older browsers, but if you're not concerned about browsers more than a handful of years old, you can use either one. the corresponding pagexoffset property, which returns the number of pixels scrolled along the horizontal axis (left and right), is an alias for scrollx. syntax yoffset = window.pageyoffset; value a floating-point number specifying the number of pixels the document is scrolled vertical...
Window.pkcs11 - Web APIs
Web › API › Window › pkcs11
obsolete since gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary returns the pkcs11 object, which is used to install drivers and other software associated with the pkcs11 protocol. if pkcs11 isn't supported, this property returns null. note: this property has been returned null since gecko 1.9.0.14 (firefox 3.0.14) and removed in gecko 29.0 (firefox 29 / thunderbird 29 / seamonkey 2.26)) for security reasons. for more information on installing pkcs11 modules, see installing pkcs11 modules. see bug 326628 for details on why the property was removed. syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod,...
Window.requestAnimationFrame() - Web APIs
timing control for script-based animationsthe definition of 'requestanimationframe' in that specification. obsolete initial definition ...
Window.scrollX - Web APIs
Web › API › Window › scrollX
t's greater than 400 pixels, the window is scrolled back to the beginning. if (window.scrollx > 400) { window.scroll(0,0); } notes the pagexoffset property is an alias for the scrollx property: window.pagexoffset == window.scrollx; // always true for cross-browser compatibility, use window.pagexoffset instead of window.scrollx. additionally, older versions of internet explorer (< 9) do not support either property and must be worked around by checking other non-standard properties. a fully compatible example: var x = (window.pagexoffset !== undefined) ? window.pagexoffset : (document.documentelement || document.body.parentnode || document.body).scrollleft; var y = (window.pageyoffset !== undefined) ? window.pageyoffset : (document.documentelement || document.body.parentnode ||...
WindowOrWorkerGlobalScope.atob() - Web APIs
ded data from encodeddata. exceptions domexception (name: invalidcharactererror) throws if encodeddata is not valid base64. example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string polyfill you can use a polifill from https://github.com/maxart2501/base64-js/blob/master/base64.js for browsers that don't support it. specifications specification status comment html living standardthe definition of 'windoworworkerglobalscope.atob()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.atob()' in that specification. recommendation snapshot of html living st...
WindowOrWorkerGlobalScope.btoa() - Web APIs
specifications specification status comment html living standardthe definition of 'windoworworkerglobalscope.btoa()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html 5.1the definition of 'windowbase64.btoa()' in that specification. recommendation snapshot of html living st...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
lert before it happens</button> javascript var timeoutid; function delayedalert() { timeoutid = window.settimeout(window.alert, 2*1000, 'that was really slow!'); } function clearalert() { window.cleartimeout(timeoutid); } result see also cleartimeout() example. polyfill if you need to pass one or more arguments to your callback function, but need it to work in browsers which don't support sending additional arguments using either settimeout() or setinterval() (e.g., internet explorer 9 and below), you can include this polyfill to enable the html5 standard arguments-passing functionality. just add this code to the top of your script: /*\ |*| |*| polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax...
Worker - Web APIs
Web › API › Worker
eerror event is raised. methods inherits methods from its parent, eventtarget, and implements methods from abstractworker. worker.postmessage() sends a message — consisting of any javascript object — to the worker's inner scope. worker.terminate() immediately terminates the worker. this does not let worker finish its operations; it is halted at once. serviceworker instances do not support this method. events message fires when the worker's parent receives a message from that worker. also available via the onmessage property. messageerror fires when a worker object receives a message that can't be deserialized. also available via the onmessageerror property. rejectionhandled fires every time a promise rejects, regardless of whether or not there is a handler to ca...
WorkerGlobalScope - Web APIs
on to execute in a given amount of time. deprecated methods workerglobalscope.close() discards any tasks queued in the workerglobalscope's event loop, effectively closing this particular scope. in newer browser versions, close() is available on dedicatedworkerglobalscope and sharedworkerglobalscope instead. this change was made to stop close() being available on service workers, as it isn't supposed to be used there and always throws an exception when called (see bug 1336043). example you won't access workerglobalscope directly in your code; however, its properties and methods are inherited by more specific global scopes such as dedicatedworkerglobalscope and sharedworkerglobalscope. for example, you could import another script into the worker and print out the contents of the worker...
Worklet.addModule() - Web APIs
Web › API › Worklet › addModule
working draft ...
WritableStream.getWriter() - Web APIs
released. syntax var writer = writablestream.getwriter(); parameters none. return value a writablestreamdefaultwriter object instance. exceptions typeerror the stream you are trying to create a writer for is not a writablestream. examples the following example illustrates several features of this interface. it shows the creation of the writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
er = new writablestreamdefaultwriter(stream); parameters stream the writablestream to be written to. return value an instance of the writablestreamdefaultwriter object. exceptions typeerror the provided stream value is not a writablestream, or it is locked to another writer already. examples the following example shows the creation of a writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or...
WritableStreamDefaultWriter.close() - Web APIs
s none. return value a promise, which fulfills with the undefined if all remaining chunks were successfully written before the close, or rejects with an error if a problem was encountered during the process. exceptions typeerror the stream you are trying to close is not a writablestream. examples the following example shows the creation of a writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or...
WritableStreamDefaultWriter.write() - Web APIs
itablestream. return value a promise, which fulfills with the undefined upon a successful write, or rejects if the write fails or stream becomes errored before the writing process is initiated. exceptions typeerror the target stream is not a writable stream, or it does not have an owner. examples the following example shows the creation of a writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or...
WritableStreamDefaultWriter - Web APIs
ear errored in the same way from now on; otherwise, the writer will appear closed. writablestreamdefaultwriter.write() writes a passed chunk of data to a writablestream and its underlying sink, then returns a promise that resolves to indicate the success or failure of the write operation. examples the following example shows the creation of a writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or...
XDomainRequest - Web APIs
this interface can send both get and post requests. ...
XMLDocument.load() - Web APIs
Web › API › XMLDocument › load
document.load() is a part of an old version of the w3c dom level 3 load & save module. can be used with document.async to indicate whether the request is synchronous or asynchronous (the default). as of at least gecko 1.9, this no longer supports cross-site loading of documents (use xmlhttprequest or fetch() instead). examples var xmldoc = document.implementation.createdocument("", "test", null); function documentloaded (e) { alert(new xmlserializer().serializetostring(e.target)); // gives querydata.xml contents as string } xmldoc.addeventlistener("load", documentloaded, false); xmldoc.load('querydata.xml'); see also the load sample in the xml tests directory. (to test this functionality, create the files on your local disk or on a webserver rather than loading the load.html file...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
e difference let sslerr = math.abs(nsinsserrorsservice.nss_ssl_error_base) - (status & 0xffff); switch (sslerr) { case 3: // ssl_error_no_certificate, ssl(3) errname = 'securitynocertificateerror'; break; case 4: // ssl_error_bad_certificate, ssl(4) errname = 'securitybadcertificateerror'; break; case 8: // ssl_error_unsupported_certificate_type, ssl(8) errname = 'securityunsupportedcertificatetypeerror'; break; case 9: // ssl_error_unsupported_version, ssl(9) errname = 'securityunsupportedtlsversionerror'; break; case 12: // ssl_error_bad_cert_domain, ssl(12) errname = 'securitycertificatedomainmismatcherror'; break; default: ...
Sending and Receiving Binary Data - Web APIs
ta as well. var myarray = new arraybuffer(512); var longint8view = new uint8array(myarray); // generate some data for (var i=0; i< longint8view.length; i++) { longint8view[i] = i % 256; } var xhr = new xmlhttprequest; xhr.open("post", url, false); xhr.send(myarray); this is building a 512-byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course. note: support for sending arraybuffer objects using xmlhttprequest was added to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6). add information about other browsers' support here. submitting forms and uploading files please, read this paragraph. firefox-specific examples this example transmits binary content asynchronously, using the post method, and firefox's non-standard sendasbinary(). v...
Using XMLHttpRequest in IE6 - Web APIs
xmlhttprequest was first introduced by microsoft in internet explorer 5.0 as an activex control. however, in ie7 and other browsers xmlhttprequest is a native javascript object. ...
XMLHttpRequest.multipart - Web APIs
y feature was removed in firefox/gecko 22. please use server-sent events, web sockets, or responsetext from progress events instead. this boolean indicates if the response is expected to be a stream of possibly multiple xml documents. if set to true, the content type of the initial response must be multipart/x-mixed-replace or an error will occur. all requests must be asynchronous. this enables support for server push; for each xml document that's written to this request, a new xml dom document is created and the onload handler is called between documents. note: when this is set, the onload handler and other event handlers are not reset after the first xmldocument is loaded, and the onload handler is called after each part of the response is received. ...
XMLHttpRequest.open() - Web APIs
) method does not return until the response is received. if true, notification of a completed transaction is provided using event listeners. this must be true if the multipart attribute is true, or an exception will be thrown. note: synchronous requests on the main thread can be easily disruptive to the user experience and should be avoided; in fact, many browsers have deprecated synchronous xhr support on the main thread entirely. synchronous requests are permitted in workers. user optional the optional user name to use for authentication purposes; by default, this is the null value. password optional the optional password to use for authentication purposes; by default, this is the null value. specifications specification status comment xmlhttprequestthe...
XMLHttpRequest.response - Web APIs
the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. example this example presents a function, load(), which loads and processes a page from the server. it works by creating an xmlhttprequest object and creating a listener for readystatechange events such that that when readystate changes to done (4), the response is obtained and passed into the callback function provided to load(). the content is handled as raw t...
XMLHttpRequest - Web APIs
obsolete since gecko 6 read only arraybuffer. the response to the request, as a javascript typed array. xmlhttprequest.multipartobsolete since gecko 22 this gecko-only feature, a boolean, was removed in firefox/gecko 22. please use server-sent events, web sockets, or responsetext from progress events instead. event handlers onreadystatechange as a property of the xmlhttprequest instance is supported in all browsers. since then, a number of additional event handlers have been implemented in various browsers (onload, onerror, onprogress, etc.). see using xmlhttprequest. more recent browsers, including firefox, also support listening to the xmlhttprequest events via standard addeventlistener() apis in addition to setting on* properties to a handler function. methods xmlhttprequest.a...
XMLHttpRequestResponseType - Web APIs
the mime type of the received data. see html in xmlhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. deprecated values moz-chunked-arraybuffer a firefox-only value which instructs xmlhttprequest to deliver arraybuffer objects containing chunks of the incoming data. accessing response during a progress event returns the data received so far. outside the progress event handler, the value of response is always null. you shouldn't use this non-standard (and, as ...
XPathEvaluator.evaluate() - Web APIs
nvalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised. not_supported_err if the provided context node is not a type permitted as an xpath context node or the request type is not permitted by the xpathevaluator, a domexception of type not_supported_err is raised. example the following example shows the use of the evaluate() method. html <div>xpath example</div> <di...
XPathException - Web APIs
properties xpathexception.code read only returns a short that contains one of the error code constants. constants constant value description 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. type_err 52 if the expression cannot be converted to return the specified type. specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexception' in that specification. recommendation initial definition ...
XPathExpression.evaluate() - Web APIs
nvalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised. not_supported_err if the provided context node is not a type permitted as an xpath context node or the request type is not permitted by the xpathevaluator, a domexception of type not_supported_err is raised. example the following example shows the use of the evaluate() method. html <div>xpath example</div> <di...
XRInputSourceArray.entries() - Web APIs
syntax let inputsourceiterator = xrinputsourcearray.entries(); for (let entry of xrinputsourcearray.entries()) { /* ... */ } parameters none. return value an iterator which can be used to walk through the list of xrinputsource objects included in the input source array. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. let sources = xrsession.inputsources; for (let input of sources.entries()) { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } } for e...
XRInputSourceArray.forEach() - Web APIs
mation, you may omit this. thisarg optional the value to be used for this while executing the callback. note that if you use arrow function notation (=>) to provide the callback, you can omit thisarg, since all arrow functions lexically bind this. return value undefined. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. let inputsources = xrsession.inputsources; inputsources.foreach((input) => { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } }); for...
XRInputSourceArray.keys() - Web APIs
a javascript iterator that can be used to walk through the keys for each entry in the list of input sources. the values returned by the iterator are the indexes of each entry in the list; that is, the numbers 0, 1, 2, and so forth through the index of the last item in the list. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. for (const inputidx of xrsession.inputsources.keys()) { /* the keys are the indexes into the list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys. for each key, the input is retrieved using the index with array notation: xrsession.inputsources[inputidx]. specifications specification status com...
XRInputSourceArray.length - Web APIs
indicating the number of xrinputsource objects representing webxr input sources are includled in the array. examples in this example, a game that requires at least one input source uses length to check this before proceeding to allow the user to play the game. ...
XRPermissionDescriptor.mode - Web APIs
e if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes examples the example below checks to ensure that permission has been granted to allow the user to use webxr for an immersive virtual reality experience. no specific features are specified during this query; see requiredfeatures and optionalfeatures for more information on specifying features during a webxr permission check. let xrpermissiondesc = { name: "xr", mode: "imm...
XRPermissionDescriptor.optionalFeatures - Web APIs
om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace usage notes examples let xrpermissiondesc = { na...
XRPermissionStatus.granted - Web APIs
om their origin point. the viewer isn't tracked at all; tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a tracking space whose native origin tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both immersive and inline, though it's most useful for inline sessions. it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace usage notes examples specifications spec...
XRPose - Web APIs
Web › API › XRPose
see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. properties xrpose.transform read only a xrrigidtransform which provides the position and orientation of the pose relative to the base xrspace. xrpose.emulatedposition read only a...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
e(drawframe); }); in this code, we obtain a local reference space, then use getoffsetreferencespace() to create a new space whose origin is adjusted to a position given by startposition and whose orientation is looking directly along the z azis. then the first animation frame is requested using xrsession's requestanimationframe(). implementing rotation based on non-xr inputs the input controls supported directly by webxr are all dedicated vr or ar input devices. in order to use mouse, keyboard, or other input devices to move or otherwise transform objects in the 3d space—or to allow the user to move through the space—you'll need to write some code to read the inputs and move perform the movements. this is another good use case for getoffsetreferencespace(). in this example, we'll show...
XRRigidTransform.position - Web APIs
; } else { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable immersivesession is true; if so, we first request a bounded-floor reference space. if that fails (probably because bounded-floor isn't supported), we try requesting a local-floor reference space. if we're not in an immersive session, we instead request a viewer reference space. in all cases, once the space has been obtained, it gets passed into the refspacecreated() function. for immersive spaces, the specified space is simply saved for future use. however, for inline sesions, we know we're in a space not automatically adjusted fo...
XRSession.inputSources - Web APIs
urns an xrinputsourcearray object which lists all controllers and input devices which are expressly associated with the xr device and are currently available. these controllers may include handheld controllers, xr-equipped gloves, optically tracked hands, and gaze-based input methods. keyboards, gamepads, and mice are not considered webxr input sources. note: traditional gamepad controllers are supported using the gamepad api. syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object listing all of the currently-connected input controllers which are linked specifically to the xr device currently in use. the returned object is live; as devices are connected to and removed from the user's system, the list's contents update to reflect the changes. usage notes you ...
XRSession.requestAnimationFrame() - Web APIs
eger value which serves as a unique, non-zero id or handle you may pass to cancelanimationframe() if you need to remove the pending animation frame request. example the following example requests xrsession with "inline" mode so that it can be displayed in an html element (without the need for a separate ar or vr device). note: a real application should check that the device and the user agent support webxr api at all and then that they both support the desired session type via xr.issessionsupported(). // obtain xr object const xr = navigator.xr // request a new xrsession xr.requestsession("inline").then((xrsession) => { xrsession.requestanimationframe((time, xrframe) => { let viewer = xrframe.getviewerpose(xrreferencespace) gl.bindframebuffer(xrwebgllayer.framebuffer) fo...
XRSystem: devicechange event - Web APIs
able a ui element which the user can use to activate immersive mode. this is shown in the example below. example the example shown here handles the devicechange event by toggling the availability of the "enter xr" button based on whether or not any immersive devices are currently available. if (navigator.xr) { navigator.xr.addeventlistener("devicechange", event => { navigator.xr.issessionsupported("immersive-vr") .then(immersiveok) => { if (immersiveok) { enablexrbutton.disabled = false; } else { enablexrbutton.disabled = true; } }); }); } when devicechange is received, the handler set up in this code calls the xr method issessionsupported() to find out if there's a device available that can handle immersive vr presentations. if there is...
XRView.transform - Web APIs
Web › API › XRView › transform
outside the rendering loop; this avoids repeatedly allocating and deallocating the matrices, and generally reduces overhead by reusing the same matrix for each object rendered. then we iterate over each xrview found in the xrviewerpose's list of views. there will usually be two: one for the left eye and one for the right, but there may be only one if in monoscopic mode. currently, webxr doesn't support more than two views per pose, although room has been left to extend the specification to support that in the future with some additions to the api. for each view, we obtain its viewport and pass that to webgl using gl.viewport(). for the left eye, this will be the left half of the canvas, while the right eye will use the right half. then we iterate over each object that makes up the scene. ...
XRWebGLLayer() - Web APIs
nal the frame buffer's color buffer will be established with an alpha channel if the alpha boolean property is true. otherwise, the color buffer will not have an alpha channel. the default value is true. antialias optional a boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. the browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. the default value is true. depth optional a boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated. the default is true. framebufferscalefactor optional a floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the ...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
maller than the diplay's native dimensions, resulting in the output being up-scaled for display to the screen after rendering into the frame buffer. if the scaling factor is less than zero, the frame buffer is larger than the native resolution of the display, resulting in the frame buffer's contents being scaled down for display to the xr device. this can happen for display environments which use superscaling or anti-aliasing techniques to improve perceived image quality. syntax let nativescaling = xrwebgllayer.getnativeframebufferscalefactor(session); parameters session the xrsession for which to return the native framebuffer scaling factor. return value a floating-point value which, when multiplied by the xrsession's recommended framebuffer dimensions, results in the xr device's n...
XRWebGLLayerInit - Web APIs
nal the frame buffer's color buffer will be established with an alpha channel if the alpha boolean property is true. otherwise, the color buffer will not have an alpha channel. the default value is true. antialias optional a boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. the browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. the default value is true. depth optional a boolean value which, if true, requests that the new layer have a depth buffer; otherwise, no depth layer is allocated. the default is true. framebufferscalefactor optional a floating-point value which is used to scale the image during compositing, with a value of 1.0 represents the default pixel size for the ...
Browser Differences - Web APIs
browser differences netscape 7.x (all platforms) and internet explorer 6 (windows) support the w3c xslt 1.0 standard (http://www.w3.org/tr/xslt). ie 5.0 and 5.5 (both windows) supported only the working draft of xslt, and thus are not compatible with xslt 1.0 stylesheets. netscape 6.x only partially supported xslt 1.0. ...
Introduction - Web APIs
y one file) way to change the look of content. css (cascade style sheets) was one of the first ways proposed by the w3c. css is a simple way to apply style rules to a web document. these style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remo...
ARIA Screen Reader Implementors Guide - Accessibility
live regions this is just a guide. live region markup is a complex area which is somewhat open to interpretation. the following is intended to provide implementation guidance that respects screen readers developers' need to try different things. the intention is to strike a balance between providing useful guidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete. interpreting wai-aria live region markup live changes are hints: in general live region markup is provided by the author as hints, and the assistive technology may allow for global, site or even region-specific settings, as well as heuristics to help with live changes on pages that have no wai-aria hints. optionally, create a second, additional...
ARIA Technique Template - Accessibility
description possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: code working examples: notes aria attributes used related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources ...
Using the aria-activedescendant attribute - Accessibility
s be visible on screen and must be a descendant of the container in the document object model. ...
Using the aria-describedby attribute - Accessibility
example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document. used by aria roles all elements of the base markup related aria techniques using the aria-labelledby attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-describedby ...
Using the aria-invalid attribute - Accessibility
lid should not be set to true before the form is submitted - only in response to validation. future expansion may add terms to the vocabulary used for this attribute. ...
Using the aria-label attribute - Accessibility
ria-label="close" onclick="mydialog.close()">x</button> notes the most common accessibility api mapping for a label is the accessible name property. ...
Using the aria-orientation attribute - Accessibility
href="#" id="handle_zoomslider" role="slider" aria-orientation="vertical" aria-valuemin="0" aria-valuemax="17" aria-valuenow="14" > <span>11</span> </a> working examples: slider example notes used with aria roles scrollbar listbox combobox menu tree separator slider tablist toolbar related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the aria-orientation attribute ...
Using the aria-valuemax attribute - Accessibility
he snippet below shows a simple slider with a maximum value of 10. ...
Using the aria-valuemin attribute - Accessibility
the snippet below shows a simple slider with a minimum value of 1. ...
Using the aria-valuenow attribute - Accessibility
the snippet below shows a simple slider with a current value of 4. ...
Using the aria-valuetext attribute - Accessibility
ute is used to provide the name of the day. the application would programmatically update aria-valuetext depending on aria-valuenow. ...
Using the presentation role - Accessibility
s and therefore not normative. ...
Using the progressbar role - Accessibility
"100">20 %</div> example 2: using aria-valuetext <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuetext="step 2: copying files... " aria-valuemax="100"> step 2: copying files... </div> working examples: notes aria attributes used progressbar aria-valuenow aria-valuemin aria-valuemax aria-valuetext related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources ...
Using the radio role - Accessibility
" /> 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="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> working examples: notes aria attributes used related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources ...
Using the slider role - Accessibility
lue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for the slider role ...
Using the toolbar role - Accessibility
e technology. ...
Using ARIA: Roles, states, and properties - Accessibility
authors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element). addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom. ...
How to file ARIA-related bugs - Accessibility
if you notice an implementation issue, please take a little time and let the developers know. here's where to file bugs: when finding a bug, please also update the relevant compatibility tables in the examples page. ...
ARIA: tabpanel role - Accessibility
the definition of 'tabpanel' in that specification. recommendation wai-aria authoring practicesthe definition of 'tabpanel' in that specification. working draft precedence order what are the related properties, and in what order will this attribute or property be read (which property will take precendence over this one, and which property will be overwritten. screen reader support tbd ...
ARIA: alert role - Accessibility
that has display: none; by default. when the display value is changed with css or javascript, it would automatically trigger the screen reader to read out the content. <p role="alert" style="display: none;">the alert will trigger when the element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation. with javascript, developers control the adding and removing of alerts as appropriate. <button type="button" onclick="triggeralert">trigger alert</button> <p class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = docu...
ARIA: application role - Accessibility
that uses the arrow keys to position elements on the slide, and uses audio feedback via an aria live region to communicate the position and overlap status with other objects. focus is being managed via aria-activedescendant. the tab , space and enter keys, as well as escape , must be handled by the application. the one exception is if focus is set to a standard widget inside the application that supports keyboard navigation from the browser, for example an input element. required javascript features keypress used to handle keyboard input and control the focus click, touch handle as appropriate for your widget as well changing attribute values aria-activedescendant is used to manage the focus inside the application container. set in response to keyboard or other application events th...
ARIA: banner role - Accessibility
page's banner in this way will help improve the site's accessibility. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria: banner role' in that specification. recommendation wai-aria authoring practicesthe definition of 'banner landmark role' in that specification. working draft screen reader support tbd ...
ARIA: cell role - Accessibility
<div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> a better, more semantic way of writing the cells above would be to use the semantic <td> element. ...
ARIA: Comment role - Accessibility
ch 30 2019, 21:02</time></p> </div> </div> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. specifications will be part of wai-aria 1.3, which is still being drafted. screen reader support tbd ...
ARIA: contentinfo role - Accessibility
sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'contentinfo landmark role' in that specification. recommendation wai-aria authoring practicesthe definition of 'contentinfo landmark role' in that specification. working draft screen reader support ...
ARIA: document role - Accessibility
nefits the document role is an easy way to indirectly control assistive technology behavior by unambiguously stating that this is content the user should read with standard screen reader commands. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'document' in that specification. recommendation screen reader support ...
ARIA: figure role - Accessibility
sic, cats, nature, and ice cream"> <pre><code> let awesome = ['music', 'cats', 'nature', 'ice cream']; </code></pre> <figcaption>figure 1: the four layers of awesome.</figcaption> </figure> specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'figure' in that specification. recommendation screen reader support tbd ...
ARIA: form role - Accessibility
vigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria form role' in that specification. recommendation wai-aria authoring practicesthe definition of 'role form' in that specification. working draft screen reader support tbd ...
ARIA: grid role - Accessibility
e that the functionality and interaction needed can be best achieved using the grid role. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'role grid' in that specification. recommendation wai-aria authoring practicesthe definition of 'role grid' in that specification. working draft screen reader support tbd ...
ARIA: List role - Accessibility
ested lists, are visible to assistive technologies. note: if you are marking up a list of items that will function as a tabbed interface, you should instead use the tab, tabpanel, and tablist roles. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'list' in that specification. recommendation screen reader support tbd ...
ARIA: Listitem role - Accessibility
stinguish between ordered and unordered lists. note: if you are marking up a list of items that will function as a tabbed interface, you should instead use the tab, tabpanel, and tablist roles. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'listitem' in that specification. recommendation screen reader support tbd ...
ARIA: Main role - Accessibility
large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria navigtion role' in that specification. recommendation wai-aria authoring practicesthe definition of 'navigation landmark role' in that specification. working draft screen reader support tbd ...
ARIA: Mark role - Accessibility
he document. ...
ARIA: Navigation Role - Accessibility
large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria navigtion role' in that specification. recommendation wai-aria authoring practicesthe definition of 'navigation landmark role' in that specification. working draft screen reader support tbd ...
ARIA: Region role - Accessibility
gate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria region role' in that specification. recommendation wai-aria authoring practicesthe definition of 'region landmark role' in that specification. working draft screen reader support tbd ...
ARIA: img role - Accessibility
es, states, and properties aria-label an accessible name is required. an aria-label attribute keyboard interactions required javascript features examples star rating role="img" example specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'img' in that specification. recommendation screen reader support tbd ...
ARIA: Suggestion role - Accessibility
ark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <ins> and <del> element will automatically communicate a section has a role of insertion or deletion. if at all possible, prefer using the html elements. specifications will be part of wai-aria 1.3, which is still being drafted. screen reader support tbd ...
ARIA: tab role - Accessibility
aria) 1.1the definition of 'tab' in that specification. recommendation wai-aria authoring practicesthe definition of 'tabs' in that specification. working draft precedence order what are the related properties, and in what order will this attribute or property be read (which property will take precendence over this one, and which property will be overwritten. screen reader support tbd ...
ARIA: table role - Accessibility
windex on each cell. the aria-colindex or aria-rowindex is set to the position of a cell within the row or column, respectively. if the table includes cells that span multiple rows or multiple columns, then aria-rowspan or aria-colspan should be included as well. realize, it is much simpler to simply use the <table> element, along with all the related semantic elements and attributes that are all supported by all assistive technologies. to create an interactive widget that has a tabular structure, use the grid pattern instead. if the interaction provides for the selection state of individual cells, if left to right and top to bottom navigation is provided, or if the user interface allows the rearranging of cell order or otherwise changing individual cell order such as through drag and drop, ...
ARIA: dialog role - Accessibility
content using their screen reader's virtual cursor. it is important for developers to ensure that content outside of the modal dialog is inaccessible to all users while the modal dialog is active. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'alert' in that specification. recommendation screen reader support coming soon ...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
ml elements you want to concatenate into a single accessible name. both aria-labelledby and aria-describedby are specified on the form element that is to be labelled, for example an <input> in both cases, the label for/label control bindings that may also exist are overridden by aria-labelledby. if on an html page you provide aria-labelledby, you should also provide a label for construct to also support older browsers that do not have aria support yet. with firefox 3, your blind users will automatically get better accessibility from the new attribute, but the users of older browsers are not left in the dark this way. example: shut down computer after minutes <input aria-labelledby="labelshutdown shutdowntime shutdownunit" type="checkbox" /> <span id="labelshutdown">shut down computer aft...
Accessibility FAQ - Accessibility
where can i find more about mozilla's accessibility initiatives? mozilla accessibility project what are some of the built-in accessibility features that are currently supported in the browser? firefox 3 accessibility features (archive.org) which assistive technologies support firefox and thunderbird? assistive technology compatibility - documents assistive technologies for windows, linux, unix, mac os x and the degree of compatibility with firefox what can i do to make sure my mozilla extensions are accessible? in general, use the accessible toolkit checklist (archive.org). for interface design with xul, follow the accessibile xul authoring guidelines (archive.org). i'm interested in helping promote the fine accessibility features that firefox provides, what can i do? j...
Keyboard-navigable JavaScript widgets - Accessibility
tive elements that do not exist in html. grouping controls for grouping widgets such as menus, tablists, grids, or tree views, the parent element should be in the tab order (tabindex="0"), and each descendent choice/tab/cell/row should be removed from the tab order (tabindex="-1"). users should be able to navigate the descendent elements using arrow keys. (for a full description of the keyboard support that is normally expected for typical widgets, see the wai-aria authoring practices.) the example below shows this technique used with a nested menu control. once keyboard focus lands on the containing <ul> element, the javascript developer must programmatically manage focus and respond to arrow keys. for techniques for managing focus within widgets, see "managing focus inside groups" below.
Web Accessibility: Understanding Colors and Luminance - Accessibility
.2.4), the rationale being that rgb is hardware-oriented, reflecting the use of crts, and that rgb is non-intuitive. that said, hsl colors incorporate lightness, not luminance, and this is a significant consideration. note that in that same section of the css color module 3, there are algorigthms available to translate the hsl to rgb. newer technologies, such as opengl and direct3d incorporate support for the srgb gamma curve, although some articles for opengl reference use of rgba rather than srgb. webgl is usually in the rgba format; see an example of how it is used in "clearing with colors". where accessibility is concerned, however, standards and guidelines are currently written predominantly using the srgb color space, especially as it applies to color contrast ratios. in speaking...
Keyboard - Accessibility
eydown event handler; in most cases, the action taken by event handler should be the same for both types of events. see also tabindex global html attribute global event handlers: onkeydown global event handlers: onkeyup interactive elements must be able to be activated using a keyboard if the user can interact with an element using touch or a pointing device, then the element should also support interacting using the keyboard. that is, if you have defined event handlers for touch or click events, you should also define them for keyboard events. the keyboard event handlers should enable the effectively the same interaction as the touch or click handlers. see also global event handlers: onkeydown global event handlers: onkeyup interactive elements must be focusable if the user ...
Text labels and names - Accessibility
ments, both <iframe> and the older, obsolete <frame>, must have a title to describe the contents of the frame. use the title attribute to label a frame element. without a title, users of assistive technologies have to navigate into the frame in order to understand what it contains, which can be difficult and confusing. the <frame> element is no longer part of the html specification as of html5. support for it may be dropped by browsers in the future. in addition, it is difficult for screen readers to navigate pages with <frame> elements. for best accessibility and future maintenance, redesign any pages that use frames to use css to achieve a similar layout. as a best practice, also provide a <title> for the document that is enclosed in the frame, with content identical to the frame's title...
Understandable - Accessibility
way to handle this is to again provide links to glossary pages containing the acronym expansion and explanation, or at the very least include them in the surrounding text in context. see abbreviations. 3.1.5 reading level (aaa) if text is provided that requires a higher reading level that lower secondary education level (typically children around 11-14 years old), provide supplementary explainer material to help people who can't read it, or provide an alternative version that is written at lower secondary level. this doesn't mean that all subject matter should be understood by everyone, but that the style of writing should be accessible by everyone. it is better to just write all content at lower secondary level, even technical documentation like programming tuto...
-moz-user-input - CSS: Cascading Style Sheets
for implementations). a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was rejected by the working group. syntax values none the element does not respond to user input, and it does not become :active. enabled the element accepts user input. for textboxes, this is the default behavior. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). disabled the element does not accept user input. however, this is not the same as setting disabled to true, in that the element is drawn normally. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscret...
-webkit-line-clamp - CSS: Cascading Style Sheets
in most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines. when applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end. note: this property was originally implemented in webkit and has some issues. it got standardized for legacy support. the css overflow module level 3 specification also defines a line-clamp property, which is meant to replace this property and avoid its issues. syntax /* keyword value */ -webkit-line-clamp: none; /* <integer> values */ -webkit-line-clamp: 3; -webkit-line-clamp: 10; /* global values */ -webkit-line-clamp: inherit; -webkit-line-clamp: initial; -webkit-line-clamp: unset; none this va...
-webkit-text-security - CSS: Cascading Style Sheets
ut> or <textarea>) by replacing them with a shape. it only affects fields that are not of type=password. syntax -webkit-text-security: circle; -webkit-text-security: disc; -webkit-text-security: square; -webkit-text-security: none; formal definition value not found in db! formal syntax syntax not found in db! examples obscuring a text input try typing in the field below. if your browser supports this property, the characters should be visually replaced with squares. html <label for="name">name:</label> <input type="text" name="name" id="name" /> css input { -webkit-text-security: square; } result specifications not part of any standard. ...
:-moz-locale-dir(ltr) - CSS: Cascading Style Sheets
interface is being displayed left-to-right. this is determined by the preference intl.uidirection.locale (where locale is the current locale) being set to "ltr". note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's locale. (this can vary from window to window, and even from tab to tab.) it also allows extensions to work even when they don't support the user's default locale, since they can support both left-to-right and right-to-left layouts regardless of locale specifics. this selector does not work properly from html; it always matches, regardless of whether the ui locale is left-to-right or right-to-left. syntax :-moz-locale-dir(ltr) examples this example doesn't work if you're not using firefox, and may not work even in fire...
:-moz-locale-dir(rtl) - CSS: Cascading Style Sheets
interface is being displayed right-to-left. this is determined by the preference intl.uidirection.locale (where locale is the current locale) being set to "rtl". note: this selector is mainly used by extensions and themes to adapt the user interface based on the user's locale. (this can vary from window to window, and even from tab to tab.) it also allows extensions to work even when they don't support the user's default locale, since they can support both left-to-right and right-to-left layouts regardless of locale specifics. this selector does not work properly from html; it never matches, no matter whether the ui locale is left-to-right or right-to-left. syntax :-moz-locale-dir(rtl) examples this example will not work if you're not using firefox, and might not work properly even ...
:-moz-only-whitespace - CSS: Cascading Style Sheets
the :-moz-only-whitespace css pseudo-class matches elements that only contains text nodes that only contain whitespace. ...
::-moz-focus-inner - CSS: Cascading Style Sheets
the ::-moz-focus-inner css pseudo-element is a mozilla extension that represents an inner focus ring of the <button> element as well as the button, submit, reset, and color types of the <input> element. note: using ::-moz-focus-inner with anything than the buttons that support it doesn't match anything and has no effect. syntax syntax not found in db! examples html <input type="submit" value="input"/> <button type="submit">button</button> css button::-moz-focus-inner, input[type="color"]::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { padding-block-start: 0px; padding-inline-end: 2px; padding-block-end: 0px; padding-inline-start: 2px; border: 1px dotted red; } ...
::-webkit-file-upload-button - CSS: Cascading Style Sheets
syntax selector::-webkit-file-upload-button examples html <form> <label for="fileupload">upload file</label><br> <input type="file" id="fileupload"> </form> css input, label { display: block; } input[type=file]::-webkit-file-upload-button { border: 1px solid grey; background: #fffaaa; } below is the example for you to try. ...
::-webkit-search-cancel-button - CSS: Cascading Style Sheets
the ::-webkit-search-cancel-button css pseudo-element represents a button (the "cancel button") at the edge of an <input> of type="search" which clears away the current value of the <input> element. this button and pseudo-element are non-standard, supported only in webkit and blink, hence the vendor prefix. the clear button is only shown on non-empty search <input> elements. syntax selector::-webkit-search-cancel-button specifications not part of any standard. ...
::-webkit-search-results-button - CSS: Cascading Style Sheets
the search results button is only shown on search <input> elements that have a results attribute. syntax selector::-webkit-search-results-button specifications not part of any standard. ...
::after (:after) - CSS: Cascading Style Sheets
Web › CSS › ::after
r this text. </span> css .ribbon { background-color: #5bc8f7; } .ribbon::after { content: "this is a fancy orange box."; background-color: #ffba10; border-color: black; border-style: dotted; } result tooltips this example uses ::after, in conjunction with the attr() css expression and a data-descr custom data attribute, to create tooltips. no javascript is required! we can also support keyboard users with this technique, by adding a tabindex of 0 to make each span keyboard focusable, and using a css :focus selector. this shows how flexible ::before and ::after can be, though for the most accessible experience a semantic disclosure widget created in some other way (such as with details and summary elements) is likely to be more appropriate. html <p>here we have some <spa...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
first letter is included in the match. punctuation includes any unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. in these cases, both letters of the digraph should be matched by the ::first-letter pseudo-element. (this is poorly supported by browsers; see the browser compatibility table below.) a combination of the ::before pseudo-element and the content property may inject some text at the beginning of the element. in that case, ::first-letter will match the first letter of this generated content. css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers a...
::grammar-error - CSS: Cascading Style Sheets
as grammatically incorrect. allowable properties only a small subset of css properties can be used in a rule with ::grammar-error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::grammar-error examples simple document grammar check in this example, eventual supporting browsers should highlight any flagged grammatical errors with the styles shown. html <p>my friends is coming to the party tonight.</p> css ::grammar-error { text-decoration: underline red; color: red; } result specifications specification status comment css pseudo-elements level 4the definition of '::grammar-error' in that specification. working...
::marker - CSS: Cascading Style Sheets
Web › CSS › ::marker
s. ::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright, unicode-bidi and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status comment css pseudo-elements level 4the definition of '::marker' in that specification. working draft no significant change. css list...
::part() - CSS: Cascading Style Sheets
Web › CSS › ::part
working draft initial definition. ...
::spelling-error - CSS: Cascading Style Sheets
gged as incorrectly spelled. allowable properties only a small subset of css properties can be used in a rule with ::spelling-error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::spelling-error examples simple document spell check in this example, eventual supporting browsers should highlight any flagged spelling errors with the styles shown. html <p contenteditable spellcheck="true">my friends are coegdfgfddffbgning to the party tonight.</p> css ::spelling-error { text-decoration: wavy red; } result specifications specification status comment css pseudo-elements level 4the definition of '::spelling-error' in tha...
:blank - CSS: Cascading Style Sheets
Web › CSS › :blank
note: the :blank selector is considered at risk, as the csswg keeps changing it. see csswg issue #1967. the :blank css pseudo-class selects empty user input elements (eg. <input> or <textarea>). syntax :blank examples simple :blank example in eventual supporting browsers, the :blank pseudo-class will enable developers to highlight in some way input controls that are not required, but still have no content filled in, perhaps as a reminder to users. html <textarea></textarea> css textarea:blank { border: 3px solid red; } result specifications specification status comment selectors level 4the definition of ':blank' in that specification. working draft initial definition. ...
:empty - CSS: Cascading Style Sheets
Web › CSS › :empty
the :empty css pseudo-class represents any element that has no children. children can be either element nodes or text (including whitespace). comments, processing instructions, and css content do not affect whether an element is considered empty. note: in selectors level 4 the :empty pseudo-class was changed to act like :-moz-only-whitespace, but no browser currently supports this yet. /* selects any <div> that contains no content */ div:empty { background: lime; } syntax :empty examples html <div class="box"><!-- i will be lime. --></div> <div class="box">i will be pink.</div> <div class="box"> <!-- i will be pink in older browsers because of the whitespace around this comment. --> </div> <div class="box"> <p><!-- i will be pink in all browsers because of the non-collapsible wh...
negative - CSS: Cascading Style Sheets
provided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. formal definition related at-rule@counter-styleinitial value"-" hyphen-minuscomputed valueas specified formal syntax <symbol> <symbol>?where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>? [ <...
speak-as - CSS: Cascading Style Sheets
might read it out as if the value of speak-as was numbers. <counter-style-name> the name of another counter style, specified as a <custom-ident>. if included, the counter will be spoken out in the form specified in that counter style, kind of like specifying the fallback descriptor. if the specified style does not exist, speak-as defaults to auto. accessibility concerns assistive technology support is very limited for the speak-as property. do not rely on it to convey information critical to understanding the page's purpose. let's talk about speech css | css tricks formal definition related at-rule@counter-styleinitial valueautocomputed valueas specified formal syntax auto | bullets | numbers | words | spell-out | <counter-style-name>where <counter-style-name> = <custom-ident> ex...
@document - CSS: Cascading Style Sheets
Web › CSS › @document
d to the regexp() function must be enclosed in quotes. escaped values provided to the regexp() function must additionally be escaped from the css. for example, a . (period) matches any character in regular expressions. to match a literal period, you would first need to escape it using regular expression rules (to \.), then escape that string using css rules (to \\.). @document is currently only supported in firefox; if you wanted to replicate using such functionality in your own non-firefox browser, you could try using this polyfill by @an-error94, which uses a combination of a user script, data-* attributes, and attribute selectors. note: there is a -moz-prefixed version of this property — @-moz-document. this has been limited to use only in user and ua sheets in firefox 59 in nightly ...
font-stretch - CSS: Cascading Style Sheets
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% variable fonts most fonts have a particular width which corresponds to one of the keyterm values. however some fonts, called variable fonts, can support a range of stretching with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for this, percentage ranges are useful. for truetype or opentype variable fonts, the "wdth" variation is used to implement varying glyph widths. accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading...
font-style - CSS: Cascading Style Sheets
mal font. oblique specifies that the font-face is an artificially sloped version of the normal font. oblique with angle selects a font classified as oblique, and additionally specifies an angle for the slant of the text. oblique with angle range selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed. formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | italic | oblique <angle>{0,2} examples specifying an italic font style as an example, consider the garamond font family, in its normal form, we get the following result: @font-fa...
font-weight - CSS: Cascading Style Sheets
extra light (ultra light) 300 light 400 normal 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (heavy) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping. however some fonts, called variable fonts, can support a range of weights with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. for truetype or opentype variable fonts, the "wght" variation is used to implement varying weights. accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) ...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
, url(path/to/font.otf) format("opentype"); values <url> [ format( <string># ) ]? specifies an external reference consisting of a <url>, followed by an optional hint using the format() function to describe the format of the font resource referenced by that url. the format hint contains a comma-separated list of format strings that denote well-known font formats. if a user agent doesn't support the specified formats, it skips downloading the font resource. if no format hints are supplied, the font resource is always downloaded. <font-face-name> specifies the name of a locally-installed font face using the local() function, which uniquely identifies a single font face within a larger family. the name can optionally be enclosed in quotes. description the value of this descriptor ...
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
t-min-device-pixel-ratio and -webkit-max-device-pixel-ratio. syntax <number> the number of device pixels per css pixel. media: media/visual accepts min/max prefixes: yes examples basic compatibility example -moz-device-pixel-ratio may be used for compatibility with firefox older than 16, and alongside -webkit-device-pixel-ratio for compatibility with webkit-based browsers that do not support dppx. example: @media (-webkit-min-device-pixel-ratio: 2), /* webkit-based browsers */ (min--moz-device-pixel-ratio: 2), /* older firefox browsers (prior to firefox 16) */ (min-resolution: 2dppx), /* the standard way */ (min-resolution: 192dpi) /* dppx fallback */ note: see this csswg article for compatibility good practices regarding resol...
-webkit-animation - CSS: Cascading Style Sheets
the -webkit-animation boolean css media feature is a chrome extension whose value is true if vendor-prefixed css animations are supported. apple has a description in safari css reference. note: this media feature is only supported by webkit. if possible, use an @supports feature query instead. syntax the -webkit-animation media feature is a boolean whose value is true if the vendor-prefixed css animation properties are supported. values true the browser supports -webkit prefixed css animations. false the browser doesn't support these prefixed css animations. examples @media (-webkit-animation) { /* css to use if animations are supported */ } specifications not part of any standard. ...
-webkit-transform-3d - CSS: Cascading Style Sheets
the -webkit-transform-3d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 3d transforms are supported. note: this media feature is only supported by webkit and blink. if possible, use an @supports feature query instead. syntax -webkit-transform-3d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 3d transforms. values true the browser supports the 3d css transforms with the -webkit prefix. false the 3d css transforms prefixed with -webkit are not supported by the browser. examples @media (-webkit-transform-3d) { .foo { transform-style: preserve-3d; } } @media (-webkit-transform-3d: 1) { .foo { transform-style: preserve-3d; } } specifications specificati...
color-gamut - CSS: Cascading Style Sheets
the color-gamut css media feature can be used to test the approximate range of colors that are supported by the user agent and the output device. syntax the color-gamut feature is specified as a keyword value chosen from the list below. srgb the output device can support approximately the srgb gamut or more. this includes the vast majority of color displays. p3 the output device can support approximately the gamut specified by the dci p3 color space or more. the p3 gamut is larger than and includes the srgb gamut. rec2020 the output device can support approximately the gamut specified by the itu-r recommendation bt.2020 color space or more. the rec2020 gamut is larger than and includes the p3 gamut. examples html <p>this is a test.</p> css @media (color-gamut: srgb) { p { ...
inverted-colors - CSS: Cascading Style Sheets
olors feature is specified as a keyword value chosen from the list below. none colors are displayed normally. inverted all pixels within the displayed area have been inverted. examples html <p>if you're using inverted colors, this text should be blue on white (the inverse of yellow on black). ...
prefers-contrast - CSS: Cascading Style Sheets
at the user has made no preference known to the system. this keyword value evaluates as false in a boolean context. more indicates that user has notified the system that they prefer an interface that has a higher level of contrast. less indicates that user has notified the system that they prefer an interface that has a lower level of contrast. user preferences various operating systems do support such preferences and user agents are likely to rely on the settings provided by the operating system. examples this example has an annoying low contrast by default. html <div class="contrast">low contrast box</div> css .contrast { width: 100px; height: 100px; outline: 2px dashed black; } @media (prefers-contrast: high) { .contrast { outline: 2px solid black; } } result...
prefers-reduced-data - CSS: Cascading Style Sheets
note: this feature is not supported by any user agent and its specifics are subject to change. the prefers-reduced-data css media feature is used to detect if the user has requested the web content that consumes less internet traffic. syntax no-preference indicates that the user has made no preference known to the system. this keyword value evaluates as false in the boolean context. reduce indicates that user has expressed the preference for lightweight alternate content. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system. examples note: no browser currently implements...
prefers-reduced-transparency - CSS: Cascading Style Sheets
ference indicates that the user has made no preference known to the system. this keyword value evaluates as false in the boolean context. reduce indicates that user has notified the system that they prefer an interface that minimizes the amount of transparent or translucent layer effects. user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating systems. examples note: no browser currently implements this feature so the following example will not work. this example has an annoying transparency effect by default. html <div class="transparency">transparent box</div> css .transparency { opacity:...
scripting - CSS: Cascading Style Sheets
Web › CSS › @media › scripting
the scripting css media feature can be used to test whether scripting (such as javascript) is available. syntax the scripting feature is specified as a keyword value chosen from the list below. none scripting is completely unavailable on the current document. initial-only scripting is enabled during the initial page load, but not afterwards. enabled scripting is supported and active on the current document. examples html <p class="script-none">you do not have scripting available. :-(</p> <p class="script-initial-only">your scripting is only enabled during the initial page load. weird.</p> <p class="script-enabled">you have scripting enabled! :-)</p> css p { color: lightgray; } @media (scripting: none) { .script-none { color: red; } } @media (scripting: initial-o...
Using CSS animations - CSS: Cascading Style Sheets
width: 100%; } } in this example the style for the <p> element specifies that the animation should take 3 seconds to execute from start to finish, using the animation-duration property, and that the name of the @keyframes at-rule defining the keyframes for the animation sequence is named “slidein”. if we wanted any custom styling on the <p> element to appear in browsers that don’t support css animations, we would include it here as well; however, in this case we don’t want any custom styling other than the animation effect. the keyframes are defined using the @keyframes at-rule. in this case, we have just two keyframes. the first occurs at 0% (using the alias from). here, we configure the left margin of the element to be at 100% (that is, at the far right edge of the contai...
Box-shadow generator - CSS: Cascading Style Sheets
type.setwidth = function setwidth(value) { this.width = value; this.node.style.width = this.width + 'px'; outputmanager.updateproperty(this.id, 'width', this.width + 'px'); } cssclass.prototype.setheight = function setheight(value) { this.height = value; this.node.style.height = this.height + 'px'; outputmanager.updateproperty(this.id, 'height', this.height + 'px'); } // browser support cssclass.prototype.setrotate = function setrotate(value) { var cssvalue = 'rotate(' + value +'deg)'; this.node.style.transform = cssvalue; this.node.style.webkittransform = cssvalue; this.node.style.mstransform = cssvalue; if (value !== 0) { if (this.rotate === 0) { outputmanager.toggleproperty(this.id, 'transform', true); outputmanager.toggleproperty(this.id, '-webkit...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
n features of box alignment across layout methods. in multi-column layout the alignment container is the content box of the multicol container. the alignment subject is the column box. the properties which apply to multi-column layouts are detailed below. note: multi-column layout predates the box alignment specification. and the properties listed here, while specified for multicol, may not be supported in browsers. align-content and justify-content the align-content property applies to the block axis and justify-content to the inline axis. any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be specified by the column-gap property. using a value of justify-content other than normal or...
CSS Box Alignment - CSS: Cascading Style Sheets
ap, which allows us to set these properties at once: row-gap column-gap gap in the below example, a grid layout uses the gap shorthand to set a 10px gap between row tracks, and a 2em gap between column tracks. in this example i am using the grid-gap property in addition to gap. the gap properties were originally prefixed with grid- in the grid layout specification and some browsers only support these prefixed versions. grid-row-gap grid-column-gap grid-gap the prefixed versions will be maintained as an alias of the unprefixed ones, however you can always double up in the way that you would with vendor prefixes, adding the grid-gap property and then the gap property with the same values. also, be aware that other things may increase the visual gap displayed, for example using...
Color picker tool - CSS: Cascading Style Sheets
})(); var init = function init() { uicolorpicker.init(); inputslidermanager.init(); colorinfo.init(); colorpalette.init(); colorpickersamples.init(); canvassamples.init(); tool.init(); }; return { init : init }; })(); this tool makes it easy to create, adjust, and experiment with custom colors for the web. it also makes it easy to convert between various color formats supported by css, including: hexa colors, rgb (red/green/blue) and hsl (hue/saturation/lightness). control over the alpha channel is also supported on rgb (rgba) and hsl (hsla) formats. as you adjust the parameters that define the color, it gets displayed in all three standard web css formats. in addition, based on the currently-selected color, a palette for hsl and hsv, as well as alpha, is generat...
Handling content breaks in multicol - CSS: Cascading Style Sheets
hings don’t work as expected if you have small amounts of content and are trying to control breaks in a number of ways or on several elements, your content needs to break somewhere, so you may not always get the result you intended. to some extent your use of fragmentation is always a suggestion to the browser, to control breaks in this way if it is possible. in addition to the above, browser support for these properties is a little patchy. the compatibility data charts on the individual property pages here on mdn can help you see which browsers support which features. in most cases, the fallback to breaks not being controlled is something you can live with, with suboptimal breaking being untidy rather than a disaster to your layout. ...
CSS Multi-column Layout - CSS: Cascading Style Sheets
basic example in the following example the column-count property has been applied to the element with a class of container. as the value of column-count is 3, the content is arranged into 3 columns of equal size. relationship to fragmentation multiple-column layout is closely related to paged media, in that each column box becomes a fragment, much like a printed page becomes a fragment of an overall document. ...
CSS Conditional Rules - CSS: Cascading Style Sheets
css conditional rules is a css module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to. reference at-rules @document @media @supports @import specifications specification status comment css conditional rules module level 3 candidate recommendation initial definition ...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
the main axis explaining the flex-grow, flex-shrink and flex-basis properties. mastering wrapping of flex items how to create flex containers with multiple lines and control the display of the items in those lines. typical use cases of flexbox common design patterns that are typical flexbox use cases. backwards compatibility of flexbox browser status of flexbox, interoperability issues and supporting older browsers and versions of the spec specifications specification status comment css flexible box layout module candidate recommendation initial definition. ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
peat(3, 1fr); column-gap: 10px; row-gap: 1em; } note: when grid first shipped in browsers the column-gap, row-gap and gap were prefixed with the grid- prefix as grid-column-gap, grid-row-gap and grid-gap respectively. browsers are updating to remove this prefix, however the prefixed versions will be maintained as aliases making them safe to use. at the present time, some browsers do not support the unprefixed versions which is why the live examples in this guide use grid- prefixed versions. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> * {box-sizing: border-box;} .wrapper { grid-column-gap: 10px; grid-row-gap: 1em; border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wra...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
i-column layout. note: when grid first shipped in browsers the column-gap, row-gap and gap properties were prefixed with the grid- prefix as grid-column-gap, grid-row-gap and grid-gap respectively. browsers are updating their rendering engines to remove this prefix, however the prefixed versions will be maintained as aliases, making them safe to use. at the present time, some browsers do not support the unprefixed versions, which is why the live examples in this guide use grid- prefixed versions. gaps only appear between tracks of the grid, they do not add space to the top and bottom, left or right of the container. we can add gaps to our earlier example by using these properties on the grid container. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-...
Implementing image sprites in CSS - CSS: Cascading Style Sheets
. rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http requests is reduced. note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small requests. implementation suppose an image is given to every item with class toolbtn: .toolbtn { background: url(myfile.png); display: inline-block; height: 20px; width: 20px; } a background position can be added either as two x, y values after the url()() in the background, or as background-position. for example: #btn1 { background-position: -20px 0px; } #btn2 { background-position: -40px 0px; } this would m...
Logical properties for sizing - CSS: Cascading Style Sheets
property also has logical keyword values. using resize: inline allows resizing in the inline dimension and resize: block allow resizing in the block dimension. the keyword value of both for the resize property works whether you are thinking physically or logically. it sets both dimensions at once. try playing with the below example. note that currently the logical values for resize are only supported by firefox. ...
CSS Text Decoration - CSS: Cascading Style Sheets
going through it.</p> <p>this <a class="plain" href="#">link will not be underlined</a>, as links generally are by default. ...
Using CSS transitions - CSS: Cascading Style Sheets
as: div { transition-property: opacity, left; transition-duration: 3s, 5s; } using transitions when highlighting menus a common use of css is to highlight items in a menu as the user hovers the mouse cursor over them. it's easy to use transitions to make the effect even more attractive. before we look at code snippets, you might want to take a look at the live demo (assuming your browser supports transitions). first, we set up the menu using html: <nav> <a href="#">home</a> <a href="#">about</a> <a href="#">contact us</a> <a href="#">links</a> </nav> then we build the css to implement the look and feel of our menu. the relevant portions are shown here: a { color: #fff; background-color: #333; transition: all 1s ease-out; } a:hover, a:focus { color: #333; backgr...
CSS values and units - CSS: Cascading Style Sheets
he value specified as the property’s initial value. the inherit keyword represents the computed value of the property on the element’s parent, provided it is inherited. the unset keyword acts as either inherit or initial, depending on whether the property is inherited or not. a fourth value of revert was added in the cascade level 4 specification, but it does not currently have good browser support. urls a <url> type uses functional notation, which accepts a <string> that is a url. this may be an absolute url or a relative url. for example, if you wanted to include a background image, you might use either of the following. .box { background-image: url("images/my-background.png"); } .box { background-image: url("https://www.exammple.com/images/my-background.png"); } the paramet...
Center an element - CSS: Cascading Style Sheets
de another we make the containing box a flex container. then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are specified to apply to block layout too. however, support is currently limited for box alignment properties on block layout, so currently centering using flexbox is the most robust way to achieve this. ...
Column layouts - CSS: Cascading Style Sheets
or styling. a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. this is a different behavior to what you saw with multicol. there is currently no way to add a rule between flex items, and browser support for the column-gap and row-gap properties is limited. therefore to create gaps between items use a margin. download this example flexbox can also be used to create layouts where the flex items wrap onto new rows, by setting the flex-wrap property on the container to wrap. these new flex lines will distribute space along that line only — the items in the new line will not line up with ...
Cookbook template - CSS: Cascading Style Sheets
n creating the pattern. why did you choose a certain method? if you want to add an additional example here — for example a version with fallbacks, please do. this section is deliberately loose as patterns range from the very simple to more complex. useful fallbacks or alternative methods if there are useful alternative methods for building the recipe, or fallback recipes to use if you have to support non-supporting browsers, include them in separate sections down here. accessibility concerns include this is there are any specific things to watch out for in regard to accessibility. if not relevant for your pattern this can be omitted. ...
Recipe: Media objects - CSS: Cascading Style Sheets
image to the other side — this is done by adding the media-flip class, which defines a flipped grid template causing the layout to be mirrored. when we nest one media object inside another we need to place it into the second track in the regular layout, and the first track when flipped. fallbacks there are a number of possible fallbacks for this pattern, depending on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is remove any margins applied to the item, and any widths which we don’t need in a ...
Sticky footers - CSS: Cascading Style Sheets
with three rows, one row for each part of our layout. grid auto-placement will place our items in source order and so the header goes into the first auto sized track, the main content into the 1fr track and the footer into the final auto sized track. the 1fr track will take up all available space and so grows to fill the gap. alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer. the flexbox example starts out in the same way, but we use display:flex rather than display:grid on the .wrapper; we also set flex-direction to column. then we set our main content to flex-grow: 1 and the other two elements to flex-shrink: 0 — this prevents them from shrinking smaller when content fills the main area. ...
Microsoft CSS extensions - CSS: Cascading Style Sheets
these extensions are prefixed with -ms-. microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards track. ...
Paged media - CSS: Cascading Style Sheets
paged media properties control the presentation of content for print or any other media that splits content into discrete pages. ...
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
l-padding-inline-startscroll-padding-leftscroll-padding-rightscroll-padding-topscroll-snap-alignscroll-snap-stopscroll-snap-typescrollbar-colorscrollbar-width::selectionselector()sepia()<shape>shape-image-thresholdshape-marginshape-outsidesize (@page)skew()skewx()skewy()::slottedspeak-as (@counter-style)src (@font-face)steps()<string>@stylesetstyleset()@stylisticstylistic()suffix (@counter-style)@supports@swashswash()symbols (@counter-style)symbols()system (@counter-style)ttab-sizetable-layout:targettarget-counter()target-counters()target-text()text-aligntext-align-lasttext-combine-uprighttext-decorationtext-decoration-colortext-decoration-linetext-decoration-skip-inktext-decoration-styletext-decoration-thicknesstext-emphasistext-emphasis-colortext-emphasis-positiontext-emphasis-styletext-ind...
Replaced elements - CSS: Cascading Style Sheets
ot affected by the current document's styles. the position of the replaced element can be affected using css, but not the contents of the replaced element itself. some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document. the only other impact css can have on a replaced element is that there are properties which support controlling the positioning of the element's content within its box. see controlling object position within the content box for further information. replaced elements typical replaced elements are: <iframe> <video> <embed> <img> some elements are treated as replaced elements only in specific cases: <option> <audio> <canvas> <object> <applet> html spec also says that an <inp...
Shorthand properties - CSS: Cascading Style Sheets
of its parent element. effectively, this "turns on inheritance". initial sets the property value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like initial. note: there is also a newer value, revert, which has limited browser support. note: see origin of css declarations in introducing the css cascade for more information on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: ...
Specificity - CSS: Cascading Style Sheets
er"> <p>this is in the outer div.</p> <div class="inner"> <p>this text is in the inner div.</p> </div> </div> ... appears on the screen like this: the :where() exception the specificity-adjustment pseudo-class :where() always has its specificity replaced with zero. this chunk of css ... div:where(.outer) p { color: orange; } div p { color: blueviolet; } #no-where-support { margin: 0.5em; border: 1px solid red; } #no-where-support:where(*) { display: none !important; } ... when used with the following html ... <div id="no-where-support"> āš ļø your browser doesn't support the <code><a href="/docs/web/css/:where" target="_top">:where()</a></code> pseudo-class. </div> <div class="outer"> <p>this is in the outer div.</p> <div class="inner"> ...
Syntax - CSS: Cascading Style Sheets
Web › CSS › Syntax
...
CSS Tutorials - CSS: Cascading Style Sheets
Web › CSS › Tutorials
allows you to resize images used as an element's background. this tutorial describes how to achieve this in a simple way. media queries the size of the screens, or the kind of devices like touchscreens or printed sheets vary greatly nowadays. media queries are the fundamental building blocks in achieving web sites that render everywhere in their best quality. understanding z-index controlling superposition of boxes is a basic feature that is very quickly needed by web developers. though not that difficult, it requires a basic knowledge of css. intermediate-level css tutorials after the release of css 2 (level 1), new features have been added to css. some of them are fancy and are pretty self contained. they are easy to use for anybody with a fair knowledge of basic concepts. css cou...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
rule. the property is only set for the matching selector and its descendants, like any normal css. custom property fallback values using the var() function, you can define multiple fallback values when the given variable is not yet defined; this can be useful when working with custom elements and shadow dom. fallback values aren't used to fix the browser compatibility. if the browser doesn't support css custom properties, the fallback value won't help. it's just a backup for the browser which supports css custom properties to choose a different value if the given variable isn't defined or has an invalid value. the first argument to the function is the name of the custom property to be substituted. the second argument to the function, if provided, is a fallback value, which is used as t...
background-repeat - CSS: Cascading Style Sheets
.png); background-repeat: repeat-x, repeat-y; height: 144px; } result in this example, each list item is matched with a different value of background-repeat. specifications specification status comment css backgrounds and borders module level 3the definition of 'background-repeat' in that specification. candidate recommendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and vertical directions, the space and round keywords, and for backgrounds on inline-level elements by precisely defining the background painting area. css level 2 (revision 1)the definition of 'background-repeat' in that specification. recommendation no significant cha...
background - CSS: Cascading Style Sheets
arning { background: pink; } .topbanner { background: url("https://mdn.mozillademos.org/files/11983/starsolid.gif") #99f repeat-y fixed; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background' in that specification. candidate recommendation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. css level 2 (revision 1)the definition of 'background' in that specification. recommendation no significant changes css level 1the definition of 'background' in that specification. recommendation initial definition ...
box-flex-group - CSS: Cascading Style Sheets
instead, distribution of space inside the flex container is now handled using flex-basis, flex-grow, and flex-shrink. specifications not part of any standard. ...
box-lines - CSS: Cascading Style Sheets
Web › CSS › box-lines
box elements layout in multiple rows or columns. formal definition initial valuesingleapplies tobox elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax single | multiple examples simple usage example in the original version of the spec, box-lines allowed you to specify that you wanted your flex container's children to wrap onto multiple lines. this was only supported in webkit-based browsers, with a prefix. div { display: box; box-orient: horizontal; box-lines: multiple; } the modern flexbox equivalent is flex-wrap. specifications not part of any standard. ...
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
amples and send us a pull request. initially a part of multi-column layout, the definition of column-gap has been broadened to include multiple layout methods. now specified in box alignment, it may be used in multi-column, flexible box, and grid layouts. css grid layout initially defined the grid-column-gap property. this prefixed property is being replaced by column-gap. however, in order to support browsers that implemented grid-column-gap and not column-gap for grid, you will need to use the prefixed property. syntax /* keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* <percentage> value */ column-gap: 3%; /* global values */ column-gap: inherit; column-gap: initial; column-gap: unset; the column-gap property is specified as one o...
conic-gradient() - CSS: Cascading Style Sheets
le, the center of the gradient, and then specifying a list of color-stops. unlike linear and radial gradients, whose color-stops are placed by specifying a length, the color-stops of a conic gradient are specified with an angle. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting conic gradients also accept percent values, with 100% equaling 360 degrees, but this is not in the specification. similar to radial gradients, the conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is the circumference...
contain - CSS: Cascading Style Sheets
Web › CSS › contain
ement can be sized without the need to examine its descendants' sizes. layout indicates that nothing outside the element may affect its internal layout and vice versa. style indicates that, for properties that can have effects on more than just an element and its descendants, those effects don't escape the containing element. note that this value is marked "at-risk" in the spec and may not be supported everywhere. paint indicates that descendants of the element don't display outside its bounds. if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. and if a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing elemen...
counter() - CSS: Cascading Style Sheets
Web › CSS › counter
the counter() css function returns a string representing the current value of the named counter, if there is one. it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. /* simple usage */ counter(countername); /* changing the counter display */ counter(countername, upper-roman) a counter has no visible effect by itself. the counter() function (and counters() function) is what makes it useful by returning developer defined strings (or images). note: the counter() function can be used with any css property, but support for properties other than content is experimental, and support for the type-or-unit parameter is sparse. check the browser compatibility table carefully before using this in production. syntax values <custom...
cross-fade() - CSS: Cascading Style Sheets
image>, <percentage> ) the specification for the cross-fade() function allows for multiple images and for each image to have transparency values independent of the other values. this was not always the case. the original syntax, which has been implemented in some browsers, only allowed for two images, with the sum of the transparency of those two images being exactly 100%. the original syntax is supported in safari and supported with the -webkit- prefix in chrome, opera, and other blink-based browsers. cross-fade(url(white.png), url(black.png), 0%); /* fully black */ cross-fade(url(white.png), url(black.png), 25%); /* 25% white, 75% black */ cross-fade(url(white.png), url(black.png), 50%); /* 50% white, 50% black */ cross-fade(url(white.png), url(black.png), 75%); /* 75% white, 25% bla...
<display-inside> - CSS: Cascading Style Sheets
ex the element behaves like a block element and lays out its content according to the flexbox model. grid the element behaves like a block element and lays out its content according to the grid model. ruby the element behaves like an inline element and lays out its content according to the ruby formatting model. it behaves like the corresponding html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. examples in this example the parent box has been given d...
<display-listitem> - CSS: Cascading Style Sheets
mple a bullet point) together with a principal box of the specified type for its own contents. syntax a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-style-position: inside; } result specifications specification status ...
<display-outside> - CSS: Cascading Style Sheets
becomes the first inline box of the block box that follows it. run-in elements act like inlines or blocks, depending on the surrounding elements. that is: if the run-in box contains a block box, same as block. if a block box follows the run-in box, the run-in box becomes the first inline box of the block box. if an inline box follows, the run-in box becomes a block box. note: browsers that support the two value syntax, on finding the outer value only, such as when display: block or display: inline is specified, will set the inner value to flow. this will result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. examples in the following example, span ele...
<easing-function> - CSS: Cascading Style Sheets
or component greater than 255 or smaller than 0 will be clipped to the closest allowed value (255 and 0, respectively). some cubic-bezier() curves exhibit this property. syntax there are three types of easing function: linear, cubic bézier curves, and staircase functions. the value of an <easing-function> type describes the easing function using one of those three types. easing functions css supports three kinds of easing functions: linear, the subset of the cubic bézier curves that are functions, and staircase functions. the most useful of these functions are given a keyword that allows them to be easily referenced. the linear class of easing functions linear the animation moves from beginning to end at a constant rate. this keyword represents the easing function cubic-bezier(0.0,...
<filter-function> - CSS: Cascading Style Sheets
htness() makes the image brighter or darker. contrast() increases or decreases the image's contrast. drop-shadow() applies a drop shadow behind the image. grayscale() converts the image to grayscale. hue-rotate()​​​​​​​​​​​​​​ changes the overall hue of the image. invert() inverts the colors of the image. opacity() makes the image transparent. saturate() super-saturates or desaturates the input image. sepia() converts the image to sepia. examples filter function comparison this example provides a simple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function. updating the controls updates the filter effect in real time, ...
filter - CSS: Cascading Style Sheets
Web › CSS › filter
eft; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } saturate() the saturate() function saturates the input image. the value of amount defines the proportion of the conversion. a value of 0% is completely un-saturated. a value of 100% leaves the input unchanged. other values are linear multipliers on the effect. values of amount over 100% are allowed, providing super-saturated results. the lacuna value for interpolation is 1. filter: saturate(200%) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static exam...
flex-basis - CSS: Cascading Style Sheets
ent or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in the initial release of flexible box layout, and thus some older implementations will not support it. the equivalent effect can be had by using auto together with a main size (width or height) of auto. history: originally, flex-basis:auto meant "look at my width or height property". then, flex-basis:auto was changed to mean automatic sizing, and "main-size" was introduced as the "look at my width or height property" keyword. it was implemented in bug 1032922. then, that chang...
float - CSS: Cascading Style Sheets
Web › CSS › float
this was an exception to the rule, that the name of the dom member is the camel-case name of the dash-separated css name (due to the fact that "float" is a reserved word in javascript, as seen in the need to escape "class" as "classname" and escape <label>'s "for" as "h...
font-family - CSS: Cascading Style Sheets
ui-serif text. ui-sans-serif the default user interface sans-serif font. this is example ui-sans-serif text. ui-monospace the default user interface monospace font. this is example ui-monospace text. ui-rounded the default user interface font that has rounded features. this is example ui-rounded text. math this is for the particular stylistic concerns of representing mathematics: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. this is some example math text: ax² + bx + c = 0. emoji fonts that are specifically designed to render emoji. this is some example emoji text: āœā™¾. fangsong a particular style of chinese characters that are between serif-style song and cursive-style kai forms...
font-language-override - CSS: Cascading Style Sheets
ish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface behavior for a specific language. this is useful, for example, when the typeface you're using lacks proper support for the language. for instance, if a typeface doesn't have proper rules for the azeri language, you can force the font to use turkish glyphs, which follow similar rules. syntax the font-language-override property is specified as the keyword normal or a <string>. values normal tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. thi...
font-optical-sizing - CSS: Cascading Style Sheets
es toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized. this is the default across browsers.</p> <p class="no-optical-sizing">this paragraph is not optically sized. you should see a difference in supporting browsers.</p> @font-face { src: url('amstelvaralpha-vf.ttf'); font-family:'amstelvar'; font-style: normal; } p { font-size: 36px; font-family: amstelvar; } .no-optical-sizing { font-optical-sizing: none; } note: the font referenced above — which includes optical sizing and is freely-licensed — is good for testing. you can download it on github. specifications ...
font-size - CSS: Cascading Style Sheets
Web › CSS › font-size
h is often 16px. so, by default 1em = 16px, and 2em = 32px. if you set a font-size of 20px on the body element, then 1em = 20px and 2em = 40px. note that the value 2 is essentially a multiplier of the current em size. in order to calculate the em equivalent for any pixel value required, you can use this formula: em = desired element pixel value / parent element font-size in pixels for example, suppose the font-size of the body of the page is set to 16px. if the font-size you want is 12px, then you should specify 0.75em (because 12/16 = 0.75). similarly, if you want a font size of 10px, then specify 0.625em (10/16 = 0.625); for 22px, specify 1.375em (22/16). the em is a very useful unit in css, since it automatically adapts its length relative to the font that the reader chooses to use. e...
font-style - CSS: Cascading Style Sheets
egree to which an oblique face is slanted. you can select this using the <angle> modifier for the oblique keyword. for truetype or opentype variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. see font-variation-settings. for the example below to work, you'll need a browser that supports the css fonts level 4 syntax in which font-style: oblique can accept an <angle>. html <header> <input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p...
font-variant-east-asian - CSS: Cascading Style Sheets
html <table> <thead></thead> <tbody style="border:0;"> <tr> <th>normal/jis78:</th> <td>麹町</td> <td class="jis78">麹町</td> </tr> <tr> <th>normal/ruby:</th> <td>恗悓恋悓恛悓</td> <td class="ruby">恗悓恋悓恛悓</td> </tr> <tr> <th>normal/traditional:</th> <td>大学</td> <td class="traditional">大学</td> </t...
font-variation-settings - CSS: Cascading Style Sheets
custom axes should be given upper-case tags. note that font designers aren't forced follow this practice in any way, and some won't. the important takeaway here is that axis tags are case-sensitive. in order to use variable fonts on your operating system, you need to make sure that it is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. if your operating system is not up to date, you will not be able to use variable fonts in web pages or the firefox developer tools. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea transform formal syntax normal | [ <string> <number> ]# examples you can fi...
gap (grid-gap) - CSS: Cascading Style Sheets
Web › CSS › gap
is a shorthand for row-gap and column-gap. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. css grid layout initially defined the grid-gap property. this prefixed property is being replaced by gap. however, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* one <length> value */ gap: 20px; gap: 1em; gap: 3vmin; gap: 0.5cm; /* one <percentage> value */ gap: 16%; gap: 100%; /* two <length> values */ gap: 20px 10px; gap: 1em 0.5em; gap: 3vmin 2vmax; gap: 0.5cm 2mm; /* one or two <percentage> values...
<gradient> - CSS: Cascading Style Sheets
Web › CSS › gradient
t">repeating radial gradient</div> div { width: 240px; height: 80px; } .linear-repeat { background: repeating-linear-gradient(to top left, lightpink, lightpink 5px, white 5px, white 10px); } .radial-repeat { background: repeating-radial-gradient(powderblue, powderblue 8px, white 8px, white 16px); } conic gradient example a simple conic gradient example. note that this isn't supported widely across browser as of yet. <div class="conic-gradient">conic gradient</div> div { width: 200px; height: 200px; } .conic-gradient { background: conic-gradient(lightpink, white, powderblue); } specifications specification status comment css images module level 4the definition of '<gradient>' in that specification. working draft adds con...
grid-column - CSS: Cascading Style Sheets
iven as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. formal definition initial valueas each of the properties of the shorthand:grid-column-start: autogrid-column-end: autoapplies togrid items and absolutely-posi...
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
iven as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. formal definition initial valueas each of the properties of the shorthand:grid-row-start: autogrid-row-end: autoapplies togrid items and absolutely-positioned...
height - CSS: Cascading Style Sheets
Web › CSS › height
comment css box sizing module level 4the definition of 'height' in that specification. editor's draft css box sizing module level 3the definition of 'height' in that specification. working draft added the max-content, min-content, fit-content keywords. css level 2 (revision 1)the definition of 'height' in that specification. recommendation adds support for the <length> values and precises on which element it applies to. css level 1the definition of 'height' in that specification. recommendation initial definition. ...
Initial value - CSS: Cascading Style Sheets
the initial value of a css property is its default value, as listed in its definition table in the specification. the usage of the initial value depends on whether a property is inherited or not: for inherited properties, the initial value is used on the root element only, as long as no specified value is supplied. for non-inherited properties, the initial value is used on all elements, as long as no specified value is supplied. you can explicitly specify the initial value by using the initial keyword. note: the initial value should not be confused with the value specified by the browser's style sheet. specifications specification status comment css cascade 4 formal definition. css level 2 (revision 1)the definition of 'initial value' in...
justify-content - CSS: Cascading Style Sheets
tch if the combined size of the items along the main axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis. note: stretch is not supported by flexible boxes (flexbox). safe used alongside an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which...
list-style-image - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'list-style-image' in that specification. recommendation initial definition ...
margin-trim - CSS: Cascading Style Sheets
h such a margin. all trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge. formal definition initial valuenoneapplies toblock containers and multi-column containers. ...
margin - CSS: Cascading Style Sheets
Web › CSS › margin
tom: 2em margin */ /* box is horizontally centered */ margin: auto; /* top and bottom: 0 margin */ /* box is horizontally centered */ notes horizontal centering to center something horizontally in modern browsers, you can use display: flex; justify-content: center; . however, in older browsers like ie8-9 that do not support flexible box layout, these are not available. in order to center an element inside its parent, use margin: 0 auto;. margin collapsing elements' top and bottom margins are sometimes collapsed into a single margin that is equal to the larger of the two margins. see mastering margin collapsing for more information. specifications specification status comment css b...
mask-border-mode - CSS: Cascading Style Sheets
values. alpha the alpha values of the mask border image are used as the mask values. formal definition initial valuealphaapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples basic usage this property doesn't yet seem to have support anywhere. when browsers support it, it will specify the type of blending mode used for the mask border — luminance or alpha: mask-border-mode: luminance; mask-border-mode: alpha; specifications specification status comment css masking module level 1the definition of 'mask-border-mode' in that specification. candidate recommendation initial definition ...
mask-repeat - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition...
mask-size - CSS: Cascading Style Sheets
Web › CSS › mask-size
t is applied to the element after the mask-size css property, the value of this property is then reset to its initial value by the shorthand property. syntax one or more <bg-size> values, separated by commas. a <bg-size> can be specified in one of three ways: using the keyword contain using the keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto. if two values are given, the first sets width and the second sets height. each value can be a <length>, a <percentage>, or auto. values <length> a <length> value scales the mask image to the specified length in the corresponding dimension. negative lengths are not allowed. <percentage> a ...
outline - CSS: Cascading Style Sheets
Web › CSS › outline
efault focus style. if an element can be interacted with it must have a visible focus indicator. provide obvious focus styling if the default focus style is removed. how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal definition initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, currentcolor for the otheroutline-style: noneoutline-width: mediumapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:outline-color: for the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. the...
overflow-anchor - CSS: Cascading Style Sheets
therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off. ...
<position> - CSS: Cascading Style Sheets
p right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status comment css values and units module level 3the definition of '<position>' in that specification. candidate recommendation relists links to both definitions: if css backgrounds and borders module level 3 is supported, its definition of <position> must also be used. css backgrounds and borders module level 3the definition of '<bg-position>' in that specification. candidate recommendation defines <position> explicitly and extends it to support offsets from any edge. css level 2 (revision 1)the definition of '<position>' in that specification. recommendation allows combination...
repeating-conic-gradient() - CSS: Cascading Style Sheets
is specified by indicating a rotation angle, the center of the gradient, and then specifying a list of color-stops. like non-repeating conic gradients, the color-stops of a repeating conic gradient are specified with an <angle>. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting repeating conic gradients also accept percent values, with 100% equaling 360 degrees, but this is not in the specification. radial and conic gradient syntax provides for positioning the center of the gradient anywhere within, or even outside, the image. the values for the position are similar to the syntax for 2-value background-position. the gradient arc is part of the circumference of ...
repeating-radial-gradient() - CSS: Cascading Style Sheets
background: repeating-radial-gradient(ellipse farthest-corner at 20% 20%, red, black 5%, blue 5%, green 10%); background: repeating-radial-gradient(ellipse farthest-corner at 20% 20%, red 0 5%, green 5% 10%); } the elliptical gradient will be centered 20% from the top left, and will repeat 10 times between the center and the farthest corner (the bottom right corner). browsers supporting multi position color stops will display a red and green striped ellipse. browsers not supporting the syntax yet will see a gradient that goes from red to black and then from blue to green. note: please see using css gradients for more examples. specifications specification status comment css images module level 3the definition of 'repeating-radial-gradient(...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
Web › CSS › row-gap
er) between an element's grid rows. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. css grid layout initially defined the grid-row-gap property. this prefixed property is being replaced by row-gap. however, in order to support browsers that implemented grid-row-gap and not row-gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap: initial; row-gap: unset; values <length-percentage> is the widt...
text-align - CSS: Cascading Style Sheets
s the inconsistent spacing between words created by justified text can be problematic for people with cognitive concerns such as dyslexia. ...
text-combine-upright - CSS: Cascading Style Sheets
utside the range of 2-4 are invalid. formal definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete formal syntax none | all | [ digits <integer>? ] examples digits the digits value requires less markup than the all value when digits are being combined, but it is currently not very widely supported by browsers. html <p lang="ja" class="exampletext">平成20幓4月16ꗄ恫</p> css .exampletext { writing-mode: vertical-lr; text-combine-upright: digits 2; font: 36px serif; } results screenshotlive sample all the all value requires markup around every piece of horizontal text, but it is currently supported by more browsers than the digits value. html <p lang="zh-hant">갑...
text-decoration-skip - CSS: Cascading Style Sheets
the text-decoration-skip css property sets what parts of an element’s content any text decoration affecting the element must skip over. it controls all text decoration lines drawn by the element and also any text decoration lines drawn by its ancestors. note: most other browsers are converging on supporting the simpler text-decoration-skip-ink property. /* keyword values */ text-decoration-skip: none; text-decoration-skip: objects; text-decoration-skip: spaces; text-decoration-skip: edges; text-decoration-skip: box-decoration; /* multiple keywords */ text-decoration-skip: objects spaces; text-decoration-skip: leading-spaces trailing-spaces; text-decoration-skip: objects edges box-decoration; /* global values */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decora...
text-rendering - CSS: Cascading Style Sheets
ied font size and the applied scale) and request a font of that computed size from the platform's font system. but if you request a font size of, say, 9 with a scale of 140%, the resulting font size of 12.6 doesn't explicitly exist in the font system, so the browser rounds the font size to 12 instead. this results in stair-step scaling of text. but the geometricprecision property — when fully supported by the rendering engine — lets you scale your text fluidly. for large scale factors, you might see less-than-beautiful text rendering, but the size is what you would expect—neither rounded up nor down to the nearest font size supported by windows or linux. note: webkit precisely applies the specified value, but gecko treats the value the same as optimizelegibility. formal definiti...
text-size-adjust - CSS: Cascading Style Sheets
s none, auto, or a <percentage>. values none disables the browser's inflation algorithm. auto enables the browser's inflation algorithm. this value is used to cancel a none value previously set with css. <percentage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
touch-action - CSS: Cascading Style Sheets
; /* global values */ touch-action: inherit; touch-action: initial; touch-action: unset; by default, panning (scrolling) and pinching gestures are handled exclusively by the browser. an application using pointer events will receive a pointercancel event when the browser starts handling a touch gesture. by explicitly specifying which gestures should be handled by the browser, an application can supply its own behavior in pointermove and pointerup listeners for the remaining gestures. applications using touch events disable the browser handling of gestures by calling preventdefault(), but should also use touch-action to ensure the browser knows the intent of the application before any event listeners have been invoked. when a gesture is started, the browser intersects the touch-action value...
url() - CSS: Cascading Style Sheets
Web › CSS › url()
g are all valid and equivalent: <css_property>: url("https://example.com/image.png") <css_property>: url('https://example.com/image.png') <css_property>: url(https://example.com/image.png) path references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. formal syntax url( <string> <url-modifier>* ) examples content property html <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> css li::after { content: ' - ' url(https://mdn.mozillademos.org/files/...
user-select - CSS: Cascading Style Sheets
in part of the element, then the selection must contain the entire element including all its descendants. if a double-click or context-click occurred in sub-elements, the highest ancestor with this value will be selected. contain enables selection to start within the element; however, the selection will be contained by the bounds of that element. element (ie-specific alias) same as contain. supported only in internet explorer. note: css ui 4 renames user-select: element to contain. formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | text | none | contain | all examples html <p>you should be able to select this text.</p> <p class="unselectable">hey, you can't select this text!</p> <p class="a...
visibility - CSS: Cascading Style Sheets
tart or ending values must therefore be visible or no interpolation can happen. the value is interpolated as a discrete step, where values of the timing function between 0 and 1 map to visible and other values of the timing function (which occur only at the start/end of the transition or as a result of cubic-bezier() functions with y values outside of [0, 1]) map to the closer endpoint. notes support for visibility: collapse is missing or partially incorrect in some modern browsers. it may not be correctly treated like visibility: hidden on elements other than table rows and columns. visibility: collapse may change the layout of a table if the table has nested tables within the cells that are collapsed, unless visibility: visible is specified explicitly on nested tables. formal definit...
white-space - CSS: Cascading Style Sheets
*/ white-space: inherit; white-space: initial; white-space: unset; the white-space property is specified as a single keyword chosen from the list of values below. values normal sequences of white space are collapsed. newline characters in the source are handled the same as other white space. lines are broken as necessary to fill line boxes. nowrap collapses white space as for normal, but suppresses line breaks (text wrapping) within the source. pre sequences of white space are preserved. lines are only broken at newline characters in the source and at <br> elements. pre-wrap sequences of white space are preserved. lines are broken at newline characters, at <br>, and as necessary to fill line boxes. pre-line sequences of white space are collapsed. lines are broken at newline cha...
writing-mode - CSS: Cascading Style Sheets
candidate recommendation add sideways-lr and sideways-rl css writing modes module level 3the definition of 'writing-mode' in that specification. proposed recommendation initial defini...
zoom - CSS: Cascading Style Sheets
Web › CSS › zoom
m: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* global values */ zoom: inherit; zoom: initial; zoom: unset; syntax values normal render this element at its normal size. reset do not (de)magnify this element if the user applies non-pinch-based zooming (e.g. by pressing ctrl-- or ctrl++ keyboard shortcuts) to the document. only supported by webkit (and possibly blink). <percentage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller than 100% zoom out. <number> zoom factor. equivalent to the corresponding percentage (1.0 = 100% = normal). values larger than 1.0 zoom in. values smaller than 1.0 zoom out. formal definition initial valuenormalapplies toall elementsinheritednocomput...
Demos of open web technologies
this page offers links to interesting demonstrations of these technologies. if you know of a good demonstration or application of open web technology, please add a link to the appropriate section here. ...
math:min() - EXSLT
Web › EXSLT › math › min
using xsl:sort() with a data type of number. the minimum value is then the first node in the sorted list, converted into a number. note: syntax math:min(nodeset) parameters nodeset the node-set whose lowest value is to be returned. returns a result tree fragment representing the lowest valued node's numeric value as a string. specifications exslt - math:min browser compatibility supported in gecko 1.9 and later. ...
EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exslt is a set of extensions to xslt. there are a number of modules; those that are supported by firefox are listed below: common (exsl)the exslt common package provides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings. exslt mo...
Community - Developer guides
Web › Guide › AJAX › Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. ...
Ajax - Developer guides
Web › Guide › AJAX
on the user's computer, using file or blob objects to specify the file or data to read. file objects may be obtained from a filelist object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement. html in xmlhttprequest the xmlhttprequest specification adds html parsing support to xmlhttprequest, which originally supported only xml parsing. this feature allows web apps to obtain an html resource as a parsed dom using xmlhttprequest. view all... tools axios promise based http client, which uses xmlhttprequest internally. see also ajax: a new approach to web applications jesse james garrett, of adaptive path, wrote this article in february 2005, introdu...
Web Audio playbackRate explained - Developer guides
to which the media resets; for example, if we change the source of the video, or (in some browsers) when an ended event is generated. so defaultplaybackrate allows us to set the playback rate before playing the media, while playbackrate allows us to change it during media playback. there is also an event available called ratechange, which fires every time the playbackrate changes. browser support chrome 20+ āœ” firefox 20+ āœ” ie 9+ āœ” safari 6+ āœ” opera 15+ āœ” mobile chrome (android) āœ– mobile firefox 24+ āœ” ie mobile āœ– mobile safari 6+ (ios) āœ” opera mobile āœ– notes most browsers stop playing audio outside playbackrate bounds of 0.5 and 4, leaving the video playing silently. for most applications, it's recommended that you limit the range to between 0.5 and...
Audio and video manipulation - Developer guides
* 4 + 1] = grey; frame.data[i * 4 + 2] = grey; } this.ctx1.putimagedata(frame, 0, 0); return; } }; once the page has loaded you can call processor.doload() result this is a pretty simple example showing how to manipulate video frames using a canvas. for efficiency, you should consider using requestanimationframe() instead of settimeout() when running on browsers that support it. note: due to potential security issues if your video is on a different domain than your code, you'll need to enable cors (cross origin resource sharing) on your video server. video and webgl webgl is a powerful api that uses canvas to draw hardware-accelerated 3d or 2d scenes. you can combine webgl and the <video> element to create video textures, which means you can put video inside...
Block formatting context - Developer guides
even when the column-span: all element isn't contained by a multicol container (spec change, chrome bug). formatting contexts affect layout, but typically, we create a new block formatting context for the positioning and clearing floats rather than changing the layout, because an element that establishes a new block formatting context will: contain internal floats. exclude external floats. suppress margin collapsing. note: a flex/grid container(display: flex/grid/inline-flex/inline-grid) establishes a new flex/grid formatting context, which is similar to block formatting context except layout. there's no floating children avaliable inside a flex/grid container, but exclude external floats and suppress margin collapsing still works. examples contain internal floats make float co...
Challenge solutions - Developer guides
this page provides solutions to the challenges posed in the css getting started tutorial. these are not the only possible solutions. the sections below correspond to the titles of the tutorial sections. why use css colors challenge without looking up a reference, find five more color names that work in your stylesheet. solution css supports common color names like orange, yellow, blue, green, or black. it also supports some more exotic color names like chartreuse, fuschia, or burlywood. see css color value for a complete list as well as other ways of specifying colors. how css works dom inspector challenge in domi, click on a strong node. use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal t...
Creating and triggering events - Developer guides
d to the events fired by the browser itself. creating custom events events can be created with the event constructor as follows: const event = new event('build'); // listen for the event. elem.addeventlistener('build', function (e) { /* ... */ }, false); // dispatch the event. elem.dispatchevent(event); the above code example uses the eventtarget.dispatchevent() method. this constructor is supported in most modern browsers (with internet explorer being the exception). for a more verbose approach (which works with internet explorer), see the old-fashioned way below. adding custom data – customevent() to add more data to the event object, the customevent interface exists and the detail property can be used to pass custom data. for example, the event could be created as follows: con...
Mouse gesture events - Developer guides
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. gecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks. note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content. note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur. if you handle a gesture event and wi...
Rich-Text Editing in Mozilla - Developer guides
note: this document is out-of-date; you are advised to consult the more up-to-date document available at making content editable. mozilla 1.3 introduces an implementation of microsoft® internet explorer's designmode feature. the rich-text editing support in mozilla 1.3 supports the designmode feature which turns html documents into rich-text editors. starting in firefox 3, mozilla also supports internet explorer's contenteditable attribute which allows any element to become editable or non-editable (the latter for when preventing change to fixed elements in an editable environment). setting up rich-text editing rich-text editing is initialized by setting the designmode property of a document to "on", such as the document inside an iframe. once designmode has been set to "on", th...
Making content editable - Developer guides
things are somewhat more consistent. as of firefox 60, firefox will be updated to wrap the separate lines in <div> elements, matching the behavior of chrome, modern opera, edge, and safari. try it out in the above example. note: internet explorer, which is no longer being developed, uses <p> elements instead of <div>. if you want to use a different paragraph separator, the above browsers all support document.execcommand, which provides a defaultparagraphseparator command to allow you to change it. for example, to use <p> elements: document.execcommand("defaultparagraphseparator", false, "p"); additionally, firefox supports the non-standard argument, br, for defaultparagraphseparator since firefox 55. this is useful if your web application expects the older firefox behavior, and you don...
Constraint validation - Developer guides
on is triggered. note that most input types don't have intrinsic constraints, as some are simply barred from constraint validation or have a sanitization algorithm transforming incorrect values to a correct default. validation-related attributes in addition to the type attribute described above, the following attributes are used to describe basic constraints: attribute input types supporting the attribute possible values constraint description associated violation pattern text, search, url, tel, email, password a javascript regular expression (compiled with the ecmascript 5 global, ignorecase, and multiline flags disabled) the value must match the pattern. patternmismatch constraint violation min range, number a valid number ...
Localizations and character encodings - Developer guides
mon to leave the encoding undeclared and to use a region-specific encoding that wasn't able to represent all of unicode. firefox needs a fallback encoding that it uses for non-conforming legacy content that doesn't declare its encoding. for most locales, the fallback encoding is windows-1252 (often called iso-8859-1), which was the encoding emitted by most windows applications in the 1990s and a superset of the encoding emitted by most unix applications in the 1990s as a deployed in the america has and in western europe. however, there are locales where web publishing was common already in the 1990s but the windows-1252 encoding was not suitable for the local language. in these locales, legacy content that doesn't declare its encoding is typically encoded using a legacy encoding other than w...
The Web Open Font Format (WOFF) - Developer guides
Web › Guide › WOFF
it uses a compressed version of the same table-based sfnt structure used by truetype, opentype, and open font format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license information if desired. there are three main benefits to using woff: the font data is compressed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files. ...
HTML attribute: accept - HTML: Hypertext Markup Language
because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable. ...
HTML attribute: capture - HTML: Hypertext Markup Language
the capture attribute takes as it's value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. ...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
depending on the element, the attribute can be a cors settings attribute. the crossorigin content attribute on media elements is a cors settings attribute. these attributes are enumerated, and have the following possible values: keyword description anonymous cors requests for this element will have the credentials flag set to 'same-origin'. ...
HTML attribute: min - HTML: Hypertext Markup Language
Web › HTML › Attributes › min
d a big red border around invalid inputs: input:invalid { border: solid red 3px; } then define an input with a minimum value of 7.2, omitting the step attribute, wherein it defaults to 1. <input id="mynumber" name="mynumber" type="number" min="7.2" value="8"> because step defaults to 1, valid values include 7.2, 8.2, 9.2, and so on. the value 8 is not valid. as we included an invalid value, supporting browsers will show the value as invalid. if not explicitly included, step defaults to 1 for number and range, and 1 unit type (second, week, month, day) for the date/time input types. ...
HTML attribute: pattern - HTML: Hypertext Markup Language
should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched. if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validitystate object's read-only typemismatch property will be true. usability when including a pattern, provide a description of the pattern in visible text near ...
HTML attribute: step - HTML: Hypertext Markup Language
Web › HTML › Attributes › step
er around invalid inputs: input:invalid { border: solid red 3px; } then define an input with a minimum value of 7.2, omitting the step attribute, wherein it defaults to 1. <input id="mynumber" name="mynumber" type="number" step="2" min="1.2"> valid values include 1.2, 3.2, 5.2, 7.2, 9.2, 11.2, and so on. integers and even numbers follwed by .2 are not valid. as we included an invalid value, supporting browsers will show the value as invalid. the number spinner, if present, will only show valid float values of 1.2 and greater note: when the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and stepmismatch for more infor...
Date and time formats used in HTML - HTML: Hypertext Markup Language
il the year 1582 (replacing the similar julian calendar), for html's purposes, the gregorian calendar is extended back to the year 1 c.e. make sure any older dates account for this. for the purposes of html dates, years are always at least four digits long; years prior to the year 1000 are padded with leading zeroes ("0"), so the year 72 is written as 0072. years prior to the year 1 c.e. are not supported, so html doesn't support years 1 b.c.e. (1 b.c.) or earlier. a year is normally 365 days long, except during leap years. leap years a leap year is any year which is divisible by 400 or the year is divisible by 4 but not by 100. although the calendar year is normally 365 days long, it actually takes the planet earth approximately 365.2422 days to complete a single orbit around the sun. le...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
notes: download only works for same-origin urls, or the blob: and data: schemes. if content-disposition has a different filename than download, the header takes priority. (if content-disposition: inline, firefox prefers the header while chrome prefers download.) href the url that the hyperlink points to. links are not restricted to http-based urls — they can use any url scheme supported by browsers: sections of a page with fragment urls pieces of media files with media fragments telephone numbers with tel: urls email addresses with mailto: urls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url. no built-in functionality. allowed values are the same as ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
Web › HTML › Element › abbr
, phrasing content, palpable content permitted content phrasing content tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only supports the global attributes. the title attribute has a specific semantic meaning when used with the <abbr> element; it must contain a full human-readable description or expansion of the abbreviation. this text is often presented by browsers as a tooltip when the mouse cursor is hovered over the element. each <abbr> element you use is independent from all others; providing a title for one does not...
<address>: The Contact Address element - HTML: Hypertext Markup Language
Web › HTML › Element › address
<address> tag as its parent). implicit aria role no corresponding role permitted aria roles any dom interface htmlelement prior to gecko 2.0 (firefox 4), gecko implemented this element using the htmlspanelement interface attributes this element only includes the global attributes. usage notes it used to be the case that an <address> element was only supposed to be used to represent the contact information of the document's author. in the latest spec versions however, its definition has been updated so it can now be used to mark up arbitrary addresses. this element should not contain more information than the contact information, like a publication date (which belongs in a <time> element). typically an <address> element can be placed inside the...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
oid. use this attribute only if the href attribute is present. shape the shape of the associated hot spot. the specifications for html defines the values rect, which defines a rectangular region; circle, which defines a circular region; poly, which defines a polygon; and default, which indicates the entire region beyond any defined shapes. many browsers, notably internet explorer 4 and higher, support circ, polygon, and rectangle as valid values for shape, but these values are non-standard. target a keyword or author-defined name of the browsing context to display the linked resource. the following keywords have special meanings: _self (default): show the resource in the current browsing context. _blank: show the resource in a new, unnamed browsing context. _parent: show the res...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
Web › HTML › Element › bdi
content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes like all other html elements, this element supports the global attributes, except that the dir attribute behaves differently than normal: it defaults to auto, meaning its value is never inherited from the parent element. this means that unless you specify a value of either rtl or ltr for dir, the user agent will determine the correct directionality to use based on the contents of the <bdi>. examples no <bdi> with only ltr this example list...
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › blink
the html blink element (<blink>) is a non-standard element which causes the enclosed text to flash slowly. do not use this element as it is obsolete and is bad design practice. blinking text is frowned upon by several accessibility standards and the css specification allows browsers to ignore the <blink> element. dom interface this element is unsupported and thus implements the htmlunknownelement interface. example <blink>why would somebody use this?</blink> result (toned down!) specification this element is non-standard and not part of any specification. if you don't believe us, see for yourself in the html spec. css polyfill if you really do need a polyfill, then you can use the following css polyfill. works in ie10+. blink { -webkit-animation: 2s linear infinite...
<command>: The HTML Command element - HTML: Hypertext Markup Language
Web › HTML › Element › command
the html command element (<command>) represents a command which the user can invoke. commands are often used as part of a context menu or toolbar. however, they can be used anywhere on the page. the <command> element is included in the w3c specification, but not in the whatwg specification, and browser support is nonexistent. you should use the <menuitem> element instead, although that element is non-standard and only supported in edge and firefox. content categories flow content, phrasing content, metadata content. permitted content none, it is an empty element. tag omission the start tag is mandatory, but, as it is a void element, the use of an end tag is forbidden. permitted parent elements <colgroup> only, though it can be implicitly ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
Web › HTML › Element › dialog
log'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked -...
<dir>: The Directory element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › dir
s a container for a directory of files and/or folders, potentially with styles and icons applied by the user agent. do not use this obsolete element; instead, you should use the <ul> element for lists, including lists of files. usage note: do not use this element. though present in early html specifications, it has been deprecated in html 4, and has since been removed entirely. no major browsers support this element. dom interface this element implements the htmldirectoryelement interface. attributes like all other html elements, this element supports the global attributes. compact this boolean attribute hints that the list should be rendered in a compact style. the interpretation of this attribute depends on the user agent and it doesn't work in all browsers. usage note: do not use...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
Web › HTML › Element › embed
n a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this topic documents only the element that is defined as part of html5. it does not address earlier, non-standardized implementation of the element. keep in mind that most modern browsers have deprecated and removed support for browser plug-ins, so relying upon <embed> is generally not wise if you want your site to be operable on the average user's browser. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content none, it is an empty element. tag omission must have a start tag, and must not have an end tag. ...
<font> - HTML: Hypertext Markup Language
Web › HTML › Element › font
html5. starting with html 4, html does not convey styling information anymore (outside the <style> element or the style attribute of each element). for any new web development, styling should be written using css only. the former behavior of the <font> element can be achieved, and even better controlled using the css fonts css properties. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format. face this attribute contains a comma-separated list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, ...
<frame> - HTML: Hypertext Markup Language
Web › HTML › Element › frame
h defines a particular area in which another html document can be displayed. a frame should be used within a <frameset>. using the <frame> element is not encouraged because of certain disadvantages such as performance problems and lack of accessibility for users with screen readers. instead of the <frame> element, <iframe> may be preferred. attributes like all other html elements, this element supports the global attributes. src this attribute specifies the document that will be displayed by the frame. name this attribute is used for labeling frames. without labeling, every link will open in the frame that it’s in – the closest parent frame. see the target attribute for more information. noresize this attribute prevents resizing of frames by users. scrolling this attribute de...
<frameset> - HTML: Hypertext Markup Language
Web › HTML › Element › frameset
cols this attribute specifies the number and size of horizontal spaces in a frameset. ...
manifest - HTML: Hypertext Markup Language
Web › HTML › Element › html › manifest
s been deprecated. use service workers instead. ...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
Web › HTML › Element › html
nnounced properly. mdn understanding wcag, guideline 3.1 explanations understanding success criterion 3.1.1 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of '<html>' in that specification. living standard html5the definition of '<html>' in that specification. recommendation added support for the manifest attribute (deprecated later). obsoleted the version attribute html 4.01 specificationthe definition of '<html>' in that specification. recommendation deprecated the version attribute ...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s label text is inserted between the opening and closing tags, you can include html in the label, even images. value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. <input type="button" value="click me"> if you don't specify a value, you get an empty button: <input type="button"> using buttons <input type="button"> elements ha...
<input type="datetime"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › datetime
the html <input type="datetime"> was a control for entering a date and time (hour, minute, second, and fraction of a second) as well as a timezone. this feature has been removed from whatwg html, and is no longer supported in browsers. instead, browsers are implementing (and developers are encouraged to use) <input type="datetime-local">. the format of the date and time value used by this input type is described in format of a valid global date and time string in date and time formats used in html. ...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
e, and there is no way to make it visible in the page's content. note: there is a live example below the following line of code — if it is working correctly, you should see nothing! <input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server. events none. supported common attributes autocomplete idl attributes value methods none. note: the input and change events do not apply to this input type. hidden inputs cannot be focused even using javascript (e.g. hiddeninput.focus()). value the <input> element's value attribute holds a domstring that contains the hidden data you want to include when the form is submitted t...
<input type="reset"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › reset
s project, please clone https://github.com/mdn/interactive-examples and send us a pull request. you should usually avoid including reset buttons in your forms. they're rarely useful, and are instead more likely to frustrate users who click them by mistake (often while trying to click the submit button). value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label. buttons such as reset don't have a value otherwise. <input type="reset" value="reset the form"> if you don't specify a value, you get an button with the default label (typi...
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › noembed
the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use. this element was deprecated in html 4.01 and above in favor of placing fallback content between the opening and closing tags of an <object> element. while this element currently still works in many browsers, it is obsolete and should not be used. use <object> instead, with fallback content between the opening and closing tags of the element. examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag. show an alternative content <embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="2...
<noscript> - HTML: Hypertext Markup Language
Web › HTML › Element › noscript
content categories metadata content, flow content, phrasing content. permitted content when scripting is disabled and when it is a descendant of the <head> element: in any order, zero or more <link> elements, zero or more <style> elements, and zero or more <meta> elements. when scripting is disabled and when it isn't a descendant of the <head> element: any transparent content, but no <noscript> element must be among its descendants. otherwise: flow content or phrasing content. ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › pre
preformatted text. the alternate description should clearly and concisely describe the image or diagram's content. people experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the preformatted text characters are representing when they are read out in sequence. a combination of the <figure> and <figcaption> elements, supplemented by a combination of an id and the aria role and aria-labelledby attributes allow the preformatted text to be announced as an image, with the figcaption serving as the image's alternate description. example <figure role="img" aria-labelledby="cow-caption"> <pre> ___________________________ < i'm an expert in my field. > --------------------------- \ ^__^ \ (o...
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
Web › HTML › Element › rb
parts annotated completely separately. in this case we don't need to include <rb> elements: <ruby> ę¼¢ <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> <ruby> <rb>ę¼¢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> body { font-size: 22px; } the output looks like so: the html above might look something like this when rendered by a browser without ruby support: 漢字 (kan ji) body { font-size: 22px; } note: see the article about the <ruby> element for further examples. specifications specification status comment html5the definition of '<rb>' in that specification. recommendation ...
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
Web › HTML › Element › rt
ia roles any dom interface htmlelement attributes this element only includes the global attributes. examples this simple example provides romaji transliteration for the kanji characters within the <ruby> element: <ruby> ę¼¢ <rt>kan</rt> 字 <rt>ji</rt> </ruby> body { font-size: 22px; } the output looks like this in your browser: on a browser without ruby support, this example might look like this: ę¼¢ kan 字 ji body { font-size: 22px; } specifications specification status comment html living standardthe definition of '<rt>' in that specification. living standard html5the definition of '<rt>' in that specification. recommendation ...
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
Web › HTML › Element › shadow
y element that accepts flow content. permitted aria roles none dom interface htmlshadowelement attributes this element includes the global attributes. example here is a simple example of using the <shadow> element. it is an html file with everything needed in it. note: this is an experimental technology. for this code to work, the browser you display it in must support web components. see enabling web components in firefox. <html> <head></head> <body> <!-- this <div> will hold the shadow roots. --> <div> <!-- this heading will not be displayed --> <h4>my original heading</h4> </div> <script> // get the <div> above with its content var origcontent = document.queryselector('div'); // create the first shadow root var sha...
<spacer> - HTML: Hypertext Markup Language
Web › HTML › Element › spacer
<spacer> is an obsolete html element which allowed insertion of empty spaces on pages. it was devised by netscape to accomplish the same effect as a single-pixel layout image, which was something web designers used to use to add white spaces to web pages without actually using an image. however, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple css. firefox, which is the descendant of netscape's browsers, removed support for <spacer> in version 4. attributes like all other html elements, this element supports the global attributes. type this attribute determines type of spacer. possible values are horizontal, vertical and block. size this attribute can be used for defining size of spacer in pixels when type is horizon...
<sub>: The Subscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sub
of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule. another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is commonly known as "caffeine."</p> the output: specifications specification status comment html living standardthe definition of '<sub> and <sup>' in that specification. living standard html5the definition of '<sub> and <sup>;' in that specification. recommendation ...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
Web › HTML › Element › summary
html specification, the default style for <summary> elements includes display: list-item. this makes it possible to change or remove the icon displayed as the disclosure widget next to the label from the default, which is typically a triangle. you can also change the style to display: block to remove the disclosure triangle. see the browser compatibility section for details, as not all browsers support full functionality of this element yet. examples below are some examples showing <summary> in use. you can find more examples in the documentation for the <details> element. basic example a simple example showing the use of <summary> in a <details> element: <details open> <summary>overview</summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>...
<table>: The Table element - HTML: Hypertext Markup Language
Web › HTML › Element › table
this helps people navigating with the aid of assistive technology such as a screen reader, people experiencing low vision conditions, and people with cognitive concerns. mdn adding a caption to your table with...
<time> - HTML: Hypertext Markup Language
Web › HTML › Element › time
tent. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes. datetime this attribute indicates the time and/or date of the element and must be in one of the formats described below. usage notes this element is for presenting dates and times in a machine readable format. for example, this can help a user agent offer to add an event to a user's calendar. this element should not be used for dates prior to the introduction o...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ul
cated: use css instead. to give a similar effect as the compact attribute, the css property line-height can be used with a value of 80%. type this attribute sets the bullet style for the list. the values defined under html3.2 and the transitional version of html 4.0/4.01 are: circle disc square a fourth bullet type has been defined in the webtv interface, but not all browsers support it: triangle. if not present and if no css list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the list. warning: do not use this attribute, as it has been deprecated; use the css list-style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical orderi...
class - HTML: Hypertext Markup Language
n of 'class' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'class' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, class is now a true global attribute. html 4.01 specificationthe definition of 'class' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. ...
id - HTML: Hypertext Markup Language
ification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'id' in that specification. recommendation snapshot of html living standard, now accept '_', '-' and '.' if not at the beginning of the id. it is also a true global attribute. html 4.01 specificationthe definition of 'id' in that specification. recommendation supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. ...
is - HTML: Hypertext Markup Language
. this attribute can only be used if the specified custom element name has been successfully defined in the current document, and extends the element type it is being applied to. examples the following code is taken from our word-count-web-component example (see it live also). // create a class for the element class wordcount extends htmlparagraphelement { constructor() { // always call super first in constructor super(); // constructor contents ommitted for brevity ... } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html living standardthe definition of 'is' in that specification. living standard ...
itemid - HTML: Hypertext Markup Language
the itemid global attribute provides microdata in the form of a unique, global identifier of an item. an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes. also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. however, the following example correctly illustrates that a ...
lang - HTML: Hypertext Markup Language
...
spellcheck - HTML: Hypertext Markup Language
lue may also be inherited, which means that the element content will be checked for spelling errors only if its nearest ancestor has a spellcheck state of true. this attribute is merely a hint for the browser: browsers are not required to check for spelling errors. typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking. specifications specification status comment html living standardthe definition of 'spellcheck' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'spellcheck' in that specification. recommendation snapshot of html living standard, initial definition ...
style - HTML: Hypertext Markup Language
tion of 'style' in that specification. recommendation snapshot of html living standard, no change from html5 html5the definition of 'style' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe definition of 'style' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. css style attributes recommendation defines the content of the style attribute. ...
tabindex - HTML: Hypertext Markup Language
at specification. living standard no change from latest snapshot, html 5.1. html 5.1the definition of 'tabindex' in that specification. recommendation snapshot of html living standard, no change from html5. html5the definition of 'tabindex' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, the attribute is now supported on all elements (global attributes). html 4.01 specificationthe definition of 'tabindex' in that specification. recommendation only supported on <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>. ...
x-ms-format-detection - HTML: Hypertext Markup Language
ether data formats within the element’s text, like phone numbers, are automatically converted to followable links. existing links, such as ones with the tel: scheme, are unaffected. links created through format detection do not appear in the dom. this proprietary property is specific to internet explorer and microsoft edge. syntax <html x-ms-format-detection="none"> value all all supported data formats are detected. none format detection is turned off. phone phone number patterns are autolinked. ...
Inline elements - HTML: Hypertext Markup Language
a> <abbr> <acronym> <audio> (if it has visible controls) <b> <bdi> <bdo> <big> <br> <button> <canvas> <cite> <code> <data> <datalist> <del> <dfn> <em> <embed> <i> <iframe> <img> <input> <ins> <kbd> <label> <map> <mark> <meter> <noscript> <object> <output> <picture> <progress> <q> <ruby> <s> <samp> <script> <select> <slot> <small> <span> <strong> <sub> <sup> <svg> <template> <textarea> <time> <u> <tt> <var> <video> <wbr> see also block-level elements html element reference display content categories block and inline layout in normal flow ...
Using the application cache - HTML: Hypertext Markup Language
introduction html5 provides an application caching mechanism that lets web applications run offline. this application cache (appcache) interface lists resources that browsers should cache to be available offline. ...
HTTP authentication - HTTP
which is introduced in more detail below. iana maintains a list of authentication schemes, but there are other schemes offered by host services, such as amazon aws. common authentication schemes include: basic see rfc 7617, base64-encoded credentials. more information below. bearer see rfc 6750, bearer tokens to access oauth 2.0-protected resources digest see rfc 7616, only md5 hashing is supported in firefox, see bug 472823 for sha encryption support hoba see rfc 7486, section 3, http origin-bound authentication, digital-signature-based mutual see rfc 8120 aws4-hmac-sha256 see aws docs basic authentication scheme the "basic" http authentication scheme is defined in rfc 7617, which transmits credentials as user id/password pairs, encoded using base64. security of basic authe...
Basics of HTTP - HTTP
responses have a very clear structure. this introductory article describes this structure, its purpose, and its possibilities. frame and message structure in http/2 http/2 encapsulates and represents http/1.x messages in a binary frame. this article explains the frame structure, its purpose, and the way it's encoded. connection management in http/1.x http/1.1 was the first version of http to support persistent connection and pipelining. this article explains both concepts. connection management in http/2 http/2 completely revisited how connections are created and maintained. this article explains how http frames allow multiplexing and solve the 'head-of-line' blocking problem of former http versions. content negotiation http introduces a set of headers, starting with accept as a way ...
Reason: invalid token ā€˜xyz’ in CORS header ā€˜Access-Control-Allow-Methods’ - HTTP
reason reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ what went wrong? the response to the cors request that was sent by the server includes an access-control-allow-methods header which includes at least one invalid method name. the access-control-allow-methods header is sent by the server to let the client know what http request methods it supports for cors requests. the header's value is a comma-delineated string of http method names, such as get, post, or head. if any of the specified values are not recognized by the client user agent, this error occurs. this is a problem that most likely can only be fixed on the server side, by modifying the server's configuration to no longer send the invalid or unknown method name with the access-control-allow-me...
Reason: missing token ā€˜xyz’ in CORS header ā€˜Access-Control-Allow-Headers’ from CORS preflight channel - HTTP
the value of access-control-allow-headers should be a comma-delineated list of header names, such as "x-custom-information" or any of the standard but non-basic header names (which are always allowed). ...
CORS errors - HTTP
Web › HTTP › CORS › Errors
and offering possible solutions. ...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
certain types of attacks, including cross site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to distribution of malware. csp is designed to be fully backward compatible (except csp version 2 where there are some explicitly-mentioned inconsistencies in backward compatibility; more details here section 1.1). browsers that don't support it still work with servers that implement it, and vice-versa: browsers that don't support csp simply ignore it, functioning as usual, defaulting to the standard same-origin policy for web content. if the site doesn't offer the csp header, browsers likewise use the standard same-origin policy. to enable csp, you need to configure your web server to return the content-security-policy http head...
HTTP conditional requests - HTTP
he validators on the server side, this mechanism is transparent: all browsers manage a cache and send such conditional requests without any special work to be done by web developers. integrity of a partial download partial downloading of files is a functionality of http that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the accept-ranges header. once this happens, the client can resume a download by sending a ranges header with the missing ranges: the principle is simple, but there is one potential problem: if the downloaded resource has been modified between both downloads, the obtained ranges will correspond to two different versions of the resource, and t...
Accept-Charset - HTTP
e any character encoding from this request header, it can theoretically send back a 406 not acceptable error code. but for a better user experience, this is rarely done and the accept-charset header is ignored. in early versions of http/1.1, a default character encoding was defined: iso-8859-1. this is no longer recommended, and now each content-type may have its own default. utf-8 is now well-supported and the overwhelmingly preferred character encoding. to guarantee better privacy through less configuration-based entropy, all browsers omit the accept-charset header: internet explorer 8+, safari 5+, opera 11+, firefox 10+ and chrome 27+ no longer send it. header type request header forbidden header name yes syntax accept-charset: <charset> // multiple ty...
Accept-Patch - HTTP
the accept-patch response http header advertises which media-type the server is able to understand. accept-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 accept-patch header referencing one or more supported media types. notes: an iana registry maintains a complete list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. header type response header fo...
Access-Control-Allow-Origin - HTTP
<origin> access-control-allow-origin: null directives * for requests without credentials, the literal value "*" can be specified, as a wildcard; the value tells browsers to allow requesting code from any origin to access the resource. attempting to use the wildcard with credentials will result in an error. <origin> specifies an origin. only a single origin can be specified. if the server supports clients from multiple origins, it must return the origin for the specific client making the request. null specifies the origin "null". note: null should not be used: "it may seem safe to return access-control-allow-origin: "null", but the serialization of the origin of any resource that uses a non-hierarchical scheme (such as data: or file:) and sandboxed documents is defined to be "null"...
Allow - HTTP
Web › HTTP › Headers › Allow
this header must be sent if the server responds with a 405 method not allowed status code to indicate which request methods can be used. an empty allow header indicates that the resource allows no request methods, which might occur temporarily for a given resource, for example. header type entity header forbidden header name no syntax allow: <http-methods> directives <http-methods> the comma-separated list of allowed http request methods. ...
Cache-Control - HTTP
validate cache-control: no-cache cache-control: no-store cache-control: no-transform cache-control: public cache-control: private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document. check the compatibility table for their support; user-agents that don't recognize them should ignore them. cache-control: immutable cache-control: stale-while-revalidate=<seconds> cache-control: stale-if-error=<seconds> directives cacheability a response is normally cached by the browser if: it has a status code of 301, 302, 307, 308, or 410 and cache-control does not have no-store, or if proxy, does not have private and authoriz...
Content-Encoding - HTTP
g: compress content-encoding: deflate content-encoding: identity content-encoding: br // multiple, in the order in which they were applied content-encoding: gzip, identity content-encoding: deflate, gzip directives gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc. this is the original format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. compress a format using the lempel-ziv-welch (lzw) algorithm. the value name was taken from the unix compress program, which implemented this algorithm. like the compress program, which has disappeared from most unix distributions, this content-encoding is not used by many browsers today, partly becaus...
CSP: base-uri - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: child-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: connect-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: default-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: font-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: form-action - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: frame-ancestors - HTTP
the http content-security-policy (csp) frame-ancestors directive specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. setting this directive to 'none' is similar to x-frame-options: deny (which is also supported in older browsers). csp version 2 directive type navigation directive default-src fallback no. not setting this allows anything. this directive is not supported in the <meta> element. syntax one or more sources can be set for the frame-ancestors policy: content-security-policy: frame-ancestors <source>; content-security-policy: frame-ancestors <source> <source>; sources <source> can be one of the following: the frame-ancestors directive’s syntax is similar to a source list...
CSP: frame-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: img-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: manifest-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: media-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: navigate-to - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: object-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: prefetch-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: report-to - HTTP
the content-security-policy report-to http response header field instructs the user agent to store reporting endpoints for an origin. content-security-policy: ...; report-to groupname the directive has no effect in and of itself, but only gains meaning in combination with other directives. csp version 1 directive type reporting directive this directive is not supported in the <meta> element. syntax content-security-policy: report-to <json-field-value>; examples see content-security-policy-report-only for more information and examples. report-to: { "group": "csp-endpoint", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/csp-reports" } ] }, { "group": "hpkp-endpoin...
CSP: sandbox - HTTP
ent-security-policy (csp) sandbox directive enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy. csp version 1.1 / 2 directive type document directive this directive is not supported in the <meta> element or by the content-security-policy-report-only header field. syntax content-security-policy: sandbox; content-security-policy: sandbox <value>; where <value> can optionally be one of the following values: allow-downloads-without-user-activation allows for downloads to occur without a gesture from the user. allow-forms allows the page to submit forms...
CSP: script-src-attr - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: script-src-elem - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: style-src-attr - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: style-src-elem - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
CSP: worker-src - HTTP
ripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support. '<hash-algorithm>-<base64-value>' a sha256, sha384 or sha512 hash of scripts or styles. the use of this source consists of two portions separated by a dash: the encryption algorithm used to create the hash and the base64-encoded hash of the script or style. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including lea...
Content-Security-Policy-Report-Only - HTTP
sponse header allows web developers to experiment with policies by monitoring (but not enforcing) their effects. these violation reports consist of json documents sent via an http post request to the specified uri. for more information, see also this article on content security policy (csp). header type response header forbidden header name no this header is not supported inside a <meta> element. syntax content-security-policy-report-only: <policy-directive>; <policy-directive> directives the directives of the content-security-policy header can also be applied to content-security-policy-report-only. the csp report-uri directive should be used with this header, otherwise this header will be an expensive no-op machine. examples this header report...
Content-Security-Policy - HTTP
ng process of csp violations. see also the content-security-policy-report-only header. report-uri instructs the user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the specified uri. though the report-to directive is intended to replace the deprecated report-uri directive, report-to is not supported in most browsers yet. so for compatibility with current browsers while also adding forward compatibility when browsers get report-to support, you can specify both report-uri and report-to: content-security-policy: ...; report-uri https://endpoint.example.com; report-to groupname in browsers that support report-to, the report-uri directive will be ignored. report-to fires a securi...
Digest - HTTP
Web › HTTP › Headers › Digest
message body (for example, in a response to a head request) partially contained in the message body (for example, in a response to a range request). header type response header forbidden header name no syntax digest: <digest-algorithm>=<digest-value> digest: <digest-algorithm>=<digest-value>,<digest-algorithm>=<digest-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <digest-value> the result of applying the digest algorithm to the resource representation and encoding the result. the choice of ...
Feature-Policy: xr-spatial-tracking - HTTP
the http feature-policy header xr-spatial-tracking directive controls whether the current document is allowed to use the webxr device api. this policy controls whether navigator.xr.requestsession() can return xrsession that requires spatial tracking and whether user agent can indicate support for sessions supporting spatial tracking via navigator.xr.issessionsupported() and devicechange event on navigator.xr object. syntax feature-policy: xr-spatial-tracking <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. 'self': the feature will be allowed in this document, and in all nested browsi...
Forwarded - HTTP
r "https"). examples using the forwarded header forwarded: for="_mdn" # case insensitive forwarded: for="[2001:db8:cafe::17]:4711" # separated by semicolon forwarded: for=192.0.2.60;proto=http;by=203.0.113.43 # multiple values can be appended using a comma forwarded: for=192.0.2.43, for=198.51.100.17 transitioning from x-forwarded-for to forwarded if your application, server, or proxy supports the standardized forwarded header, the x-forwarded-for header can be replaced. note that ipv6 address are quoted and enclosed in square brackets in forwarded. x-forwarded-for: 123.34.567.89 forwarded: for=123.34.567.89 x-forwarded-for: 192.0.2.43, "[2001:db8:cafe::17]" forwarded: for=192.0.2.43, for="[2001:db8:cafe::17]" specifications specification title rfc 72...
If-Modified-Since - HTTP
been last modified after the given date. if the request has not been modified since, the response will be a 304 without any body; the last-modified response header of a previous request will contain the date of last modification. unlike if-unmodified-since, if-modified-since can only be used with a get or head. when used in combination with if-none-match, it is ignored, unless the server doesn't support if-none-match. the most common use case is to update a cached entity that has no associated etag. header type request header forbidden header name no syntax if-modified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive). <day> 2 digit day...
If-None-Match - HTTP
comparison with the stored etag uses the weak comparison algorithm, meaning two files are considered identical if the content is equivalent — they don't have to be identical byte for byte. for example, two pages that differ by the date of generation in the footer would still be considered as identical. when used in combination with if-modified-since, if-none-match has precedence (if the server supports it). there are two common use cases: for get and head methods, to update a cached entity that has an associated etag. for other methods, and in particular for put, if-none-match used with the * value can be used to save a file not known to exist, guaranteeing that another upload didn't happen before, losing the data of the previous put; this problem is a variation of the lost update pro...
Origin - HTTP
Web › HTTP › Headers › Origin
l tcp port number on which the server is listening. if no port is given, the default port for the service requested (e.g., "80" for an http url) is implied. examples origin: https://developer.mozilla.org specifications specification comment rfc 6454, section 7: origin the web origin concept fetchthe definition of 'origin header' in that specification. supplants the origin header as defined in rfc6454. ...
Public-Key-Pins-Report-Only - HTTP
ublic key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header. the http public-key-pins-report-only response header was used to send reports of pinning violation to the report-uri specified in the header but, unlike public-key-pins still allows browsers to connect to the server if the pinning is violated. the header is silently ignored in modern browsers as support for hpkp has been removed. use certificate transparency and the expect-ct header instead. for more information, see the public-key-pins header reference page and the http public key pinning article. header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-ti...
Public-Key-Pins - HTTP
use certificate transparency and expect-ct header instead. ...
Retry-After - HTTP
response header forbidden header name no syntax retry-after: <http-date> retry-after: <delay-seconds> directives <http-date> a date after which to retry. see the date header for more details on the http date format. <delay-seconds> a non-negative decimal integer indicating the seconds to delay after the response is received. examples dealing with scheduled downtime support for the retry-after header on both clients and servers is still inconsistent. however, some crawlers and spiders, like the googlebot, honor the retry-after header. it is useful to send it along with a 503 (service unavailable) response, so that search engines will keep indexing your site when the downtime is over. retry-after: wed, 21 oct 2015 07:28:00 gmt retry-after: 120 specifications ...
Trailer - HTTP
Web › HTTP › Headers › Trailer
the te request header needs to be set to "trailers" to allow trailer fields. header type response header forbidden header name yes syntax trailer: header-names directives header-names http header fields which will be present in the trailer part of chunked messages. ...
Upgrade-Insecure-Requests - HTTP
re-requests request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests csp directive. header type request header forbidden header name no syntax upgrade-insecure-requests: 1 examples a client's request signals to the server that it supports the upgrade mechanisms of upgrade-insecure-requests: get / http/1.1 host: example.com upgrade-insecure-requests: 1 the server can now redirect to a secure version of the site. a vary header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism. location: https://example.com/ vary: upgrade-insecure-requests specifications speci...
Firefox user agent string reference - HTTP
or extensions added user agent parts to notify sites they were installed. ...
Vary - HTTP
Web › HTTP › Headers › Vary
when selecting a representation of a resource in a content negotiation algorithm. the vary header should be set on a 304 not modified response exactly like it would have been set on an equivalent 200 ok response. header type response header forbidden header name no syntax vary: * vary: <header-name>, <header-name>, ... directives * each request for a url is supposed to be treated as a unique and uncacheable request. a better way to indicate this is to use cache-control: no-store, which is clearer to read and also signals that the object shouldn't be stored ever. <header-name> a comma-separated list of header names to take into account when deciding whether or not a cached response can be used. examples dynamic serving when using the vary: user-age...
X-DNS-Prefetch-Control - HTTP
performed in the background, so that the dns is likely to have been resolved by the time the referenced items are needed. this reduces latency when the user clicks a link. header type response header forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching. this is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains. description dns requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks. by speculatively prefetching dns results, latency can be reduced ...
X-XSS-Protection - HTTP
f internet explorer, chrome and safari that stops pages from loading when they detect reflected cross-site scripting (xss) attacks. although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support csp. chrome has removed their xss auditor firefox have not, and will not implement x-xss-protection edge have retired their xss filter this means that if you do not need to support legacy browsers, it is recommended that you use content-security-policy without allowing unsafe-inline scripts instead. header type response header forbidden header name no ...
DELETE - HTTP
Web › HTTP › Methods › DELETE
rms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted. a 204 (no content) status code if the action has been enacted and no further information is to be supplied. a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status. http/1.1 200 ok date: wed, 21 oct 2015 07:28:00 gmt <html> <body> <h1>file deleted.</h1> </body> </html> specifications specification title rfc 7231, section 4.3.5: delete hypertext transfer protocol (http/1.1): semantics a...
OPTIONS - HTTP
Web › HTTP › Methods › OPTIONS
ethod, or an asterisk (*) to refer to the entire server. ...
PATCH - HTTP
Web › HTTP › Methods › PATCH
word "idempotent" means that any number of repeated, identical requests will leave the resource in the same state. for example if an auto-incrementing counter field is an integral part of the resource, then a put will naturally overwrite it (since it overwrites everything), but not necessarily so for patch. patch (like put) may have side-effects on other resources. to find out whether a server supports patch, a server can advertise its support by adding it to the list in the allow or access-control-allow-methods (for cors) response headers. another (implicit) indication that patch is allowed, is the presence of the accept-patch header, which specifies the patch document formats accepted by the server. request has body yes successful response has body yes ...
Network Error Logging - HTTP
reports are sent to a reporting group defined within a report-to header. ...
An overview of HTTP - HTTP
Web › HTTP › Overview
html... (here comes the 29769 bytes of the requested web page) close or reuse the connection for further requests. if http pipelining is activated, several requests can be sent without waiting for the first response to be fully received. http pipelining has proven difficult to implement in existing networks, where old pieces of software coexist with modern versions. http pipelining has been superseded in http/2 with more robust multiplexing requests within a frame. http messages http messages, as defined in http/1.1 and earlier, are human-readable. in http/2, these messages are embedded into a binary structure, a frame, allowing optimizations like compression of headers and multiplexing. even if only part of the original http message is sent in this version of http, the semantics of e...
Proxy servers and tunneling - HTTP
ta. http tunneling is using a protocol of higher level (http) to transport a lower level protocol (tcp). the http protocol specifies a request method called connect. it starts two-way communications with the requested resource and can be used to open a tunnel. this is how a client behind an http proxy can access websites using ssl (i.e. https, port 443). note, however, that not all proxy servers support the connect method or limit it to port 443 only. see also the http tunnel article on wikipedia. proxy auto-configuration (pac) a proxy auto-configuration (pac) file is a javascript function that determines whether web browser requests (http, https, and ftp) go directly to the destination or are forwarded to a web proxy server. the javascript function contained in the pac file defines the f...
HTTP Public Key Pinning (HPKP) - HTTP
note: public key pinning mechanism was deprecated in favor of certificate transparency and expect-ct header. http public key pinning (hpkp) was a security feature that used to tell a web client to associate a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates. it has been removed in modern browsers and is no longer supported. to ensure the authenticity of a server's public key used in tls sessions, this public key is wrapped into a x.509 certificate which is usually signed by a certificate authority (ca). web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names. if an attacker is able to compromise a single ca, they can perform mitm attacks on various tls conn...
HTTP resources and specifications - HTTP
tp extension proposed standard rfc 6455 the websocket protocol proposed standard rfc 5246 the transport layer security (tls) protocol version 1.2 this specification has been modified by subsequent rfcs, but these modifications have no effect on the http protocol. proposed standard rfc 8446 the transport layer security (tls) protocol version 1.3 supersedes tls 1.2. proposed standard rfc 2817 upgrading to tls within http/1.1 proposed standard rfc 7540 hypertext transfer protocol version 2 (http/2) proposed standard rfc 7541 hpack: header compression for http/2 on the standard track rfc 7838 http alternative services on the standard track rfc 7301 transport layer securi...
405 Method Not Allowed - HTTP
Web › HTTP › Status › 405
the hypertext transfer protocol (http) 405 method not allowed response status code indicates that the request method is known by the server but is not supported by the target resource. the server must generate an allow header field in a 405 response containing a list of the target resource's currently supported methods. status 405 method not allowed specifications specification title rfc 7231, section 6.5.5: 405 method not allowed hypertext transfer protocol (http/1.1): semantics and content ...
406 Not Acceptable - HTTP
Web › HTTP › Status › 406
proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this error is very rarely used. ...
501 Not Implemented - HTTP
Web › HTTP › Status › 501
the hypertext transfer protocol (http) 501 not implemented server error response code means that the server does not support the functionality required to fulfill the request. this status can also send a retry-after header, telling the requester when to check back to see if the functionality is supported by then. 501 is the appropriate response when the server does not recognize the request method and is incapable of supporting it for any resource. the only methods that servers are required to support (and therefore that must not return 501) are get and head. if the server does recognize the method, but intentionally does not support it, the appropriate response is 405 method not allowed. a 501 error is not something you can fix, but requires a fix by the web server you are trying to ...
506 Variant Also Negotiates - HTTP
Web › HTTP › Status › 506
the hypertext transfer protocol (http) 506 variant also negotiates response status code may be given in the context of transparent content negotiation (see rfc 2295). this protocol enables a client to retrieve the best variant of a given resource, where the server supports multiple variants. the variant also negotiates status code indicates an internal server configuration error in which the chosen variant is itself configured to engage in content negotiation, so is not a proper negotiation endpoint. status 506 variant also negotiates specifications specification title rfc 2295, section 8.1: 506 variant also negotiates transparent content negotiation in http ...
510 Not Extended - HTTP
Web › HTTP › Status › 510
the hypertext transfer protocol (http) 510 not extended response status code is sent in the context of the http extension framework, defined in rfc 2774. in that specification a client may send a request that contains an extension declaration, that describes the extension to be used. if the server receives such a request, but any described extensions are not supported for the request, then the server responds with the 510 status code. status 510 not extended specifications specification title rfc 2774, section 7: 510 not extended an http extension framework ...
About JavaScript - JavaScript
what is javascript? javascript® (often shortened to js) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for web pages, but it's used in many non-browser environments as well. it is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles. javascript runs on the client side of the web, which can be used to design / program how the web pages behave on the occurrence of an event. javascript is an easy to learn and also powerful scripting language, widely used for controlling web page behavior. contrary to popular misconception, javascript is not "interpreted java". in a nutshell, javascript is a dynamic scripting language su...
Closures - JavaScript
only a single method. situations where you might want to do this are particularly common on the web. much of the code written in front-end javascript is event-based. you define some behavior, and then attach it to an event that is triggered by the user (such as a click or a keypress). the code is attached as a callback (a single function that is executed in response to the event). for instance, suppose we want to add buttons to a page to adjust the text size. one way of doing this is to specify the font-size of the body element (in pixels), and then set the size of the other elements on the page (such as headers) using the relative em unit: body { font-family: helvetica, arial, sans-serif; font-size: 12px; } h1 { font-size: 1.5em; } h2 { font-size: 1.2em; } such interactive tex...
Functions - JavaScript
ltiplies these by the first argument . function multiply(multiplier, ...theargs) { return theargs.map(x => multiplier * x); } var arr = multiply(2, 1, 2, 3); console.log(arr); // [2, 4, 6] arrow functions an arrow function expression (previously, and now incorrectly known as fat arrow function) has a shorter syntax compared to function expressions and does not have its own this, arguments, super, or new.target. arrow functions are always anonymous. see also this hacks.mozilla.org blog post: "es6 in depth: arrow functions". two factors influenced the introduction of arrow functions: shorter functions and non-binding of this. shorter functions in some functional patterns, shorter functions are welcome. compare: var a = [ 'hydrogen', 'helium', 'lithium', 'beryllium' ]; var a2...
Meta programming - JavaScript
property lookup, assignment, enumeration, function invocation, etc). with the help of these two objects you are able to program at the meta level of javascript. proxies introduced in ecmascript 6, proxy objects allow you to intercept certain operations and to implement custom behaviors. ...
Groups and ranges - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'regexp: ranges' in that specification. ...
JavaScript technologies overview - JavaScript
, number, string, function, object, ...) the global object. in a browser, this global object is the window object, but ecmascript only defines the apis not specific to browsers, e.g. parseint, parsefloat, decodeuri, encodeuri... a prototype-based inheritance mechanism built-in objects and functions (json, math, array.prototype methods, object introspection methods, etc.) strict mode browser support as of october 2016, the current versions of the major web browsers implement ecmascript 5.1 and ecmascript 2015, but older versions (still in use) implement ecmascript 5 only. future the major 6th edition of ecmascript was officially approved and published as a standard on june 17, 2015 by the ecma general assembly. since then ecmascript editions are published on a yearly basis. internati...
JavaScript language resources - JavaScript
6262. ecma-262 3rd edition pdf december 1999 ecmascript language specification. this is the third revision of the ecmascript standard; corresponds to javascript 1.5. see also the errata ecma-262 5th edition pdf december 2009 ecmascript language specification. this is the fifth revision of the ecmascript standard. see also the es5 errata and ecmascript 5 support in mozilla ecma-357 pdf june 2004 ecmascript for xml (e4x). see also the e4x errata. ecma-262 5.1 edition pdf, html june 2011 this version is fully aligned with the 3rd edition of the international standard iso/iec 16262:2011. it includes es5 errata fixes, no new features. ecma-402 1st edition pdf, html december 2012 ecmascript int...
extends - JavaScript
cts. the .prototype of the extension must be an object or null. examples using extends the first example creates a class called square from a class called polygon. this example is extracted from this live demo (source). class square extends polygon { constructor(length) { // here, it calls the parent class' constructor with lengths // provided for the polygon's width and height super(length, length); // note: in derived classes, super() must be called before you // can use 'this'. leaving this out will cause a reference error. this.name = 'square'; } get area() { return this.height * this.width; } } using extends with built-in objects this example extends the built-in date object. this example is extracted from this live demo (source). class mydate...
static - JavaScript
atic methodname() { ... } examples using static in classes the following example demonstrates several things: how a static method is implemented on a class. that a class with a static member can be sub-classed. how a static method can and cannot be called. class triple { static triple(n = 1) { return n * 3; } } class biggertriple extends triple { static triple(n) { return super.triple(n) * super.triple(n); } } console.log(triple.triple()); // 3 console.log(triple.triple(6)); // 18 var tp = new triple(); console.log(biggertriple.triple(3)); // 81 (not affected by parent's instantiation) console.log(tp.triple()); // 'tp.triple is not a function'. calling static methods from another static method in order to call a static method within another stati...
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
ete a property, but that property is non-configurable. the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. this error happens only in strict mode code. in non-strict code, the operation returns false. examples attempting 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(); // typeer...
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
tion won't be halted. what went wrong? the non-standard date.prototype.tolocaleformat method is deprecated and shouldn't be used anymore. it uses a format string in the same format expected by the strftime() function in c. the function is no longer available in firefox 58+. examples deprecated syntax the date.prototype.tolocaleformat method is deprecated and will be removed (no cross-browser support, available in firefox only). var today = new date(); var date = today.tolocaleformat('%a, %e. %b %y'); console.log(date); // in german locale // "freitag, 10. märz 2017" alternative standard syntax using the ecmascript intl api the ecma-402 (ecmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time formatting (available in chrome 24...
SyntaxError: illegal character - JavaScript
ter" occurs when there is an invalid or unexpected token that doesn't belong at this position in the code. message syntaxerror: invalid character (edge) syntaxerror: illegal character (firefox) syntaxerror: invalid or unexpected token (chrome) error type syntaxerror what went wrong? there is an invalid or unexpected token that doesn't belong at this position in the code. use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). examples mismatched characters some characters look similar, but will cause the parser to fail interpreting your code. famous examples of this are quotes, the minus or semicolon (greek questionmark (u+37e) looks ...
TypeError: "x" is not a function - JavaScript
some code expects you to provide a function, but that didn't happen. ...
TypeError: "x" is read-only - JavaScript
not assign to read only property '0' of [object array] (chrome) error type typeerror what went wrong? the global variable or object property that was assigned to is a read-only property. (technically, it is a non-writable data property.) this error happens only in strict mode code. in non-strict code, the assignment is silently ignored. examples invalid cases read-only 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}); obj.score = 0; // typeerror 'use strict'; object.defineproperty(this, 'lung_count', {value: 2, writable: false}); lung_count = 3; // typeerror 'use strict'; var frozenarray = object.freeze([0, 1, 2]); frozenarray[0]++; // typeerror there ar...
SyntaxError: "x" is a reserved identifier - JavaScript
var package = ["potatoes", "rice", "fries"]; // syntaxerror: package is a reserved identifier you'll need to rename these variables. var colorenum = { red: 0, green: 1, blue: 2 }; var list = ["potatoes", "rice", "fries"]; update older browsers if you are using an older browser that does not yet implement let or class, for example, you should update to a more recent browser version that does support these new language features. "use strict"; class docarchiver {} // syntaxerror: class is a reserved identifier // (throws in older browsers only, e.g. firefox 44 and older) ...
SyntaxError: unterminated string literal - JavaScript
g will continue on the next line. make sure there is no space or any other character after the backslash (except for a line break), or as an indent; otherwise it will not work. ...
Method definitions - JavaScript
f you try to instantiate them. const obja = { method() {} } new obja.method // typeerror: obj.method is not a constructor const objb = { * g() {} } new objb.g // typeerror: obj.g is not a constructor (changed in es2016) examples simple test case const obj = { a: 'foo', b() { return this.a } }; console.log(obj.b()) // "foo" computed property names the shorthand syntax also supports computed property names. const bar = { foo0: function() { return 0 }, foo1() { return 1 }, ['foo' + 2]() { return 2 } } console.log(bar.foo0()) // 0 console.log(bar.foo1()) // 1 console.log(bar.foo2()) // 2 // a global function function foo() { return 1 } let name = 'foo' console.log(window[name]()) // 1 specifications specification ecmascript (ecma...
arguments[@@iterator]() - JavaScript
the initial value of the @@iterator property is the same function object as the initial value of the array.prototype.values property. syntax arguments[symbol.iterator]() examples iteration using for...of loop function f() { // your browser must support for..of loop // and let-scoped variables in for loops for (let letter of arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p'); specifications specification ecmascript (ecma-262)the definition of 'createunmappedargumentsobject' in that specification. ecmascript (ecma-262)the definition of 'createmappedargumentsobject' in that specification. ...
Rest parameters - JavaScript
ents as an array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax function f(a, b, ...theargs) { // ... } description a function's last parameter can be prefixed with ... which will cause all remaining (user supplied) arguments to be placed within a "standard" javascript array. only the last parameter can be a "rest parameter". function myfun(a, b, ...manymoreargs) { console.log("a", a) console.log("b", b) console.log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // console output: // a, one // b, two // manymoreargs, [three, four, five, six] difference b...
Array.prototype.fill() - JavaScript
9-10. var end = arguments[2]; var relativeend = end === undefined ? len : end >> 0; // step 11. var finalvalue = relativeend < 0 ? math.max(len + relativeend, 0) : math.min(relativeend, len); // step 12. while (k < finalvalue) { o[k] = value; k++; } // step 13. return o; } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples using fill [1, 2, 3].fill(4) // [4, 4, 4] [1, 2, 3].fill(4, 1) // [1, 4, 4] [1, 2, 3].fill(4, 1, 2) // [1, 4, 3] [1, 2, 3].fill(4, 1, 1) // [1, 2, 3] [1, 2, 3].fill...
Array.prototype.filter() - JavaScript
existing elements of the array are deleted in the same way they will not be visited. polyfill filter() was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of filter() in ecma-262 implementations which do not natively support it. this algorithm is exactly equivalent to the one specified in ecma-262, 5th edition, assuming that fn.call evaluates to the original value of function.prototype.bind(), and that array.prototype.push() has its original value. if (!array.prototype.filter){ array.prototype.filter = function(func, thisarg) { 'use strict'; if ( ! ((typeof func === 'function' || typeof func === 'funct...
Array.prototype.indexOf() - JavaScript
me method used by the === or triple-equals operator). note: for the string method, see string.prototype.indexof(). polyfill indexof() was added to the ecma-262 standard in the 5th edition; as such it may not be present in all browsers. you can work around this by utilizing the following code at the beginning of your scripts. this will allow you to use indexof() when there is still no native support. this algorithm matches the one specified in ecma-262, 5th edition, assuming typeerror and math.abs() have their original values. // this version tries to optimize by only checking for "in" when looking for undefined and // skipping the definitely fruitless nan search. other parts are merely cosmetic conciseness. // whether it is actually faster remains to be seen. if (!array.prototype.index...
Array.prototype.lastIndexOf() - JavaScript
ray using strict equality (the same method used by the ===, or triple-equals, operator). polyfill lastindexof was added to the ecma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of lastindexof in implementations which do not natively support it. this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object, typeerror, number, math.floor, math.abs, and math.min have their original values. // production steps of ecma-262, edition 5, 15.4.4.15 // reference: http://es5.github.io/#x15.4.4.15 if (!array.prototype.lastindexof) { array.prototype.lastindexof = function(searchelement /*, fromindex*/) { 'use s...
Array.prototype.some() - JavaScript
leted are not visited. caution: calling this method on an empty array returns false for any condition! polyfill some() was added to the ecma-262 standard in the 5th edition, and it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of some() in implementations which do not natively support it. this algorithm is exactly the one specified in ecma-262, 5th edition, assuming object and typeerror have their original values and that fun.call evaluates to the original value of function.prototype.call(). // production steps of ecma-262, edition 5, 15.4.4.17 // reference: http://es5.github.io/#x15.4.4.17 if (!array.prototype.some) { array.prototype.some = function(fun, thisarg) { ...
BigInt.asIntN() - JavaScript
nd 2width-1-1. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax bigint.asintn(width, bigint); parameters width the amount of bits available for the integer size. bigint the integer to clamp to fit into the supplied bits. returns the value of bigint modulo 2width as a signed integer. examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. const max = 2n ** (64n - 1n) - 1n; bigint.asintn(64, max); // ↪ 9223372036854775807n bigint.asintn(64, max + 1n); // ↪ -9223372036854775807n // negative because of overflow specifications ...
BigInt.asUintN() - JavaScript
and 2width-1. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax bigint.asuintn(width, bigint); parameters width the amount of bits available for the integer size. bigint the integer to clamp to fit into the supplied bits. returns the value of bigint modulo 2width as an unsigned integer. examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. const max = 2n ** 64n - 1n; bigint.asuintn(64, max); // ↪ 18446744073709551615n bigint.asuintn(64, max + 1n); // ↪ 0n // zero because of overflow specifications specification ...
BigInt.prototype.toLocaleString() - JavaScript
...
DataView - JavaScript
ss of the executing computer's endianness. var littleendian = (function() { var buffer = new arraybuffer(2); new dataview(buffer).setint16(0, 256, true /* littleendian */); // int16array uses the platform's endianness. return new int16array(buffer)[0] === 256; })(); console.log(littleendian); // true or false 64-bit integer values because javascript does not currently include standard support for 64-bit integer values, dataview does not offer native 64-bit operations. as a workaround, you could implement your own getuint64() function to obtain a value with precision up to number.max_safe_integer, which could suffice for certain cases. function getuint64(dataview, byteoffset, littleendian) { // split 64-bit number into two 32-bit (4-byte) parts const left = dataview.getuint32...
Date() constructor - JavaScript
datestring a string value representing a date, specified in a format recognized by the date.parse() method. (these formats are ietf-compliant rfc 2822 timestamps, and also strings in a version of iso8601.) note: parsing of date strings with the date constructor (and date.parse(), which works the same way) is strongly discouraged due to browser differences and inconsistencies. support for rfc 2822 format strings is by convention only. support for iso 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as utc, not local. individual date and time component values given at least a year and month, this form of date() returns a date object whose component values (year, month, day, hour, minute, second, and millisecond) all ...
Date.now() - JavaScript
the static date.now() method returns the number of milliseconds elapsed since january 1, 1970 00:00:00 utc. syntax var timeinms = date.now(); return value a number representing the milliseconds elapsed since the unix epoch. polyfill this method was standardized in ecma-262 5th edition. engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings. in firefox, the privacy.reducetimerprecision preference is enabled by default and defaults to 20µs in firefox 5...
Date.parse() - JavaScript
cross implementations. given a non-standard date string of "march 7, 2014", parse() assumes a local time zone, but given a simplification of the iso 8601 calendar date extended format such as "2014-03-07", it will assume a time zone of utc (es5 and ecmascript 2015). therefore date objects produced using those strings may represent different moments in time depending on the version of ecmascript supported unless the system is set with a local time zone of utc. this means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. examples using date.parse() the following calls all return 1546300800000. the first according to es5 will imply utc time, and the others are specifying utc timezone via the iso dat...
Date.prototype.toISOString() - JavaScript
pository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toisostring() return value a string representing the given date in the iso 8601 format according to universal time. polyfill this method was standardized in ecma-262 5th edition. ...
Date - JavaScript
get the number of seconds since the ecmascript epoch let seconds = math.floor(date.now() / 1000) in this case, it's important to return only an integer—so a simple division won't do. it's also important to only return actually ela...
Error.prototype.lineNumber - JavaScript
s the line number in the file that raised this error. examples using linenumber var e = new error('could not parse input'); throw e; console.log(e.linenumber) // 2 alternative example using error event window.addeventlistener('error', function(e) { console.log(e.linenumber); // 5 }); var e = new error('could not parse input'); throw e; this is not a standard feature and lacks widespread support. see the browser compatability table below. specifications not part of any standard. ...
Error - JavaScript
otherwise, old versions of babel and other transpilers will not correctly handle the following code without additional configuration. some browsers include the customerror constructor in the stack trace when using es2015 classes. ...
Function.prototype.apply() - JavaScript
milar outcome can be achieved using the array spread syntax. you can assign a different this object when calling an existing function. this refers to the current object (the calling object). with apply, you can write a method once, and then inherit it in another object, without having to rewrite the method for the new object. apply is very similar to call(), except for the type of arguments it supports. you use an arguments array instead of a list of arguments (parameters). with apply, you can also use an array literal, for example, func.apply(this, ['eat', 'bananas']), or an array object, for example, func.apply(this, new array('eat', 'bananas')). you can also use arguments for the argsarray parameter. arguments is a local variable of a function. it can be used for all unspecified argume...
Intl.Collator() constructor - JavaScript
hould be ignored. possible values are true and false; the default is false. numeric whether numeric collation should be used, such that "1" < "2" < "10". possible values are true and false; the default is false. this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence. implementations are not required to support this property. casefirst whether upper case or lower case should sort first. possible values are "upper", "lower", or "false" (use the locale's default); the default is "false". this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence. implementations are not required to support this property. ...
Intl.Collator - JavaScript
the intl.collator objects enable language sensitive string comparison. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.collator() creates a new collator object. static methods intl.collator.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object. intl.collator.prototype.resolvedoptions() returns a new object with properties reflecting...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
e locale and date and time formatting options computed during the initialization of the given datetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. calendar e.g. "gregory" numberingsystem the values requested using the unicode extension keys "ca" and "nu" or filled in as default values. timezone the value provided for this property in the options argument; undefined (representing the runtime's default time zone) if none was provided. warning: applications should not rely on undefined being ...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
locale and formatting options computed during the construction of the given displaynames object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("language"). its value is either "language", "region", "script", or "curren...
Intl.DisplayNames - JavaScript
translation of language, region and script display names. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.displaynames() creates a new intl.displaynames object. static methods intl.displaynames.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames. intl.displaynames.prototype.resolvedoptions() returns a n...
Intl​.List​Format​.prototype​.resolvedOptions() - JavaScript
e locale and formatting options computed during the construction of the given listformat object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("conjunction"). its value is either "conjunction", "disjunction", or "unit"...
Intl.ListFormat - JavaScript
structor for objects that enable language-sensitive list formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.listformat() creates a new listformat object. static methods intl.listformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list. intl.listformat.prototype.formattoparts() returns an array of objects representing the different co...
Intl.Locale.prototype.minimize() - JavaScript
t. syntax locale.minimize() return value a locale instance whose basename property returns the result of the remove likely subtags algorithm executed against locale.basename. description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename). this is useful when there are superfluous subtags in the language identifier; for instance, "en-latn" can be simplified to "en", since "latn" is the only script used to write english. minimize() only affects the main subtags that comprise the language identifier: language, script, and region subtags. other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the minimize() method. ...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
ecting the locale and number formatting options computed during the initialization of the given numberformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. numberingsystem the value provided for this properties in the options argument, if present, or the value requested using the unicode extension key "nu" or filled in as a default. notation the value provided for this property in the options argument, if present, or "standard filled in as a default. compactdisplay the value provided for this prope...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
lecting the locale and plural formatting options computed during the initialization of the given pluralrules object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralcategories an array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other". type the type used (cardinal or ordinal). only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values provided for th...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the locale and number formatting options computed during the initialization of the given relativetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the length of the internationalized message. possible values are: "long" (default, e.g., in 1 month) "short" (e.g., in 1 mo.), or "narrow" (e.g., in 1 mo.). the narrow style could be similar to the short style for some locales. numeric the format of output message. possible values are: "always" (default, e.g., 1 day ago), o...
Intl.RelativeTimeFormat - JavaScript
ive time formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.relativetimeformat.relativetimeformat() creates a new intl.relativetimeformat object. static methods intl.relativetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.relativetimeformat.prototype.format() formats a value and a unit according to the locale and formatting options of the given intl.relativetimeformat object. intl.relativetimeformat.prototype.formattoparts() return...
Math.fround() - JavaScript
d bit of the mantissa, and sets all following mantissa bits to 0. if the number is outside the range of a 32-bit float, infinity or -infinity is returned. because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the following function, if float32array are supported: math.fround = math.fround || (function (array) { return function(x) { return array[0] = x, array[0]; }; })(new float32array(1)); supporting older browsers is slower, but also possible: if (!math.fround) math.fround = function(arg) { arg = number(arg); // return early for ±0 and nan. if (!arg) return arg; var sign = arg < 0 ? -1 : 1; if (sign < 0) arg = -arg; // com...
Number.prototype.toExponential() - JavaScript
any digits as necessary to specify the number. return value a string representing the given number object in exponential notation with one digit before the decimal point, rounded to fractiondigits digits after the decimal point. exceptions rangeerror if fractiondigits is too small or too large. values between 0 and 20, inclusive, will not cause a rangeerror. implementations are allowed to support larger and smaller values as well. typeerror if this method is invoked on an object that is not a number. description if the fractiondigits argument is omitted, the number of digits after the decimal point defaults to the number of digits necessary to represent the value uniquely. if you use the toexponential() method for a numeric literal and the numeric literal has no exponent and no ...
Number.prototype.toFixed() - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numobj.tofixed([digits]) parameters digits optional the number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. if this argument is omitted, it is treated as 0. return value a string representing the given number using fixed-point notation. exceptions rangeerror if digits is too small or too large. values between 0 and 100, inclusive, will not cause a rangeerror. implementations are allowed to support larger and smaller values as chosen. typeerror if this method is i...
Number.prototype.toPrecision() - JavaScript
g in the description of the number.prototype.tofixed() method, which also applies to toprecision(). if the precision argument is omitted, behaves as number.prototype.tostring(). if the precision argument is a non-integer value, it is rounded to the nearest integer. exceptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown. implementations are allowed to support larger and smaller values as well. ecma-262 only requires a precision of up to 21 significant digits. examples using toprecision let numobj = 5.123456 console.log(numobj.toprecision()) // logs '5.123456' console.log(numobj.toprecision(5)) // logs '5.1235' console.log(numobj.toprecision(2)) // logs '5.1' console.log(numobj.toprecision(1)) // logs '5' numobj = 0.000123 console.l...
Object.assign() - JavaScript
e object.getownpropertydescriptor() and object.defineproperty() instead. both string and symbol properties are copied. in case of an error, for example if a property is non-writable, a typeerror is raised, and the target object is changed if any properties are added before the error is raised. note: object.assign() does not throw on null or undefined sources. ...
Object.prototype.constructor - JavaScript
child.prototype = object.create(parent.prototype) // re-define child prototype to parent prototype child.prototype.constructor = child // return original constructor to child but when do we need to perform the last line here? unfortunately, the answer is: it depends. let's try to define the cases in which re-assignment of the original constructor will play a major role, and when it will be one superfluous line of code. take the following case: the object has the create() method to create itself. function parent() { /* ... */ } function createdconstructor() { parent.call(this) } createdconstructor.prototype = object.create(parent.prototype) createdconstructor.prototype.create = function create() { return new this.constructor() } new createdconstructor().create().create() // typeer...
Object.freeze() - JavaScript
o make an object immutable, recursively freeze each property which is of type object (deep freeze). use the pattern on a case-by-case basis based on your design when you know the object contains no cycles in the reference graph, otherwise an endless loop will be triggered. an enhancement to deepfreeze() would be to have an internal function that receives a path (e.g. an array) argument so you can suppress calling deepfreeze() recursively when an object is in the process of being made immutable. you still run a risk of freezing an object that shouldn't be frozen, such as [window]. function deepfreeze(object) { // retrieve the property names defined on object var propnames = object.getownpropertynames(object); // freeze properties before freezing self for (let name of propnames) { ...
Object.getOwnPropertyDescriptors() - JavaScript
ll only copy enumerable and own properties from a source object to a target object, you are able to use this method and object.create() for a shallow copy between two unknown objects: object.create( object.getprototypeof(obj), object.getownpropertydescriptors(obj) ); creating a subclass a typical way of creating a subclass is to define the subclass, set its prototype to an instance of the superclass, and then define properties on that instance. this can get awkward especially for getters and setters. instead, you can use this code to set the prototype: function superclass() {} superclass.prototype = { // define your methods and properties here }; function subclass() {} subclass.prototype = object.create( superclass.prototype, { // define your methods and properties here }...
Object.isExtensible() - JavaScript
eractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.isextensible(obj) parameters obj the object which should be checked. return value a boolean indicating whether or not the given object is extensible. description 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. an object can be marked as non-extensible using object.preventextensions(), object.seal(), or object.freeze(). examples using object.isextensible // new objects are extensible. var empty = {}; object.isextensible(empty); // === true // ...but that can be changed. object.preventextensions(empty); object.isextensible(empty); // === false ...
Object.prototype.valueOf() - JavaScript
itself. you can use valueof within your own code to convert a built-in object into a primitive value. when you create a custom object, you can override object.prototype.valueof() to call a custom method instead of the default object method. overriding valueof for custom objects you can create a function to be called in place of the default valueof method. your function must take no arguments. suppose you have an object type mynumbertype and you want to create a valueof method for it. the following code assigns a user-defined function to the object's valueof method: mynumbertype.prototype.valueof = function() { return customprimitivevalue; }; with the preceding code in place, any time an object of type mynumbertype is used in a context where it is to be represented as a primitive value, ...
Object.values() - JavaScript
operty values are to be returned. return value an array containing the given object's own enumerable property values. description object.values() returns an array whose elements are the enumerable property values found on the object. the ordering of the properties is the same as that given by looping over the property values of the object manually. polyfill to add compatible object.values support in older environments that do not natively support it, you can find a polyfill in the tc39/proposal-object-values-entries or in the es-shims/object.values repositories. examples using object.values const obj = { foo: 'bar', baz: 42 }; console.log(object.values(obj)); // ['bar', 42] // array-like object const arraylikeobj1 = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.values(arraylikeob...
Object - JavaScript
-cutting and isn't always // on the same prototype chain, i want to modify object.prototype: object.prototype.valueof = function() { if (this.hasownproperty('-prop-value')) { return this['-prop-value']; } else { // it doesn't look like one of my objects, so let's fall back on // the default behavior by reproducing the current behavior as best we can. // the apply behaves like "super" in some other languages. // even though valueof() doesn't take arguments, some other hook may. return current.apply(this, arguments); } } since javascript doesn't exactly have sub-class objects, prototype is a useful workaround to make a “base class” object of certain functions that act as objects. for example: var person = function(name) { this.name = name; this.cantalk =...
Promise() constructor - JavaScript
the source for this interactive demo is stored in a github repository. if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new promise(executor) parameters executor a function to be executed by the constructor, during the process of constructing the promiseobj. the executor is custom code that ties an outcome to a promise. you, the programmer, write the executor. the signature of this function is expected to be: function(resolutionfunc, rejectionfunc){ // typically, some asynchronous operation. ...
Promise.any() - JavaScript
a single promise that resolves with the value from that promise. if no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an aggregateerror, a new subclass of error that groups together individual errors. essentially, this method is the opposite of promise.all(). warning! the promise.any() method is experimental and not fully supported by all browsers and platforms. it is currently in stage 4 of the tc39 process. syntax promise.any(iterable); parameters iterable an iterable object, such as an array. return value an already resolved promise if the iterable passed is empty. an asynchronously resolved promise if the iterable passed contains no promises. a pending promise in all other cases. this returned pro...
handler.set() - JavaScript
e set() method. this is bound to the handler. target the target object. property the name or symbol of the property to set. value the new value of the property to set. receiver the object to which the assignment was originally directed. this is usually the proxy itself. but a set() handler can also be called indirectly, via the prototype chain or various other ways. for example: suppose a script does obj.name = "jen", and obj is not a proxy, and has no own property .name, but it has a proxy on its prototype chain. that proxy's set() handler will be called, and obj will be passed as the receiver. return value the set() method should return a boolean value. return true to indicate that assignment succeeded. if the set() method returns false, and the assignment happe...
Reflect.construct() - JavaScript
lt is the same, there is one important difference in the process. when using object.create() and function.prototype.apply(), the new.target operator will point to undefined within the function used as the constructor, since the new keyword is not being used to create the object. when invoking reflect.construct(), on the other hand, the new.target operator will point to the newtarget parameter if supplied, or target if not. function oneclass() { console.log('oneclass') console.log(new.target) } function otherclass() { console.log('otherclass') console.log(new.target) } let obj1 = reflect.construct(oneclass, args) // output: // oneclass // function oneclass { ... } let obj2 = reflect.construct(oneclass, args, otherclass) // output: // oneclass // function oth...
RegExp.prototype[@@search]() - JavaScript
hod can be used in almost the same way as string.prototype.search(), except the different this and the different arguments order. var re = /-/g; var str = '2016-01-02'; var result = re[symbol.search](str); console.log(result); // 4 using @@search in subclasses subclass of regexp can override [@@search]() method to modify the behavior. class myregexp extends regexp { constructor(str) { super(str) this.pattern = str; } [symbol.search](str) { return str.indexof(this.pattern); } } var re = new myregexp('a+b'); var str = 'ab a+b'; var result = str.search(re); // string.prototype.search calls re[@@search]. console.log(result); // 3 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype[@@search]' in that specification. ...
RegExp() constructor - JavaScript
pattern[, flags]) parameters pattern the text of the regular expression. as of es5, this can also be another regexp object or literal (for the two regexp constructor notations only). patterns may include special characters to match a wider range of values than would a literal string. flags if specified, flags is a string that contains the flags to add. alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and lastindex will be reset to 0) (as of es2015). if flags is not specified and a regular expressions object is supplied, that object's flags (and lastindex value) will be copied over. flags may contain any combination of the following characters: g (global match) find all matches rather than stopping after...
RegExp - JavaScript
xpression object—for example, new regexp('ab+c')—results in runtime compilation of the regular expression. use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and obtain it from another source, such as user input. flags in constructor starting with ecmascript 6, new regexp(/ab+c/, 'i') no longer throws a typeerror ("can't supply flags when constructing one regexp from another") when the first argument is a regexp and the second flags argument is present. a new regexp from the arguments is created instead. when using the constructor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary. for example, the following are equivalent: let re = /\w+/ let re =...
String.prototype.match() - JavaScript
are returned, each its own element in the array. const str = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; const regexp = /[a-e]/gi; const matches_array = str.match(regexp); console.log(matches_array); // ['a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'] note: see also string.prototype.matchall() and advanced searching with flags. using named capturing groups in browsers which support named capturing groups, the following code captures "fox" or "cat" into a group named "animal": const paragraph = 'the quick brown fox jumps over the lazy dog. it barked.'; const capturingregex = /(?<animal>fox|cat) jumps over/; const found = paragraph.match(capturingregex); console.log(found.groups); // {animal: "fox"} using match() with no parameter const str = "nothing will come of no...
String.prototype.sub() - JavaScript
the sub() method creates a <sub> html element that causes a string to be displayed as subscript. syntax str.sub() return value a string containing a <sub> html element. description the sub() method embeds a string in a <sub> tag: "<sub>str</sub>". examples using sub() and sup() methods the following example uses the sub() and sup() methods to format a string: var supertext = 'superscript'; var subtext = 'subscript'; console.log('this is what a ' + supertext.sup() + ' looks like.'); // this is what a <sup>superscript</sup> looks like console.log('this is what a ' + subtext.sub() + ' looks like.'); // this is what a <sub>subscript</sub> looks like. specifications specification ecmascript (ecma-262)the definition of 'string.prototype.sub' in that specification...
String.prototype.substr() - JavaScript
cript, negative values of the start argument are not considered to refer to the end of the string. if length is omitted, substr() extracts characters to the end of the string. if length is undefined, substr() extracts characters to the end of the string. if length is a negative number, it is treated as 0. for both start and length, nan is treated as 0. polyfill microsoft's jscript does not support negative values for the start index. to use this feature in jscript, you can use the following code: // only run when the substr() function is broken if ('ab'.substr(-1) != 'b') { /** * get the substring of a string * @param {integer} start where to start the substring * @param {integer} length how many characters to return * @return {string} */ string.prototype...
Symbol() constructor - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax symbol([description]) parameters description optional a string. ...
TypedArray.prototype[@@iterator]() - JavaScript
the initial value of the @@iterator property is the same function object as the initial value of the values property. syntax arr[symbol.iterator]() return value the array iterator function, which is the values() function by default. ...
TypedArray.prototype.entries() - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.entries() return value a new array iterator object. ...
TypedArray.from() - JavaScript
ives them from the iterator, then sets its length at the end. when array.from() gets an array-like which isn't an iterator, it respects holes. typedarray.from() will ensure the result is dense. polyfill you can partially work around this by inserting the following code at the beginning of your scripts, allowing use of much of the functionality of from() in implementations that do not natively support it. if (!int8array.__proto__.from) { (function () { int8array.__proto__.from = function (obj, func, thisobj) { var typedarrayclass = int8array.__proto__; if(typeof this !== 'function') { throw new typeerror('# is not a constructor'); } if (this.__proto__ !== typedarrayclass) { throw new typeerror('th...
TypedArray.prototype.join() - JavaScript
(","). return value a string with all array elements joined. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!uint8array.prototype.join) { object.defineproperty(uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples using join var uint8 = new uint8array([1,2,3]); uint8.join(); // '1,2,3' uint8.join(' / '); // '1 / 2 / 3' uint8.join(''); // '123' specifications specification ecmascript (ecma-26...
TypedArray.prototype.keys() - JavaScript
ractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.keys() return value a new array iterator object. ...
TypedArray.prototype.reduce() - JavaScript
o contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.reduce(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. description the re...
TypedArray.prototype.reduceRight() - JavaScript
ngle value. this method has the same algorithm as array.prototype.reduceright(). typedarray is one of the typed array types here. syntax typedarray.reduceright(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon. initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. description the re...
TypedArray.prototype.slice() - JavaScript
the other typed array is not affected. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. if (!uint8array.prototype.slice) { object.defineproperty(uint8array.prototype, 'slice', { value: function (begin, end) { return new uint8array(array.prototype.slice.call(this, begin, end)); } }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples return a portion of an existing typed array const uint8 = new uint8array([1,2,3]); uint8.slice(1); // uint8array [ 2, 3 ] uint8.slice(2); // uint8array [ 3 ] uint8.slice(-2); // uint8array [ 2, 3 ] uint8.
TypedArray.prototype.some() - JavaScript
ion. some does not mutate the typed array on which it is called. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some if (!uint8array.prototype.some) { object.defineproperty(uint8array.prototype, 'some', { value: array.prototype.some }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples testing size of all typed array elements the following example tests whether any element in the typed array is bigger than 10. function isbiggerthan10(element, index, array) { return element > 10; } new uin...
TypedArray.prototype.toString() - JavaScript
ommas. for example, the following code creates a typed array and uses tostring to convert the array to a string. var numbers = new uint8array([2, 5, 8, 1, 4]) numbers.tostring(); // "2,5,8,1,4" javascript calls the tostring method automatically when a typed array is to be represented as a text value or when an array is referred to in a string concatenation. compatibility if a browser doesn't support the typedarray.prototype.tostring() method yet, javascript will call the tostring method of object: var numbers = new uint8array([2, 5, 8, 1, 4]) numbers.tostring(); // "[object uint8array]" specifications specification ecmascript (ecma-262)the definition of 'array.prototype.tostring' in that specification. ...
TypedArray.prototype.values() - JavaScript
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.values() return value a new array iterator object. ...
TypedArray - JavaScript
ays constructors inherit common properties from the %typedarray% constructor function. additionally, all typed array prototypes (typedarray.prototype) have %typedarray%.prototype as their [[prototype]]. the %typedarray% constructor on its own is not particularly useful. calling it or using it in a new expression will throw a typeerror, except when used during object creation in js engines that support subclassing. there are at present no such engines, so %typedarray% is only useful to polyfill functions or properties onto all typedarray constructors. when creating an instance of a typedarray (e.g. int8array), an array buffer is created internally in memory or, if an arraybuffer object is given as constructor argument, then this is used instead. the buffer address is saved as an internal...
eval() - JavaScript
he string represents an expression, eval() evaluates the expression. if the argument represents one or more javascript statements, eval() evaluates the statements. do not call eval() to evaluate an arithmetic expression; javascript evaluates arithmetic expressions automatically. if you construct an arithmetic expression as a string, you can use eval() to evaluate it at a later time. for example, suppose you have a variable x. you can postpone evaluation of an expression involving x by assigning the string value of the expression, say "3 * x + 2", to a variable, and then calling eval() at a later point in your script. if the argument of eval() is not a string, eval() returns the argument unchanged. in the following example, the string constructor is specified and eval() returns a string obje...
Standard built-in objects - JavaScript
object. they include the basic error type, as well as several specialized error types. error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers and dates these are the base objects representing numbers, dates, and mathematical calculations. number bigint math date text processing these objects represent strings and support manipulating them. string regexp indexed collections these objects represent collections of data which are ordered by an index value. this includes (typed) arrays and array-like constructs. array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections these object...
Iteration protocols - JavaScript
{ value: 'bye', done: (this._first = false) } : { ...
Lexical grammar - JavaScript
nt to run scripts directly from shell. you must only use the #! comment style to specify a javascript interpreter. in all other cases just use a // comment (or mulitiline comment). keywords reserved keywords as of ecmascript 2015 break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield future reserved keywords the following are reserved as future keywords by the ecmascript specification. they have no special functionality at present, but they might at some future time, so they cannot be used as identifiers. these are always reserved: enum the following are only reserved when they are found in strict mod...
Comma operator (,) - JavaScript
teractive-examples and send us a pull request. syntax expr1, expr2, expr3... parameters expr1, expr2, expr3... one or more expressions, the last of which is returned as the value of the compound expression. usage notes you can use the comma operator when you want to include multiple expressions in a location that requires a single expression. the most common usage of this operator is to supply multiple parameters in a for loop. the comma operator is fully different from the comma within arrays, objects, and function arguments and parameters. examples if a is a 2-dimensional array with 10 elements on each side, the following code uses the comma operator to increment i and decrement j at once. the following code prints the values of the diagonal elements in the array: for (var i ...
Destructuring assignment - JavaScript
}); in the function signature for drawchart above, the destructured left-hand side is assigned to an empty object literal on the right-hand side: {size = 'big', coords = {x: 0, y: 0}, radius = 25} = {}. you could have also written the function without the right-hand side assignment. however, if you leave out the right-hand side assignment, the function will look for at least one argument to be supplied when invoked, whereas in its current form, you can simply call drawchart() without supplying any parameters. the current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function. nested object and array destructuring const metadata = { title: 'scratchpad', translat...
Operator precedence - JavaScript
if op1 and op2 have different precedence levels (see the table below), the operator with the highest precedence goes first and associativity does not matter. observe how multiplication has higher precedence than addition and executed first, even though addition is written first in the code. console.log(3 + 10 * 2); // logs 23 console.log(3 + (10 * 2)); // logs 23 because parentheses here are superfluous console.log((3 + 10) * 2); // logs 26 because the parentheses change the order left-associativity (left-to-right) means that it is processed as (a op1 b) op2 c, while right-associativity (right-to-left) means it is interpreted as a op1 (b op2 c). assignment operators are right-associative, so you can write: a = b = 5; // same as writing a = (b = 5); with the expected result that a an...
Unary plus (+) - JavaScript
cription although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not perform any other operations on the number. it can convert string representations of integers and floats, as well as the non-string values true, false, and null. integers in both decimal and hexadecimal (0x-prefixed) formats are supported. negative numbers are supported (though not for hex). using the operator on bigint values throws a typeerror. if it cannot parse a particular value, it will evaluate to nan. examples usage with numbers const x = 1; const y = -1; console.log(+x); // 1 console.log(+y); // -1 usage with non-numbers +true // 1 +false // 0 +null // 0 +function(val){ return val } // nan +1n // throws t...
delete operator - JavaScript
te variable1); // true // syntaxerror in strict mode. console.log(delete variable2); // false function func(param) { // syntaxerror in strict mode. console.log(delete param); // false } // syntaxerror in strict mode. console.log(delete func); // false cross-browser notes although ecmascript makes iteration order of objects implementation-dependent, it may appear that all major browsers support an iteration order based on the earliest added property coming first (at least for properties not on the prototype). however, in the case of internet explorer, when one uses delete on a property, some confusing behavior results, preventing other browsers from using simple objects like object literals as ordered associative arrays. in explorer, while the property value is indeed set to undefin...
typeof - JavaScript
/ 'number wisen' typeof (idata + ' wisen'); // 'string' regular expressions callable regular expressions were a non-standard addition in some browsers. typeof /s/ === 'function'; // chrome 1-12 non-conform to ecmascript 5.1 typeof /s/ === 'object'; // firefox 5+ conform to ecmascript 5.1 errors before ecmascript 2015, typeof was always guaranteed to return a string for any operand it was supplied with. even with undeclared identifiers, typeof will return 'undefined'. using typeof could never generate an error. but with the addition of block-scoped let and statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a referenceerror. block scoped variables are in a "temporal dead zone" from the start of the block...
Expressions and operators - JavaScript
ntax. ( ) grouping operator. left-hand-side expressions left values are the destination of an assignment. property accessors member operators provide access to a property or method of an object (object.property and object["property"]). new the new operator creates an instance of a constructor. new.target in constructors, new.target refers to the constructor that was invoked by new. super the super keyword calls the parent constructor. ...obj spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected. increment and decrement postfix/prefix increment and postfix/prefix decrement operators. a++ postfix increment operator. a-- postfix decrement operator. ++a prefix in...
switch - JavaScript
take a look at this example: const action = 'say_hello'; switch (action) { case 'say_hello': let message = 'hello'; console.log(message); break; case 'say_hi': let message = 'hi'; console.log(message); break; defaul...
with - JavaScript
in object. consider this example: function f(foo, values) { with (foo) { console.log(values); } } if you call f([1,2,3], obj) in an ecmascript 5 environment, then the values reference inside the with statement will resolve to obj. however, ecmascript 2015 introduces a values property on array.prototype (so that it will be available on every array). so, in a javascript environment that supports ecmascript 2015, the values reference inside the with statement could resolve to [1,2,3].values. however, in this particular example, array.prototype has been defined with values in its symbol.unscopables object. if it were not, one can see how this would be a difficult issue to debug. examples using with the following with statement specifies that the math object is the default object. ...
JavaScript reference - JavaScript
for for each...in for...in for...of for await...of while other debugger import label with expressions and operators javascript expressions and operators. ...
JavaScript shells - JavaScript
javascript shell enhanced by perl. can use perl modules directly from javascript: dbi for database integration, gtk2 for gui apps, posix for system programming, etc. the best of cpan now for javascript programmers. shelljs - portable unix shell commands for node.js list of javascript shells the following javascript shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a command line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based repl for experimenting with future javascript. es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript c...
categories - Web app manifests
there is no standard list of possible values, but the w3c maintains a list of known categories. note: categories are used only as hints for catalogs or stores listing web applications. like search engines and meta keywords, catalogs and stores are free to ignore them. note: categories values are lower-cased by the stores and catalogs before processing, so "news" and "news" are treated as the same value. ...
icons - Web app manifests
ng values: member description sizes a string containing space-separated image dimensions. src the path to the image file. if src is a relative url, the base url will be the url of the manifest. type a hint as to the media type of the image. the purpose of this member is to allow a user agent to quickly ignore images with media types it does not support. purpose defines the purpose of the image, for example if the image is intended to serve some special purpose in the context of the host os (i.e., for better integration). purpose can have one or more of the following values, separated by spaces: monochrome: a user agent can present this icon where a monochrome icon with a solid fill is needed. the color infor...
Web app manifests
}] } deploying a manifest web app manifests are deployed in your html pages using a <link> element in the <head> of a document: <link rel="manifest" href="/manifest.webmanifest"> note: the .webmanifest extension is specified in the media type registration section of the specification (the response of the manifest file should return content-type: application/manifest+json). browsers generally support manifests with other appropriate extensions like .json (content-type: application/json). note: if the manifest requires credentials to fetch - the crossorigin attribute must be set to use-credentials, even if the manifest file is in the same origin as the current page. splash screens in chrome 47 and later, a splash screen is displayed for sites launched from a homescreen. this splashsc...
<mfenced> - MathML
use the <mrow> and <mo> elements instead. attributes class, id, style provided for use with stylesheets. close a string for the closing delimiter. the default value is ")" and any white space is trimmed. ...
<mglyph> - MathML
Web › MathML › Element › mglyph
class, id, style provided for use with stylesheets. ...
<mo> - MathML
Web › MathML › Element › mo
hed ; Ł…Ų«Ų§Ł„ maxsize if stretchy is true, this attribute specifies the maximum size of the operator. allowed values are: infinity an arbitrary length minsize if stretchy is true, this attribute specifies the minimum size of the operator. allowed values are: infinity an arbitrary length movablelimits specifies whether attached under- and overscripts move to sub- and superscript positions when displaystyle is false. allowed values are either true or false. rspace the amount of space after the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. separator there is no visual effect for this attribute, but it specifies whether the operator is a separator (such as commas). allowed values are true or false. stre...
Recommended Web Performance Timings: How long is too long? - Web Performance
ile 3g network and 1.5 seconds on an office t1 line, with even more ambitious page load goals for subsequent page loads, leveraging service workers and caching. there are different suggested times for initially loading the page versus loading additional assets, responding to user interaction, and ensuring smooth animations: idling goal browsers are single threaded (though background threads are supported for web workers). this means that user interaction, painting, and script execution are all on the same thread. if the thread is busy doing complex javascript execution, the main thread will not be available to react to user input, such as pressing a button. for this reason, script execution should be limited in scope, divided into chunks of code that can be executed in 50ms or less. this ma...
Lazy loading - Web Performance
y"></iframe> the load event fires when the eagerly-loaded content has all been loaded; at that time, it's entirely possible (or even likely) that there may be lazily-loaded images that are within the visual viewport that haven't yet loaded. you can determine if a given image has finished loading by examining the value of its boolean complete property. polyfill include this polyfill to provide support for older and currently incompatible browsers: loading-attribute-polyfill intersection observer api intersection observers allow the user to know when an observed element enters or exits the browser’s viewport. event handlers when browser compatibility is crucial, there are a few options: polyfill intersection observer fallback to scroll, resize or orientation change event handlers...
Optimizing startup performance - Web Performance
ribute on script tags needed by the web application. this allows html parsers to continue processing the document, instead of having to wait until the scripts have been downloaded and executed before continuing. if you need to decode asset files (for example, decoding jpeg files and turning them into raw texture data for later use by webgl), that's great to do in workers. when dealing with data supported by the browser (for example, decoding image data), use the decoders built into the browser or device rather than rolling your own or using one from the original codebase. the provided one is almost certainly significantly faster, and will reduce your app size to boot. in addition, the browser may automatically parallelize these decoders. any data processing that can be done in parallel sho...
Using dns-prefetch - Web Performance
k rel="dns-prefetch" href="https://fonts.gstatic.com/"> note: if a page needs to make connections to many third-party domains, preconnecting them all is counterproductive. the preconnect hint is best used for only the most critical connections. for the others, just use <link rel="dns-prefetch"> to save time on the first step — the dns lookup. the logic behind pairing these hints is because support for dns-prefetch is better than support for preconnect. browsers that don’t support preconnect will still get some added benefit by falling back to dns-prefetch. because this is an html feature, it is very fault-tolerant. if a non-supporting browser encounters a dns-prefetch hint—or any other resource hint—your site won’t break. you just won’t receive the benefits it provides. some...
Privacy, permissions, and information security
this is the...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
you may specify svg in styles either within the same document or an external style sheet. there are 3 properties you can use: mask, clip-path, and filter. note: references to svg in external files must be to the same origin as the referencing document. using embedded svg to apply an svg effect using css styles, you first need to create the css style that references the svg to apply. <style>p { mask: url(#my-mask); }</style> in the above example, all paragraphs are masked by an svg <mask> with the id my-mask. ...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
dextensions requiredfeatures systemlanguage attributes externalresourcesrequired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element. value: false|true; animatable: no requiredextensions list all the browser specific capabilities that must be supported by the borwser to be allowed to render the associated element. value: a list of space-separated uri; animatable: no requiredfeatures deprecated since svg 2 list all the features, as defined is the svg 1.1 specification, that must be supported by the borwser to be allowed to render the associated element.. value: a list of space-separated uri; animatable: no systemlanguage indicates wh...
SVG Core Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Core
ge to html's lang, but in conforming xml 1.0 documents, it does not allow the use of a null attribute value (xml:lang="") to indicate an unknown language. instead, use xml:lang="und". svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no xml:space deprecated since svg 2 svg supports the standard xml attribute xml:space to specify the handling of white space characters within a given <text> element's character data. note: instead of using the xml:space attribute you should use the white-space css property. value: default | preserve; animatable: no ...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
es how an object is aligned along the font baseline with respect to its parent. value: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. value: auto|baseline|super|sub|<percentage>|<length>|inherit; animatable: yes clip deprecated it defines what portion of an element is visible. value: auto|<shape()>|inherit; animatable: yes clip-path it binds the element it is applied to with a given <clippath> element. value: none|<funciri>|inherit; animatable: yes clip-rule it indicates how to determine what side of a path is inside a shape in order to know ho...
accumulate - SVG: Scalable Vector Graphics
matecolor>, <animatemotion>, and <animatetransform> usage notes value none | sum default value none animatable no sum specifies that each repeat iteration after the first builds upon the last value of the previous iteration. none specifies that repeat iterations are not cumulative. this attribute is ignored if the target attribute value does not support addition, or if the animation element does not repeat. this attribute will be ignored if the animation function is specified with only the to attribute. specifications specification status comment svg animations level 2the definition of 'accumulate' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)...
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
nimation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should begin. the animation start time is defined relative to the time that the specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, u...
contentStyleType - SVG: Scalable Vector Graphics
specifies a media type, per mime part two: media types [rfc2046]. usage notes value one of the content types specified in the media types default value text/css animatable no since css is the only widely deployed style sheet language for online styling and it's already defined as default value if contentstyletype is ommitted, the attribute is not well supported in user agents. if other style sheet languages become more popular they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute. the use of contentstyletype is therefore deprecated. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the defin...
cursor - SVG: Scalable Vector Graphics
Web › SVG › Attribute › cursor
as a presentation attribute, it also can be used as a property directly inside a css stylesheet, see css cursor for further information. ...
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
ed animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should end. the animation end time is defined relative to the time that the specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, ...
fill-opacity - SVG: Scalable Vector Graphics
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exp...
font-size-adjust - SVG: Scalable Vector Graphics
<number> choose the size of the font so that its lowercase letters (as determined by the x-height of the font) are the specified number times the font-size. the number specified should generally be the aspect ratio (ratio of x-height to font size) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text). specifications specification status comment css fonts module level 3the definition of 'font-size-adjust' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'font-size-adjust' in that specification. recomm...
href - SVG: Scalable Vector Graphics
Web › SVG › Attribute › href
icular, see smil animation: specifying the animation target. value <url> default value none animatable no discard for <discard>, href defines a url referring the target element to discard. see the definition of href on animation elements for details on identifying a target element. note: unlike other animation elements, the <discard> element does not support the deprecated xlink:href attribute. note that if the target element is not part of the current svg document fragment, then whether the target element will be removed or not is defined by the host language. if the href attribute is not provided, then the target element will be the immediate parent element of the <discard> element. value <url> default value none ...
in - SVG: Scalable Vector Graphics
Web › SVG › Attribute › in
ents the value of the stroke property on the target element for the filter effect. in many cases, the strokepaint is opaque everywhere, but that might not be the case if a shape is painted with a gradient or pattern which itself includes transparent or semi-transparent parts. <filter-primitive-reference> this value is an assigned name for the filter primitive in the form of a <custom-ident>. if supplied, then graphics that result from processing this filter primitive can be referenced by an in attribute on a subsequent filter primitive within the same filter element. if no value is provided, the output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute. workaround for backgroundimage inste...
requiredExtensions - SVG: Scalable Vector Graphics
tified by an url reference. usage notes value <list-of-extensions> default value none animatable no <list-of-extensions> the value is a list of references (iri references in svg 1, url references in svg 2) which identify the required extensions, with the individual values separated by white space. determines whether all of the named extensions are supported by the user agent. if all of the given extensions are supported, then the attribute evaluates to true; otherwise, the current element and its children are skipped and thus will not be rendered. note: if a given extension reference contains white space within itself, that white space must be escaped. requiredextensions is often used in conjunction with the <switch> element. if the attribu...
result - SVG: Scalable Vector Graphics
Web › SVG › Attribute › result
if no value is provided, the output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute. ...
stroke-opacity - SVG: Scalable Vector Graphics
it's important to know that the stroke partially covers the fill of a shape, so a stroke with an opacity different than 1 will partially show the fill underneath. to avoid this effect, it is possible to apply a global opacity with the opacity attribute or to put the ...
systemLanguage - SVG: Scalable Vector Graphics
this list is matched against the language defined in the user preferences. ...
target - SVG: Scalable Vector Graphics
Web › SVG › Attribute › target
is replaced by the linked content, if it exists and can be securely accessed from this document. _top the content of the full active window or tab is replaced by the linked content, if it exists and can be securely accessed from this document _blank a new un-named window or tab is requested for the display of the linked content, if this document can securely do so. if the user agent does not support multiple windows/tabs, the result is the same as _top. <xml-name> specifies the name of the browsing context (tab, inline frame, object, etc.) for display of the linked content. if a context with this name already exists, and can be securely accessed from this document, it is re-used, replacing the existing content. if it does not exist, it is created (the same as '_blank', except that it n...
xml:space - SVG: Scalable Vector Graphics
child elements inside an element may also have an xml:space attribute that overrides the parentʼs one. note: instead of using the xml:space attribute, use the white-space css property. this attribute influences how browsers parse text content and therefore changes the way the dom is built. therefore, changing this attributeʼs value through the dom api may have no effect. all elements are using this attribute. ...
zoomAndPan - SVG: Scalable Vector Graphics
panning represents a translation (i.e., a shift) transformation on an svg document fragment in response to a user interface action. ...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
svg elements can be modified using attributes that specify details about exactly how the element should be handled or rendered. below is a list of all of the attributes available in svg along with links to reference documentation to help you learn which elements support them and how they work. svg attributes a to z a accent-height accumulate 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 contentscripttype contentstyletype cursor cx cy d d decelera...
Compatibility sources - SVG: Scalable Vector Graphics
vg_in_firefox together with its revision history for firefox http://www.webkit.org/projects/svg/status.xml together with its recorded archive for webkit, safari and chrome http://www.opera.com/docs/specs/opera9/svg/ and accompanying pages for opera >= 9, http://www.opera.com/docs/specs/opera8/ for opera 8 http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx for hints on ie9 support status the svg support charts at codedread.com for basic checks against the w3c test suite wikipedia for basic hints, not normative ...
<a> - SVG: Scalable Vector Graphics
Web › SVG › Element › a
> ; default value: none; animatable: yes hreflang the human language of the url or url fragment that the hyperlink points to. value type: <string> ; default value: none; animatable: yes ping a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. for a more widely-supported feature addressing the same use cases, see navigator.sendbeacon(). value type: <list-of-urls> ; default value: none; animatable: no referrerpolicy which referrer to send when fetching the url. value type: no-referrer|no-referrer-when-downgrade|same-origin|origin|strict-origin|origin-when-cross-origin|strict-origin-when-cross-origin|unsafe-url ; default value: none; animatable: no rel...
<altGlyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › altGlyph
is on the position of the element. value type: <list-of-coordinates> ; default value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element. value type: <list-of-coordinates> ; default value: relative y-coordinate of ancestor <text> or <tspan>; animatable: yes rotate this attribute defines the supplemental rotation that will be applied to the element. value type: <list-of-numbers> ; default value: none; animatable: yes (non-additive) glyphref the glyph identifier, the format of which is dependent on the format defined by the format attribute of the given font. value type: <string> ; default value: none; animatable: no format the format of the given font. value type: <string> ; defau...
<cursor> - SVG: Scalable Vector Graphics
Web › SVG › Element › cursor
s element. the <cursor> svg element can be used to define a platform-independent custom cursor. a recommended approach for defining a platform-independent custom cursor is to create a png image and define a cursor element that references the png image and identifies the exact position within the image which is the pointer position (i.e., the hot spot). the png format is recommended because it supports the ability to define a transparency mask via an alpha channel. if a different image format is used, this format should support the definition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). if the transparency mask can be determined, the mask defines the shape of the cursor; otherwise, the cursor is an opaque ...
<discard> - SVG: Scalable Vector Graphics
Web › SVG › Element › discard
nning documents. the <discard> element may occur wherever the <animate> element may. usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<script> attributes global attributes conditional processing attributes core attributes aria attributes specific attributes begin href (but note that <discard> has never supported xlink:href) specifications specification status comment svg animations level 2the definition of '<discard>' in that specification. editor's draft initial definition ...
<feConvolveMatrix> - SVG: Scalable Vector Graphics
divisor" represents the value of the ‘divisor’ attribute, and "bias" represents the value of the ‘bias’ attribute. note in the above formulas that the values in the kernel matrix are applied such that the kernel matrix is rotated 180 degrees relative to the source and destination images in order to match convolution theory as described in many computer graphics textbooks. ...
<image> - SVG: Scalable Vector Graphics
Web › SVG › Element › image
animated gif behavior is undefined. svg files displayed with <image> are treated as an image: external resources aren't loaded, :visited styles aren't applied, and they cannot be interactive. to include dynamic svg elements, try <use> with an external url. to include svg files and run scripts inside them, try <object> inside of <foreignobject>. note: the html spec defines <image> as a synonym for <img> while parsing html. ...
<script> - SVG: Scalable Vector Graphics
Web › SVG › Element › script
the svg script element allows to add scripts to an svg document. ...
<set> - SVG: Scalable Vector Graphics
Web › SVG › Element › set
for attributes that can be reasonably be interpolated, the <animate> is usualy prefered. note: the <set> element is non-additive. the additive and accumulate attributes are not allowed, and will be ignored if specified. ...
Namespaces crash course - SVG: Scalable Vector Graphics
as an xml dialect, svg is namespaced. it is important to understand the concept of namespaces and how they are used if you plan to author svg content. versions of svg viewers prior to the release of firefox 1.5 unfortunately paid scant attention to namespaces, but they are essential to multi-xml dialect supporting user agents such as gecko-based browsers which must be very strict. take some time to understand namespaces now and it will save you all sorts of headaches in the future. background it has been a long standing goal of the w3c to make it possible for different types of xml based content to be mixed together in the same xml file. for example, svg and mathml might be incorporated directly into an xhtml based scientific document. being able to mix content types like this has m...
SVG animation with SMIL - SVG: Scalable Vector Graphics
smil allows you to: animate the numeric attributes of an element (x, y, ...) animate transform attributes (translation or rotation) animate color attributes follow a motion path this is done adding an svg element like <animate> inside the svg element to animate. below are examples for the four different ways. ...
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well. embedding raster images much like the img element in html svg has an image element to serve the same purpose. you can use it to embed arbitrary raster (and vector) images. the specification requests applications to support at least png, jpeg and svg format files. the embedded picture becomes a normal svg element. this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" transform="rotate(45)" ...
Positions - SVG: Scalable Vector Graphics
can also be rotated, skewed and flipped. the default user coordinate system maps one user pixel to one device pixel. (however, the device may decide, what it understands as one pixel.) lengths in the svg file with specific dimensions, like "in" or "cm", are then calculated in a way that makes them appear 1:1 in the resulting image. a quote from the svg 1.1 specification illustrates this: [...] suppose that the user agent can determine from its environment that "1px" corresponds to "0.2822222mm" (i.e., 90dpi). then, for all processing of svg content: [...] "1cm" equals "35.43307px" (and therefore 35.43307 user units) « previousnext » ...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
e invalid attribute on the <body>, and a style rule changes the gradient end-stop color to red. ...
SVG: Scalable Vector Graphics
Web › SVG
ly asked questions regarding svg and mozilla svg as an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is accessible from javascript. this allows developers to create rich animations and interactive images. some real eye-candy svg at svg-wow.org firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html transformations using svg's foreignobject mapping, charting, games & 3d experiments while a little svg can go a long way to enhanced web content, here are some examples of heavy svg usage. connect 4 jvectormap (interactive maps for data visualization) jointjs (javascript diagramming library) d3 ( javascript library for visualizing data with html...
How to turn off form autocompletion - Web security
e user to choose a master password that the browser will use to encrypt stored login details. even without a master password, in-browser password management is generally seen as a net gain for security. since users do not have to remember passwords that the browser stores for them, they are able to choose stronger passwords than they would otherwise. for this reason, many modern browsers do not support autocomplete="off" for login fields: if a site sets autocomplete="off" for a <form>, and the form includes username and password input fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page. if a site sets autocomplete="off" for username and password <input> fields, then the browse...
Securing your site - Web security
a number of things you can do to help secure your site. this article offers an assortment of suggestions, as well as links to other articles providing more useful information. note: this article is a work in progress, and is neither complete nor does following its suggestions guarantee your site will be fully secure. user information security how to turn off form autocompletion form fields support autocompletion in gecko; that is, their values can be remembered and automatically brought back the next time the user visits your site. for certain types of data, you may wish to disable this feature. privacy and the :visited selector this article discusses changes made to the getcomputedstyle() method that eliminates the ability for malicious sites to figure out the user's browsing histor...
Subdomain takeovers - Web security
se box (dns) to prevent the outlet from being used by someone else. how do they happen? if the process of provisioning or deprovisioning (removing) a virtual host is not handled properly, there can be an opportunity for an attacker to take over a subdomain. during provisioning an attacker sets up a virtual host for a subdomain name you bought on the hosting provider, before you get to do it. suppose you control the domain example.com. you want to add a blog at blog.example.com, and you decide to use a hosting provider who maintains a blogging platform. (for "blog", you can substitute "e-commerce platform", "customer service platform", or any other "cloud-based" virtual hosting scenario.) the process you go through might look like this: you register the name "blog.example.com" with a d...
Types of attacks - Web security
ected value. if there is a mismatch, the request should be aborted. this method of protection relies on an attacker being unable to predict the user's assigned csrf token. the token should be regenerated on sign-in. cookies that are used for sensitive actions (such as session cookies) should have a short lifetime with the samesite attribute set to strict or lax. (see samesite cookies above). in supporting browsers, this will have the effect of ensuring that the session cookie is not sent along with cross-site requests and so the request is effectively unauthenticated to the application server. both csrf tokens and samesite cookies should be deployed. this ensures all browsers are protected and provides protection where samesite cookies cannot help (such as attacks originating from a separa...
Weak signature algorithms - Web security
he certificate. this article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. weaknesses in hash algorithms can lead to situations in which attackers can create or obtain fraudulent certificates. as new attacks are found and improvements in available technology make attacks more feasible, the use of older algorithms is discouraged and support for them is eventually removed. sha-1 sha-1 certificates will no longer be treated as secure by major browser manufacturers beginning in 2017. certificates employing more secure hash algorithms (such as sha-256 or sha-512) should be used instead. md5 support for md5 based signatures was removed in early 2012. ...
namespace - XPath
Web › XPath › Axes › namespace
in this case, the context node must be an element node. ...
document - XPath
n concatenated into a single node-set. other specific conditions exist with specified behaviors. see the xslt 1.0 documentation for details. since the uri is relative to the xsl document, document("") would return the root node of the current document. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.1 gecko support supported. ...
element-available - XPath
for the expression. returns returns true if and only if the expanded-name is the name of an instruction. if the expanded-name has a namespace uri equal to the xslt namespace uri, then it refers to an element defined by xslt. otherwise, it refers to an extension element. if the expanded-name has a null namespace uri, the element-available function will return false. defined xslt 1.0 15 gecko support supported. ...
generate-id - XPath
e will be used. returns a string containing the generated id. notes the same id must be generated every time for the same node in the current document in the current transformation. the generated id may not be the same in subsequent transformations. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.4 gecko support supported. ...
key - XPath
Web › XPath › Functions › key
the xsl:key element to be used. value the returned node-set will contain every node that has this value for the given key. returns a node set. notes the xsl:key element defines what attribute on what given elements will be used to match the key. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.2 gecko support supported. ...
name - XPath
Web › XPath › Functions › name
a given node-set. syntax name( [node-set] ) arguments node-set (optional) the qname of the first node in this node-set will be returned. if this argument is omitted, the current context node will be used. returns a string representing the qname of a node. notes the qname is the node's qualified name, including its namespace prefix and its local name. defined xpath 1.0 4.1 gecko support supported. ...
number - XPath
his pattern, then the string is converted to nan. boolean true is converted to 1. false is converted to 0. a node-set is first converted to a string as if by a call to the string() function and then converted in the same way as a string argument. an object of a type other than the four basic types is converted to a number in a way that is dependent on that type. defined xpath 1.0 4.4 gecko support supported. ...
position - XPath
e path. <xsl:template match="//a[position() = 5]"> <!-- this template matches the fifth a element anywhere in the document. --> </xsl:template> <xsl:template match="//div[@class='foo']/bar[position() = 1]"> <!-- this template matches the first bar element that is a child of a div element with a class attribute equal to "foo" --> </xsl:template> defined xpath 1.0 4.1 gecko support supported. ...
string - XPath
ero is converted to the string 0. positive infinity is converted to the string infinity. negative infinity is converted to the string -infinity. decimal numbers between -1 and 1 are converted to a string with a single leading 0 before the decimal point. boolean true is converted to the string true. boolean false is converted to the string false. defined xpath 1.0 4.2 gecko support supported. ...
substring-after - XPath
le the substring to search for. everything after the first occurrence ofneedle inhaystack will be returned. returns a string. examples xpath example output substring-after('aa-bb','-') bb substring-after('aa-bb','a') a-bb substring-after('aa-bb','b') b substring-after('aa-bb','q') (empty string) defined xpath 1.0 4.2 gecko support supported. ...
substring-before - XPath
to search for. everything before the first occurrence ofneedle inhaystack will be returned. returns a string. examples xpath example output substring-before('aa-bb','-') aa substring-before('aa-bb','a') (empty string) substring-before('aa-bb','b') aa- substring-before('aa-bb','q') (empty string) defined xpath 1.0 4.2 gecko support supported. ...
substring - XPath
e. start the position withinstring the substring begins length(optional) the length of the substring. if omitted, the returned string will contain every character from thestart position to the end ofstring. returns a string. notes as in other xpath functions, the position is not zero-based. the first character in the string has a position of 1, not 0. defined xpath 1.0 4.2 gecko support supported. ...
translate - XPath
output the quick brown fox. if abc is longer than xyz, then every occurrence of characters in abc that do not have a corresponding character in xyz will be removed. example <xsl:value-of select="translate('the quick brown fox.', 'brown', 'red')" /> output the quick red fdx. if xyz contains more characters than abc, the extra characters are ignored. defined xpath 1.0 4.2 gecko support supported. ...
unparsed-entity-url - XPath
ata referenced in the dtd of the source document. syntax string unparsed-entity-url(string) arguments the name of the unparsed entity. if the argument is not a string, it is converted using the rules of the string() function. the name should be an xml name. returns the uri of the unparsed entity retrieved from the dtd, if it exists. otherwise an empty string. defined xslt 1.0 12.4 gecko support not supported. ...
Index - XPath
Web › XPath › Index
h the following axis indicates all the nodes that appear after the context node, except any descendant, attribute, and namespace nodes. 10 following-sibling axe, xpath the following-sibling axis indicates all the nodes that have the same parent as the context node and appear after the context node in the source document. 11 namespace axe, xpath (not supported) 12 parent axe, xpath the parent axis indicates the single node that is the parent of the context node. it can be abbreviated as two periods (..). 13 preceding axe, xpath the preceding axis indicates all the nodes that precede the context node in the document except any ancestor, attribute and namespace nodes. 14 preceding-sibling axe...
XPath snippets - XPath
scripts 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 xpathns...
XPath
sing xpathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features. xpath uses a path notation (as in urls) for navigating through the hierarchical structure of an xml document. it uses a non-xml syntax so that it can be used in uris and xml attribute values. note: support for xpath varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all. if you need a polyfill, you may consider js-xpath or wicked-good-xpath. documentation introduction to using xpath in javascript describes a non-xslt use of xpath. xpath:axes list and definition o...
Common XSLT Errors - XSLT: Extensible Stylesheet Language Transformations
hose usually tell the mime type. in firefox 6 and forward, you can also use the official xslt mimetype: application/xslt+xml. namespace the xslt 1.0 namespace is http://www.w3.org/1999/xsl/transform. older versions of ie used a different namespace. however these versions also used a draft version of xslt which is incompatible with what eventually became the xslt 1.0 specification. firefox only supports the official xslt 1.0 version. missing features there are some features in the xslt 1.0 specification which firefox unfortunately does not yet support. specifically: the namespace:: axis in xpath expressions. support for this will hopefully be available in the future. the disable-output-escaping attribute. this feature controls how serializing the constructed output document works. how...
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
mplate rules in imported stylesheets. sometimes, however, it is useful to be able to force the processor to use a template rule from the (lower precedence) imported stylesheet rather than an equivalent rule in the main stylesheet. syntax <xsl:apply-imports/> required attributes none. optional attributes none. type instruction, appears within a template. defined xslt, section 5.6. gecko support supported. ...
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
of the attribute set. the name must be a valid qname. optional attributes use-attribute-sets builds an attribute set from other attribute sets. the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 7.1.4. gecko support supported. ...
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › copy
the current node. syntax <xsl:copy use-attribute-sets=list-of-names> template </xsl:copy> required attributes none. optional attributes use-attribute-sets lists attribute sets that should be applied to the output node, if it is an element. names of the sets should be separated with whitespace characters. type instruction, appears within a template. defined xslt, section 7.5. gecko support supported. ...
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
ro character. the default is (0). digit specifies the character used in the format pattern to stand for a digit. the default is (#). pattern-separator specifies the character separating positive and negative subpatterns in a format pattern. the default is the semi-colon (;). type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 12.3. gecko support supported as of 1.0 (mozilla 1.0, netscape 7.0). ...
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › element
must be a valid qname. optional attributes namespace specifies the namespace of the output element. use-attribute-sets a whitespace‐separated list of attribute-set element names to be applied to the element element’s output element. applied attributes can be overridden via nested attribute elements. type instruction, appears within a template. defined xslt, section 7.1.2. gecko support supported. ...
<xsl:fallback> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › fallback
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:fallback> element specifies what template to use if a given extension (or, eventually, newer version) element is not supported. syntax <xsl:fallback> template </xsl:fallback> required attributes none. optional attributes none. type instruction, appears within a template. defined xslt, section 15 gecko support not supported at this time. ...
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › if
yntax <xsl:if test=expression> template </xsl:if> required attributes test contains an xpath expression that can be evaluated (using the rules defined for boolean( ) if necessary) to a boolean value. if the value is true, the template is processed; if it is not, no action is taken. optional attributes none. type instruction, appears within a template. defined xsl section 9.1. gecko support supported ...
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › import
included stylesheet have exactly the same precedence as the contents of the including stylesheet. syntax <xsl:import href=uri /> required attributes href specifies the uri of the stylesheet to import. optional attributes none. type top-level, must appear before any other child of <xsl:stylesheet> or <xsl:transform> in the importing stylesheet. defined xslt, section 2.6.2. gecko support mostly supported with a few issues with top level variables and parameters as of mozilla 1.0. ...
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › message
it can be useful for debugging. syntax <xsl:message terminate="yes" | "no" > template </xsl:message> required attributes none. optional attributes terminate set to "yes", indicates that execution should be terminated. the default value is "no", in which case the message is output and execution continues. type instruction, appears within a template. defined xslt, section 13. gecko support supported. ...
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
xslt namespace in the output tree. syntax <xsl:namespace-alias stylesheet-prefix=name result-prefix=name /> required attributes stylesheet-prefix specifies the temporary namespace. result-prefix specifies the desired namespace for the output tree. optional attributes none. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 7.1.1 gecko support not supported at this time. ...
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › param
irst child element of the template. syntax <xsl:param name=name select=expression> template </xsl:param> required attributes name names the parameter. this must be a qname. optional attributes select uses an xpath expression to provide a default value if none is specified. type instruction, can appear as a top-level element or within a template. defined xslt, section 11. gecko support supported. ...
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › template
xsl:apply-templates> element. this is useful for processing the same information in multiple ways. priority specifies a numeric priority for this template. this can be any number other than infinity. the processor uses this number when more than one template matches the same node. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 5.3. gecko support supported. ...
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › text
ttribute is essentially irrelevant in context. to output html-entities, use numerical values instead, eg &#160; for &nbsp;) specifies whether special characters are escaped when written to the output. the available values are "yes" or "no". if "yes" is set, for example, the character > is output as >, not as &gt;. type instruction, appears within a template. defined xslt, section 7.2 gecko support supported as noted. ...
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › value-of
ttribute is essentially irrelevant in context. to output html-entities, use numerical values instead, eg &#160 for &nbsp) specifies whether special characters are escaped when written to the output. the available values are "yes" or "no". if "yes" is set, for example, the character > is output as >, not as "&gt". type instruction, appears with a template. defined xslt, section 7.6.1. gecko support supported except as above. ...
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › variable
le through an xpath expression. if the element contains a template, this attribute is ignored. type top-level or instruction. if it occurs as a top-level element, the variable is global in scope, and can be accessed throughout the document. if it occurs within a template, the variable is local in scope, accessible only within the template in which it appears. defined xslt, section 11. gecko support supported. ...
<xsl:when> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › when
l:choose> element, acting like a case statement. syntax <xsl:when test=expression> template </xsl:when> required attributes test specifies a boolean expression to be evaluated. if true, the contents of the element are processed; if false, they are ignored. optional attributes none. type subinstruction, always appears within an <xsl:choose> element. defined xslt, section 9.2. gecko support supported. ...
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
cument is itself an htmldocument, or if the output method of the stylesheet is html. it will not produce an html dom objects if only the toplevel element of the result is <html> as xsltprocessor.transformtofragment() is rarely used to create this element. if you want to override this, you can set the output method normally in the standard way. transforming html unfortunately it is currently not supported to transform html nodes using xslt. some things work if you use lower case node-names in patterns and expressions, and treat the nodes as if they are in the null namespace, however this is not very well tested so it might not work in all situations. it is also possible that this will change in a future release. transforming xhtml should work as expected though. setting parameters you can...
Introduction - XSLT: Extensible Stylesheet Language Transformations
javascript 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. since the xml data loaded only contains the raw information without any presentation data, it can load quickly even on dialup. xslt allows the author to directly manipulate the structure of a document. for example, it permits the rearranging and sorting of elements; it also provides more fine-grained control of the resulting document's structure. as of mozilla 1.2, gecko enables javascript to create xslt processors. this article covers xslt/javascript bindings in gecko. ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
it is enabled by default in firefox 52+ and chrome 57+/latest opera (you can also run wasm code in firefox 47+ by enabling the javascript.options.wasm flag in about:config, or chrome (51+) and opera (38+) by going to chrome://flags and enabling the experimental webassembly flag.) note: if you try to open generated html file (hello.html) directly from your local hard drive (e.g...
WebAssembly Concepts - WebAssembly
pile step, and has a huge ecosystem that provides powerful frameworks, libraries, and other tools. webassembly is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages with low-level memory models such as c++ and rust with a compilation target so that they can run on the web. (note that webassembly has the high-level goal of supporting languages with garbage-collected memory models in the future.) with the advent of webassembly appearing in browsers, the virtual machine that we talked about earlier will now load and run two types of code — javascript and webassembly. the different code types can call each other as required — the webassembly javascript api wraps exported webassembly code with javascript functions t...
Exported WebAssembly functions - WebAssembly
lts to console too, which gives the same results. they are real functions in the previous example, the return value of each table.prototype.get() call is an exported webassembly function — exactly what we have been talking about. it is worth noting that these are real javascript functions, in addition to being wrappers for webassembly functions. if you load the above example in a webassembly-supporting browser, and run the following lines in your console: var testfunc = othertable.get(0); typeof testfunc; you'll get the result function returned. you can then go on to do pretty much anything to this function that you can do to other functions in javascript — call(), bind(), etc. testfunc.tostring() returns an interesting result: function 0() { [native code] } this gives you more...
Compiling from Rust to WebAssembly - WebAssembly
he third line is a function signature, written in rust. it says "the alert function takes one argument, a string named s." as you might suspect, this is the alert function provided by javascript. we call this function in the next section. whenever you want to call javascript functions, you can add them to this file, and wasm-bindgen takes care of setting everything up for you. not everything is supported yet, but we're working on it. please file bugs if something is missing. producing rust functions that javascript can call the final part is this one: #[wasm_bindgen] pub fn greet(name: &str) { alert(&format!("hello, {}!", name)); } once again, we see the #[wasm_bindgen] attribute. in this case, it's not modifying an extern block, but a fn; this means that we want this rust function ...